简体   繁体   中英

About flashing boot image of Android

I am not familiar with a Android kernel compile process. But I encountered a problem recently, and it troubled me so much.

Here is the problem descrition: Based on Android, I build customed images including boot.img, system.img and so on. Then I need to flash those images to physical device in order to boot to Android Home Screen. Before compiling those images files, I have set a new kernel command line:

CONFIG_CMDLINE="root=/dev/mtdblock2 rw init=/init console=ttyS0, 115200 mem=128M uard_dma android"

After compiling those images, I opened boot.img in vim and saw the following string in it:

"root=/dev/mtdblock2 rw init=/init console=ttyS0, 115200 mem=128M uard_dma android"

But when I flashed the boot.img into device, I got the different output like this:

**Kernel command line: console=ttyO2,115200n8 earlyprintk**

In other word, I set the kernel command line value, and it was wrote into boot.img, but when flash boot.img into device, I got a different kernel command line value.

Has anybody ever encountered this problem and got it fixed?
Really appreciating your help.
Thanks advanced!

The bootloader will be passing a command line to the kernel.
For example if u-boot bootloader is used,
it will be contained in the u-boot variable bootargs

This can be verified at the bootloader prompt.
For example if the device is using u-boot bootloader.

  1. Connect the device to your PC over a serial prompt.

  2. Launch a serial emulator on your PC (minicom, teraterm, hyper-terminal).

  3. Power-on the device.

  4. Press any key to halt the device boot at the bootloader stage itself.

  5. Now on the u-boot prompt enter the following command:

    u-boot# printenv

  6. This will list all the uboot-variables. Note the value of variable bootargs .

  7. This can be modified by using the following command:

    u-boot# setenv bootargs ''

  8. To save this value across reboots use the following commmand:

    u-boot# saveenv

Similar functionality is available in other bootloaders as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM