Red Hat Bugzilla – Bug 109227
patch - enhancement - setdefault N - new command
Last modified: 2007-03-27 00:11:33 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624
Description of problem:
Ive done a slightly rough patch on grub-0.93.7 to add 'setdefault N'
command to grub-shell & stage2. setdefault is very closely based upon
savedefault, the ONLY difference is that it takes an argument,
allowing its use to define a sequence of different boot-entries.
This is intended to support the use of one box to run multiple OSs,
where each OS is setup (via rc.local or similar) to run a battery of
build,tests under each OS. I intend to use it to run 'smoketests' on
Perl 5.6.2, 5.8.2, 5.9.0, etc, but it should also be usable for the
Linux Kernel Test Project.
I sent this yesterday to firstname.lastname@example.org, but I thought that maybe
this could stand another set of eyes.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
NA - this is an enhancement patch
Created attachment 95737 [details]
patch to code
This patch adds a new command to grub - setdefault.
Its a close derivative of savedefault, the only difference is that it expects a
numeric argument, where original uses an implicit argument.
Its purpose is to support multi-kernel testing; a grub.conf can specify a
of different kernels to run, which *presumably* would execute some substantial
set of tests, then reboot to the next kernel, which would repeat until the last
setdefault (ie: 0 in example below) returned the box to normal operation.
Heres a sequence of 4 kernels on my machine:
# Here are the sequential boot tests
title Test RH 7.2 (2.4.20-20.7)
kernel /vmlinuz-2.4.20-20.7 ro root=LABEL=/
title Test RH 7.2 (2.4.20-18.7)
kernel /vmlinuz-2.4.20-18.7 ro root=LABEL=/
title Test RedHat 9 (2.4.20-20.9)
kernel /boot/vmlinuz-2.4.20-20.9 ro root=LABEL=/1
title Test RedHat 9 (2.4.20-8)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/1
I expect to combine this with a runlevel=4 or similar to make it easy to
the *smoke-test* and reboot from rc.local.
The patch is against RH grub-0.93-7 srpm, which has 18 patches for
Its also somewhat unfinished;
1. I copy-pasted verbatim from savedefault_helper to setdefault_helper
The 'right' thing to do would be to rename savedefault_helper as
and modify savedefault to call it. IOW, savedefault is higher-level than
and should be implemented on top. Doing this however felt a bit too brazen.
2. No (proper patch to the source of ) docs.
I couldnt quite make out from docs/Makefile.am which texi/info/etc file to
I added stuff into grub.texi.config.new, with hope that it could be easily
into wherever it belongs.
I also left some of the help-text in static struct builtin
I am unsure whether any of the options should be allowed; I think --once
would not make
any sense though. I did not strip the code for those options, so I thought
it best to leave
an inappropriate marker.
Created attachment 95738 [details]
I'm avoiding adding new features into grub that aren't accepted
upstream at this point to avoid the long-term pain. I see you've sent
it there and I'll watch the progress upstream.
Created attachment 95739 [details]
apologies - I missed the patch-checkbox on 1st attach, redoing incase theres
automation that handles this differently