1

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!

4

1 回答 1

1

引导加载程序会将命令行传递给内核。
例如,如果使用u-boot bootloader,
它将包含在 u-boot 变量bootargs

这可以在引导加载程序提示符下进行验证。
例如,如果设备正在使用 u-boot 引导加载程序。

  1. 通过串行提示将设备连接到您的 PC。

  2. 在您的 PC 上启动串行仿真器(minicom、teraterm、超级终端)。

  3. 开启设备。

  4. 按任意键在引导加载程序阶段本身停止设备引导。

  5. 现在在 u-boot 提示符下输入以下命令:

    u-boot# printenv

  6. 这将列出所有 uboot 变量。注意变量bootargs的值。

  7. 这可以通过使用以下命令进行修改:

    u-boot# setenv bootargs ''

  8. 要在重新启动后保存此值,请使用以下命令:

    u-boot# saveenv

其他引导加载程序也提供类似的功能。

于 2012-09-20T11:15:43.800 回答