Booting an Android emulator using initrd.img

We can execute the following command to boot the system using initrd.img first:

$ cd $OUT 
$ emulator @a25x86 -ranchu -verbose -show-kernel -system ./system-qcow2.img -ramdisk ./initrd.img -initdata ./userdata-qcow2.img -kernel ./kernel -qemu -netdev user,id=mynet1,net=10.0.2.0/24,dhcpstart=10.0.2.50 -device virtio-net,netdev=mynet1

In the preceding command, we use QCOW2-format images for both system and user data, since they are much smaller than the plain file images. We use initrd.img as the ramdisk so that we can debug the configuration in the first stage of boot up. We can also change this script to use ramdisk.img directly. In this case, it is the normal start up process of the emulator.

Once we start the emulator using initrd.img, we can enter the debug console, in which we can check the configuration and make necessary changes before we move forward.

From the output, we can see that the system image on the device, /dev/block/vda, is mounted to /android/system. At this point, we have an opportunity to check and change any start up scripts before we launch them. For example, we can edit init.ranchu.rc to increase the debug level of wpa_supplicant with the -dd option before we start the Android system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.214.141