grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: RFC: multi-os configuration


From: lode leroy
Subject: FW: RFC: multi-os configuration
Date: Fri, 27 Aug 2010 10:14:47 +0200

>
> I just thought of the following solution to the problem mentioned
> here lately about OS's generating "/boot/grub/grub.cfg" from templates.
>
> Would it not be better for grub to do this instead of the OS?
>
> If the user asks the OS to *install* grub, the installing OS should install
> a default grub.cfg, as is done now.
>
> If the user asks the OS to *register* with grub, the installing OS should
> install a file "/boot/grub/grub.sub" with an entry for booting itself,
> on whatever it considers it's "/boot" partition.
> (a provision could be made to add a number in the .sub file to indicate
> the order of the menu entries, to be entered by the user.)
>
> When reading grub.cfg, grub would find a function call 
> "insert_dynamic_menuentries()"
> it should then scan all known partitions, and see if a file 
> "/boot/grub/grub.sub" exist,
> if it does, it sets the variable "root" to the partition name, and includes 
> the file.
>
>
> This way, an OS should only manage it's own entry...
>
>
>
> a more elaborate example below:
>
> cat (hd0,0)/boot/grub/grub.cfg
> ==========================================
>
> insmod gfxterm
> background_image (hd0,0)/boot/grub/splash.jpg
>
> insert_dynamic_menuentries()
>
> menuentry "Boot first partition"
> {
>   set root=(hd0,1)
>   chainloader +1
> }
> ==========================================
>
>
> cat (hd0,1)/boot/grub/grub.sub
> ==========================================
> # For booting GNU/Hurd
> menuentry "GNU (aka GNU/Hurd)" 2 {
>     multiboot /boot/gnumach.gz root=device:hd0s1
>     module /hurd/ext2fs.static ext2fs --readonly \
>             --multiboot-command-line='${kernel-command-line}' \
>             --host-priv-port='${host-port}' \
>             --device-master-port='${device-port}' \
>             --exec-server-task='${exec-task}' -T typed '${root}' \
>             '$(task-create)' '$(task-resume)'
>     module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'
> }
> ==========================================
>
>
> cat (hd0,2)/boot/grub/grub.sub
> ==========================================
> # For booting GNU/Linux
> menuentry "GNU/Linux" 1 {
>     linux /boot/vmlinuz root=/dev/sda3
>     initrd /boot/initrd.img
> }
>
> ==========================================
>
>
>
>
>
>
>
>
>
> equivalent grub.cfg
> ==========================================
>
> insmod gfxterm
>
> background_image (hd0,0)/boot/grub/splash.jpg
>
> menuentry "GNU/Linux" {
>     set root=(hd0,2)
>     linux /boot/vmlinuz root=/dev/sda3
>     initrd /boot/initrd.img
> }
>
> menuentry "GNU (aka GNU/Hurd)" {
>     set root=(hd0,1)
>     multiboot /boot/gnumach.gz root=device:hd0s1
>     module /hurd/ext2fs.static ext2fs --readonly \
>             --multiboot-command-line='${kernel-command-line}' \
>             --host-priv-port='${host-port}' \
>             --device-master-port='${device-port}' \
>             --exec-server-task='${exec-task}' -T typed '${root}' \
>             '$(task-create)' '$(task-resume)'
>     module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'
> }
>
> menuentry "Boot first partition"
> {
>   set root=(hd0,1)
>   chainloader +1
> }
>
>
> ==========================================
>
>
>
                                          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]