1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.1 2005/04/21 14:23:12 rocket Exp $
4 . ${clst_sharedir}/targets/support/functions.sh
5 . ${clst_sharedir}/targets/support/filesystem-functions.sh
7 # $1 is the destination root
10 extract_kernels $1/boot
14 default_append_line="initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=off ${cmdline_opts} ${custom_kopts} cdroot"
16 case ${clst_mainarch} in
18 acfg=$1/etc/aboot.conf
20 for x in ${clst_boot_kernel}
22 echo -n "${bctr}:/boot/${x} " >> ${acfg}
23 echo -n "initrd=/boot/${x}.igz root=/dev/ram0 " >> ${acfg}
24 echo "init=/linuxrc ${cmdline_opts} cdroot" >> ${acfg}
32 icfg=$1/boot/palo.conf
33 kmsg=$1/boot/kernels.msg
35 echo "--commandline=0/${first} initrd=${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts}" >> ${icfg}
36 echo "--bootloader=boot/iplboot" >> ${icfg}
37 echo "--ramdisk=boot/${x}.igz" >> ${icfg}
39 # for x in $clst_boot_kernel
42 # eval custom_kopts=\$${x}_kernelopts
43 # echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
45 # echo "label $x" >> $icfg
46 # echo " kernel $x" >> $icfg
47 # echo " append initrd=$x.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot vga=0x317 splash=silent" >> $icfg
50 # echo "label $x-nofb" >> $icfg
51 # echo " kernel $x" >> $icfg
52 # echo " append initrd=$x.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot" >> $icfg
54 # echo " ${x}-nofb" >> $kmsg
60 # The specs indicate the kernels to be build. We need to put
61 # those kernels and the corresponding initrd.img.gz(s) in the
62 # /boot directory. This directory contains a message boot.msg
63 # containing some info to be displayed on boot, a configuration
64 # (yaboot.conf) specifying the boot options (kernel/initrd
65 # combinations). The boot directory also contains a file called
66 # yaboot, which normally gets copied from the live environment.
67 # For now we supply a prebuilt file, prebuilt configuration
68 # and prebuilt boot message. This can be enhanced later on
69 # but the following suffices for now:
72 scfg=$1/boot/silo.conf
73 echo "default=\"help\"" > ${scfg}
74 echo "message=\"/boot/boot.msg\"" >> ${scfg}
76 for x in ${clst_boot_kernel}
79 echo "image=\"/boot/${x}\"" >> ${scfg}
80 echo -e "\tlabel=\"${x}\"" >> ${scfg}
81 echo -e "\tappend=\"initrd=/boot/${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} cdroot\"" >> ${scfg}
85 echo "image=\"cat /boot/silo.conf\"" >> ${scfg}
86 echo -e "label=\"config\"" >> ${scfg}
87 echo "image=\"cat /boot/video.msg\"" >> ${scfg}
88 echo -e "label=\"video\"" >> ${scfg}
89 echo "image=\"cat /boot/help.msg\"" >> ${scfg}
90 echo -e "label=\"help\"" >> ${scfg}
93 if [ -e $1/boot/isolinux.bin ]
95 # the rest of this function sets up the config file for isolinux
96 icfg=$1/boot/isolinux.cfg
97 kmsg=$1/boot/kernels.msg
99 echo "default ${first}" > ${icfg}
100 echo "timeout 150" >> ${icfg}
101 echo "prompt 1" >> ${icfg}
102 echo "display boot.msg" >> ${icfg}
103 echo "F1 kernels.msg" >> ${icfg}
104 echo "F2 help.msg" >> ${icfg}
106 echo "Available kernels:" > ${kmsg}
107 cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg}
109 for x in ${clst_boot_kernel}
112 eval custom_kopts=\$${x}_kernelopts
113 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
115 echo "label ${x}" >> ${icfg}
116 echo " kernel ${x}" >> ${icfg}
117 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
119 echo " append ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
121 echo " append ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
125 echo " ${x}" >> ${kmsg}
126 echo "label ${x}-nofb" >> ${icfg}
127 echo " kernel ${x}" >> ${icfg}
128 echo " append ${default_append_line} " >> ${icfg}
130 echo " ${x}-nofb" >> ${kmsg}
133 if [ -f $1/boot/memtest86 ]
136 echo " memtest86" >> $kmsg
137 echo " title memtest86" >> $icfg
138 echo " kernel memtest86" >> $icfg
142 if [ -e $1/boot/grub/stage2_eltorito ]
144 icfg=$1/boot/grub/grub.conf
145 hmsg=$1/boot/grub/help.msg
146 echo "default 1" > ${icfg}
147 echo "timeout 150" >> ${icfg}
149 echo "title help" >> ${icfg}
150 echo "cat /boot/grub/help.msg" >> ${icfg}
151 for x in ${clst_boot_kernel}
153 eval custom_kopts=\$${x}_kernelopts
154 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
156 echo "title ${x}" >> ${icfg}
158 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
160 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
162 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
165 if [ -e $1/boot/${x}.igz ]
167 echo "initrd /boot/${x}.igz" >> ${icfg}
171 echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
172 echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
173 if [ -e $1/boot/${x}.igz ]
175 echo "initrd /boot/${x}.igz" >> ${icfg}
179 if [ -f $1/boot/memtest86 ]
182 echo "title memtest86" >> ${icfg}
183 echo "kernel /boot/memtest86" >> ${icfg}