![如何查看和更改 Nexus 7 在启动时使用的内核引导参数?](https://linux22.com/image/1097609/%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8B%E5%92%8C%E6%9B%B4%E6%94%B9%20Nexus%207%20%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E4%BD%BF%E7%94%A8%E7%9A%84%E5%86%85%E6%A0%B8%E5%BC%95%E5%AF%BC%E5%8F%82%E6%95%B0%EF%BC%9F.png)
如果用户想要修改内核命令行,我该怎么做?我可以使用“cat /proc/cmdline”来查看 bootargs 吗?
答案1
/proc/cmdline 将为您提供当前的启动参数,但也会显示大量技术上不可修改的数据。
我建议使用: sudo abootimg -i /dev/mmcblk0p2
这应该会给你类似的输出:
ubuntu@nexus7-265143b8:~$ sudo abootimg -i /dev/mmcblk0p2
Android Boot Image Info:
* file name = /dev/mmcblk0p2 [block device]
* image size = 8388608 bytes (8.00 MB)
page size = 2048 bytes
* Boot Name = ""
* kernel size = 4522232 bytes (4.31 MB)
ramdisk size = 2182999 bytes (2.08 MB)
* load addresses:
kernel: 0x10008000
ramdisk: 0x11000000
tags: 0x10000100
* cmdline = root=/dev/mmcblk0p9 ro console=tty1 fbcon=rotate:1 quiet
* id = 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
要修改命令行参数,请发出以下命令:
sudo abootimg -u /dev/mmcblk0p2 -c cmdline ='foo bar baz'