Saturday, 28 January 2017

AOSP - Android Source Building Comprehensive Guide

Binaries Generated By The Build

1. boot.img
boot.img contains the kernel and ramdisk, critical files necessary to load the device before the filesystem can be mounted. You have to generate the boot.img yourself using mkbootimg, a tool provided by AOSP.

2.kernel
Binary for linux kernel.

3. ramdisk.img
ramdisk.img is a small partition image that is mounted read-only by the kernel at boot time.
It only contains /init and a few config files.
It is used to start init which will mount the rest of the system images properly and run the init procedure.

A Ramdisk is a standard Linux feature.


4. ramdisk-recovery.img
Recovery image for ramdisk.

5. recovery.img
It is the Android recovery image.

A bootable program on an Android flash memory partition that is used to perform a factory reset or restore the original OS version. In order to install a different OS version (a different ROM), the stock recovery image must be replaced with a custom version such as ClockworkMod Recovery. After rooting the Android, utilities such as ROM Manager install the custom recovery, which is then used to install the custom ROM.

6. userdata.img
userdata.img is a partition image that can be mounted as /data and thus contains all application-specific and user-specific data.   

7. system.img
system.img is a partition image that will be mounted as / and thus contains all system binaries

8. full_mako-img-eng.nsk.zip
A full update is one where the entire final state of the device (system, boot, and recovery partitions) is contained in the package. As long as the device is capable of receiving the package and booting the recovery system, the package can install the desired build regardless of the current state of the device.

Friday, 27 January 2017

Linux Troubleshooting

1. How do I fix a “Problem with MergeList” or “status file could not be parsed” ?

sudo rm -vf /var/lib/apt/lists/*
sudo apt-get update


2. How to run 32 bit binaries on 64 bit Linux ?

sudo dpkg --add-architecture i386

Or if you are using Ubuntu 12.04 LTS (Precise Pangolin) or below, use this:

echo "foreign-architecture i386" > /etc/dpkg/dpkg.cfg.d/multiarch

Then:

sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

3. How to remove openjdk ?

sudo apt-get purge openjdk*

Thursday, 26 January 2017

Linux rsync comand usage examples

rsync
-a
--progress
--delete = delete files/folders from /destination that are not on /source (so /destination is an exact mirror of /source)
--exclude
--dry-run
Always start with -n (fake run) before doing a real run.
-r = recursive (copy all directories, contents and their subdirectories)
-v = be verbose


1. Sync dirs
rsync -av --delete src/  dest/

2. With SSH
rsync -av –delete -e ssh /Directory1/ geek@192.168.235.137:/
Directory2/

3. With SSH and port
rsync -av –delete -e 'ssh -p 12345' /Directory1/ geek@192.168.235.137:/Directory2/