Saturday, March 1, 2008

setup, boot loader tips (using grub)

note:
simplify configuration files and create symlinks

example

1. simplify

(using grub legacy config)

default 0
timeout 3
title desktop-linux {
kernel /boot/linux-desktop
initrd /boot/initrd-desktop
}

title server-linux {
kernel /boot/linux-server
initrd /boot/initrd-server
}

2. use symlinks

example contents of /boot directory

root-shell$ ls
linux-desktop -> linux-2.6.24.5-optimize_for_desktop
linux-server -> linux-2.6.24.5-optimize_for_server
linux-2.4.36.2-optimize_for_desktop
linux-2.4.36.2-optimize_for_server
linux-2.6.24.5-optimize_for_desktop
linux-2.6.24.5-optimize_for_server
initrd-server -> initrd-x01.gz-optimize_for_server
initrd-desktop -> initrd-x01.gz-optimize_for_desktop
initrd-x01.gz-optimize_for_server
initrd-x02.gz-optimize_for_server
initrd-x01.gz-optimize_for_desktop
initrd-x02.gz-optimize_for_desktop

reason:
1. ease of maintenace.
2. example scenario, after compilation of an upgrade to linux-kernel, we can easily create symlinks rather than edit the bootloaders configuration files every time we have an upgrade.

example...
cp linux-[new.version] /boot
ln -sf linux-[new.version] /boot/linux-desktop