[WBEL-devel] Boot Image Manipulation Tool - bootcrack

Lynn, Michael (IDS DM&DS) michael_lynn@ml.com
Fri, 26 Dec 2003 11:37:16 -0500


Greetings,

I maintain a customized version of RHEL for my company and I've written a script that greatly simplifies the process of modifying boot images (bootnet.img, boot.img, cdboot.img, etc).  I figured you
folks may find something like this useful.

The specific tasks it saves time with is:

- Adding ks.cfg files to bootnet.img/initrd.img's for kickstarts.
- cracking open bootnet.img/initrd.img/modules.cgz for upgrading the kernel version on the boot floppy images.
- Adding kernel modules to boot floppy/cd images.

It creates a working area where the boot image, initrd image and modules.cgz are opened and ready for manipulation.  It also creates a handy "finish" script in the working area which can be used after
your modifications are complete.  The finish script buttons everything back up nice and neat.

Before I go through the process of confronting my company's Open Source Review Board (OSRB) to obtain approval to release this script as open source, I want to get an idea to see if anybody would even
care to see/use this script?  I'm not sure if there is a great demand for something like this and want to make sure it will be worth fighting my OSRB.  

I created a similar open source script a couple years ago called rdstuff (http://sf.net/projects/rdstuff) and I recently found out that RedHat mention this script in their advanced administration
courses.  The new script is much more flexible and provides added functionality such as processing modules.cgz, recreating the ramdisk file system to reduce overall image size, etc.

Please respond if there's any interest in the script... It's nicely packaged (RPM) and comes with doc and a manpage. 

Perhaps you are using another tool and this is redundant?  Perhaps you don't feel that having this bit of automation is necessary?  

Thanks in advance for your time/feedback.

Regards,
Mike

 

Here's the manpage for the script:
---snip---

bootcrack(1)       Boot Floppy Image Utilities       bootcrack(1)

NAME
       bootcrack  -  A handy utility that can crack open boot floppy image files so you can manipu-
       late the contents.

SYNTAX
       bootcrack [OPTIONS] <filename>

DESCRIPTION
       Bootcrack will crack open a boot floppy image file (bootnet.img, boot.img,  cdboot.img)  and
       prepare the contents to be modified.  A boot floppy image is typically a fat/dos file system
       that contains (among other things) an initial ramdisk.  Inside the ramdisk there is  a  mod-
       ules  directory  that  contains  the  kernel  modules to be used during boot.  Bootcrack can
       optionally (-m) unpack the modules.cgz file from an initrd.img.
       Bootcrack also creates a handy "finish" script that can be used to close and  unmount  ever-
       thing after your modifications are complete.

OPTIONS
       -i <filename>
              Specifies boot floppy image file <filename>.

       -t <directory>
              Specifies working directory <directory>

       -m     Enables  modules.cgz processing.  unpacks initrd.img/modules/modules.cgz into working
              directory.

       --help Output help information and exit.

       --version
              Output version information and exit.

FILES
       /usr/bin/bootcrack

EXAMPLES
       To run this program the standard way type:

       bootcrack bootnet.img

              This will use the default working directory /tmp

       To run this program specifying an alternate working directory: bootcrack -i  bootnet.img  -t
       /var/tmp

              Notice  that you need to specify the -i option when you have more than a single argu-
              ment.

       To enable modules.cgz processing:

       bootcrack -i bootnet.img -t /var/tmp -m

AUTHORS
       Mike Lynn <ml@ml.com>

SEE ALSO
       rdstuff(1)

Mike Lynn <ml@ml.com>         1.0.0                  bootcrack(1)