[PATCH] 0/2 RFC: yaboot --bootonce

Doug Maxey dwm at austin.ibm.com
Wed Sep 20 03:39:44 EST 2006


On Mon, 18 Sep 2006 17:07:15 CDT, Dustin Kirkland wrote:
>Often when building and testing kernels, one wants to boot a specific
>kernel in an unattended manner.  Changing the default kernel in the
>bootloader configuration file fulfills this purpose, however, it creates
>a problem when the newly booted kernel is buggy or does not boot.
>
>Ideally, one would be able to specify to the bootloader that a
>particular kernel is to be booted once on the very next boot, but
>subsequent boots would revert back to the default kernel behavior
>specified in the bootloader configuration file.
>
>Other Linux bootloaders provide this functionality in one way or
>another.  In the automated Linux testing space, we have a need for
>Yaboot to provide this functionality for our PPC platforms in an
>unattended manner.
>
>The following patch set is submitted as a Request for Comments in that a
>small bit of functionality is still missing and I could use some
>assistance with that piece.
>
>The design is as follows:
>
>- 1/2: In userspace, extend ybin to understand a --bootonce parameter,
>which takes a bootloader entry label.  If this is an existing, valid
>label in the bootloader configuration file, perform a raw write of that
>value to an empty block in the PReP boot partition.
>
>- 2/2: In bootloader-space, extend the 'default' kernel determination to
>first examine the reserved block in the PReP boot partition for bootonce
>information.  If a valid bootloader entry label is found there, use that
>label as the 'default' entry for this boot, and zero out the data in
>that block so as to not affect subsequent boots.

You might want to look into exactly what the first partition is.  And 
the size.  There are instances on at least one of the distro's where 
the boot partition is FAT12.  In that case, you could just add a file 
with the 8.3 naming.

In the "normal" case, where the first is type 0x41, you could calculate 
the last block, then back up the appropriate amount.  For booting from 
iscsi devices, it is possible that the boot string can exceed 1024 
bytes.   Have not found an instance of that yet, but it is conceivable.

>
>
>Patches follow.  The userspace patch works as is.  The bootloader-space
>is a design prototype requiring some assistance.  Comments and/or code
>would be appreciated.
>
>-- 
>:-Dustin




More information about the Yaboot-devel mailing list