Testing Wi-Fi on an emulator
We have now prepared all the images that we need for the testing process. The prebuilt test images for this chapter can be downloaded from the following URL:
https://sourceforge.net/projects/android-system-programming/files/android-7/ch07/ch07.zip/download
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...