bicl 0.1.0 review

Download
by rbytes.net on

bicl is a tool for editing the built-in command line boot arguments in binary files like the PPC64 Linux compressed kernel image and

License: GPL (GNU General Public License)
File size: 2K
Developer: A. Waterland
0 stars award from rbytes.net

bicl is a tool for editing the built-in command line boot arguments in binary files like the PPC64 Linux compressed kernel image and the PPC64 Xen compressed hypervisor boot image.

he boot argument processing for powerpc Xen is much less complex than it may appear. Assuming that the 'Simplify bootargs processing' patch is accepted in some form, the following rules apply:

1. Arguments from 32-bit wrapper override all else
2. Builtin arguments in 64-bit image override firmware
3. Firmware is used if neither of the above exist

It is true that dom0 Linux has its own boot argument processing, but there is a simple transitive relation between Xen's bootargs and Linux's bootargs. That is, Xen first applies the above three rules to decide what to feed Linux. Linux then applies its three rules (it orders their precedence slightly differently) to decide what to feed the kernel proper.

The format of the builtin command line buffer is essentially just a seperate ELF section, which makes it easy for post-processing tools to locate it and edit it. If you have a 2.6.17 or later zImage kernel available, the following is illustrative:

$ objdump -h arch/powerpc/boot/zImage | grep cmdline
2 __builtin_cmdline 00000200 00406274 00406274 00016274 2**2

The format of the builtin command line buffer is simple, so many tools may one day understand it, but at present the most commonly-used tool is `bicl', which is shipped under the LGPL as part of the K42 source:

http://www.cs.unm.edu/~k42/tools/bicl

The usage of the tool is simple:

$ bicl
`builtin-cmdline' manipulates builtin command line arguments

Usage: builtin-cmdline FILE [ARGS]
-?, --help Show this help statement.
--version Show version statement.

Examples: builtin-cmdline zImage

builtin-cmdline zImage 'console=ttyS0'

The tool is used every day to edit the builtin command lines of Linux and Xen binaries as part of an internal IBM project.

bicl 0.1.0 keywords