]> git.ozlabs.org Git - yaboot.git/commit
ybin userland interface for specifying bootonce
authorPaul Nasrat <pnasrat@redhat.com>
Thu, 19 Apr 2007 09:14:24 +0000 (10:14 +0100)
committerPaul Nasrat <pauln@enki.eridu>
Thu, 19 Apr 2007 09:14:24 +0000 (10:14 +0100)
commita5b19d45fb5569f68e56445536296188b2ec0809
tree0d1f0474e0ff6b0e06413149d414762a093e4734
parent89f352cbee373069ed035476cb4c18027ff0a5b3
ybin userland interface for specifying bootonce

Add an option to ybin called "--bootonce" that takes exactly one
argument, the label of the kernel to boot exactly once, on next reboot.

Do some sanity checking.  Grep through the yaboot config file to make
sure that label=WHATEVER exists somewhere, bail if not.  Try to prune
out comment lines.  Perhaps this might be implemented better.  It worked
will in my testing, though.

Set the boot-once OF environment variable to the --bootonce value.  Due
to the previously mentioned nvsetenv bug, this will fail silently if
you're trying to set boot-once on a system where boot-once doesn't
already exist in nvram.  Thus, immediately after doing the set, try and
read it back out of nvsetenv and make sure it landed there.  Bail if
not.

Signed-off-by: Dustin Kirkland <dustin.kirkland@us.ibm.com>
ybin/ybin