2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.11 2005/08/09 19:02:31 rocket Exp $
5 . ${clst_sharedir}/targets/support/functions.sh
6 . ${clst_sharedir}/targets/support/filesystem-functions.sh
8 # $1 is the destination root
11 extract_kernels $1/boot
16 default_append_line="initrd=${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot"
18 case ${clst_mainarch} in
20 acfg=$1/etc/aboot.conf
22 for x in ${clst_boot_kernel}
24 echo -n "${bctr}:/boot/${x} " >> ${acfg}
25 echo -n "initrd=/boot/${x}.igz root=/dev/ram0 " >> ${acfg}
26 echo "init=/linuxrc ${cmdline_opts} cdroot" >> ${acfg}
34 icfg=$1/boot/palo.conf
35 kmsg=$1/boot/kernels.msg
37 echo "--commandline=0/${first} initrd=${first}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts}" >> ${icfg}
38 echo "--bootloader=boot/iplboot" >> ${icfg}
39 echo "--ramdisk=boot/${first}.igz" >> ${icfg}
44 # The specs indicate the kernels to be build. We need to put
45 # those kernels and the corresponding initrd.img.gz(s) in the
46 # /boot directory. This directory contains a message boot.msg
47 # containing some info to be displayed on boot, a configuration
48 # (yaboot.conf) specifying the boot options (kernel/initrd
49 # combinations). The boot directory also contains a file called
50 # yaboot, which normally gets copied from the live environment.
51 # For now we supply a prebuilt file, prebuilt configuration
52 # and prebuilt boot message. This can be enhanced later on
53 # but the following suffices for now:
55 # this sets up the config file for yaboot
56 icfg=$1/boot/yaboot.conf
58 echo "default ${first}" > ${icfg}
59 echo "timeout 300" >> ${icfg}
60 echo "device=cd:" >> ${icfg}
61 echo "root=/dev/ram" >> ${icfg}
62 echo "fgcolor=white" >> ${icfg}
63 echo "bgcolor=black" >> ${icfg}
64 echo "message=/boot/boot.msg" >> ${icfg}
65 for x in ${clst_boot_kernel}
67 eval custom_kopts=\$${x}_kernelopts
68 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
70 echo "image=/boot/${x}" >> ${icfg}
71 echo "initrd=/boot/${x}.igz" >> ${icfg}
72 echo "label=${x}" >> ${icfg}
73 echo "read-write" >> ${icfg}
74 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
76 echo "append ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
78 echo "append ${default_append_line} vga=791 splash=silent ${keymap}" >> ${icfg}
83 scfg=$1/boot/silo.conf
84 echo "default=\"help\"" > ${scfg}
85 echo "message=\"/boot/boot.msg\"" >> ${scfg}
87 for x in ${clst_boot_kernel}
90 echo "image=\"/boot/${x}\"" >> ${scfg}
91 echo -e "\tlabel=\"${x}\"" >> ${scfg}
92 echo -e "\tappend=\"initrd=/boot/${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} cdroot\"" >> ${scfg}
96 echo "image=\"cat /boot/silo.conf\"" >> ${scfg}
97 echo -e "label=\"config\"" >> ${scfg}
98 echo "image=\"cat /boot/video.msg\"" >> ${scfg}
99 echo -e "label=\"video\"" >> ${scfg}
100 echo "image=\"cat /boot/help.msg\"" >> ${scfg}
101 echo -e "label=\"help\"" >> ${scfg}
104 iacfg=$1/boot/elilo.conf
105 echo 'prompt' > ${iacfg}
106 echo 'message=/efi/boot/elilo.msg' >> ${iacfg}
107 echo 'chooser=simple' >> ${iacfg}
108 echo 'timeout=50' >> ${iacfg}
110 for x in ${clst_boot_kernel}
112 echo "image=/efi/boot/${x}" >> ${iacfg}
113 echo " label=${x}" >> ${iacfg}
114 echo ' append="'${default_append_line}'"' >> ${iacfg}
115 echo " initrd=/efi/boot/${x}.igz" >> ${iacfg}
117 echo "image=/efi/boot/${x}" >> ${iacfg}
118 echo " label=${x}-serial">> ${iacfg}
119 echo ' append="'${default_append_line}' console=tty0 console=ttyS0,9600"' >> ${iacfg}
120 echo " initrd=/efi/boot/${x}.igz" >> ${iacfg}
123 cp ${iacfg} $1/boot/efi/boot
124 mv $1/boot/${x}{,.igz} $1/boot/efi/boot
127 if [ -e $1/boot/isolinux.bin ]
129 # the rest of this function sets up the config file for isolinux
130 icfg=$1/boot/isolinux.cfg
131 kmsg=$1/boot/kernels.msg
132 hmsg=$1/boot/help.msg
133 echo "default ${first}" > ${icfg}
134 echo "timeout 150" >> ${icfg}
135 echo "prompt 1" >> ${icfg}
136 echo "display boot.msg" >> ${icfg}
137 echo "F1 kernels.msg" >> ${icfg}
138 echo "F2 help.msg" >> ${icfg}
140 echo "Available kernels:" > ${kmsg}
141 cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg}
143 case ${clst_livecd_type} in
149 for x in ${clst_boot_kernel}
152 eval custom_kopts=\$${x}_kernelopts
153 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
155 echo "label ${x}" >> ${icfg}
156 echo " kernel ${x}" >> ${icfg}
157 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
159 echo " append ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet ${keymap}" >> ${icfg}
161 echo " append ${default_append_line} vga=791 splash=silent ${keymap}" >> ${icfg}
165 echo " ${x}" >> ${kmsg}
166 echo "label ${x}-nofb" >> ${icfg}
167 echo " kernel ${x}" >> ${icfg}
168 echo " append ${default_append_line} ${keymap}" >> ${icfg}
170 echo " ${x}-nofb" >> ${kmsg}
173 if [ -f $1/boot/memtest86 ]
176 echo " memtest86" >> $kmsg
177 echo "label memtest86" >> $icfg
178 echo " kernel memtest86" >> $icfg
182 if [ -e $1/boot/grub/stage2_eltorito ]
184 icfg=$1/boot/grub/grub.conf
185 echo "default 1" > ${icfg}
186 echo "timeout 150" >> ${icfg}
190 hmsg=${clst_sharedir}/livecd/files/x86-help.msg
191 hmsg_txt="$(cat ${hmsg})"
194 echo "title help" >> ${icfg}
195 echo "pause ${hmsg_txt}" >> ${icfg}
198 for x in ${clst_boot_kernel}
200 eval custom_kopts=\$${x}_kernelopts
201 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
203 echo "title ${x}" >> ${icfg}
205 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
207 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
209 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
212 if [ -e $1/boot/${x}.igz ]
214 echo "initrd /boot/${x}.igz" >> ${icfg}
218 echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
219 echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
220 if [ -e $1/boot/${x}.igz ]
222 echo "initrd /boot/${x}.igz" >> ${icfg}
226 if [ -f $1/boot/memtest86 ]
229 echo "title memtest86" >> ${icfg}
230 echo "kernel /boot/memtest86" >> ${icfg}