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.10 2005/07/05 17:48:21 wolf31o2 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=${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts}" >> ${icfg}
38 echo "--bootloader=boot/iplboot" >> ${icfg}
39 echo "--ramdisk=boot/${x}.igz" >> ${icfg}
41 # for x in $clst_boot_kernel
44 # eval custom_kopts=\$${x}_kernelopts
45 # echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
47 # echo "label $x" >> $icfg
48 # echo " kernel $x" >> $icfg
49 # echo " append initrd=$x.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot vga=0x317 splash=silent" >> $icfg
52 # echo "label $x-nofb" >> $icfg
53 # echo " kernel $x" >> $icfg
54 # echo " append initrd=$x.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot" >> $icfg
56 # echo " ${x}-nofb" >> $kmsg
62 # The specs indicate the kernels to be build. We need to put
63 # those kernels and the corresponding initrd.img.gz(s) in the
64 # /boot directory. This directory contains a message boot.msg
65 # containing some info to be displayed on boot, a configuration
66 # (yaboot.conf) specifying the boot options (kernel/initrd
67 # combinations). The boot directory also contains a file called
68 # yaboot, which normally gets copied from the live environment.
69 # For now we supply a prebuilt file, prebuilt configuration
70 # and prebuilt boot message. This can be enhanced later on
71 # but the following suffices for now:
74 scfg=$1/boot/silo.conf
75 echo "default=\"help\"" > ${scfg}
76 echo "message=\"/boot/boot.msg\"" >> ${scfg}
78 for x in ${clst_boot_kernel}
81 echo "image=\"/boot/${x}\"" >> ${scfg}
82 echo -e "\tlabel=\"${x}\"" >> ${scfg}
83 echo -e "\tappend=\"initrd=/boot/${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} cdroot\"" >> ${scfg}
87 echo "image=\"cat /boot/silo.conf\"" >> ${scfg}
88 echo -e "label=\"config\"" >> ${scfg}
89 echo "image=\"cat /boot/video.msg\"" >> ${scfg}
90 echo -e "label=\"video\"" >> ${scfg}
91 echo "image=\"cat /boot/help.msg\"" >> ${scfg}
92 echo -e "label=\"help\"" >> ${scfg}
95 iacfg=$1/boot/elilo.conf
96 echo 'prompt' > ${iacfg}
97 echo 'message=/efi/boot/elilo.msg' >> ${iacfg}
98 echo 'chooser=simple' >> ${iacfg}
99 echo 'timeout=50' >> ${iacfg}
101 for x in ${clst_boot_kernel}
103 echo "image=/efi/boot/${x}" >> ${iacfg}
104 echo " label=${x}" >> ${iacfg}
105 echo ' append="'${default_append_line}'"' >> ${iacfg}
106 echo " initrd=/efi/boot/${x}.igz" >> ${iacfg}
108 echo "image=/efi/boot/${x}" >> ${iacfg}
109 echo " label=${x}-serial">> ${iacfg}
110 echo ' append="'${default_append_line}' console=tty0 console=ttyS0,9600"' >> ${iacfg}
111 echo " initrd=/efi/boot/${x}.igz" >> ${iacfg}
114 cp ${iacfg} $1/boot/efi/boot
115 mv $1/boot/${x}{,.igz} $1/boot/efi/boot
118 if [ -e $1/boot/isolinux.bin ]
120 # the rest of this function sets up the config file for isolinux
121 icfg=$1/boot/isolinux.cfg
122 kmsg=$1/boot/kernels.msg
123 hmsg=$1/boot/help.msg
124 echo "default ${first}" > ${icfg}
125 echo "timeout 150" >> ${icfg}
126 echo "prompt 1" >> ${icfg}
127 echo "display boot.msg" >> ${icfg}
128 echo "F1 kernels.msg" >> ${icfg}
129 echo "F2 help.msg" >> ${icfg}
131 echo "Available kernels:" > ${kmsg}
132 cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg}
134 case ${clst_livecd_type} in
140 for x in ${clst_boot_kernel}
143 eval custom_kopts=\$${x}_kernelopts
144 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
146 echo "label ${x}" >> ${icfg}
147 echo " kernel ${x}" >> ${icfg}
148 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
150 echo " append ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet ${keymap}" >> ${icfg}
152 echo " append ${default_append_line} vga=791 splash=silent ${keymap}" >> ${icfg}
156 echo " ${x}" >> ${kmsg}
157 echo "label ${x}-nofb" >> ${icfg}
158 echo " kernel ${x}" >> ${icfg}
159 echo " append ${default_append_line} ${keymap}" >> ${icfg}
161 echo " ${x}-nofb" >> ${kmsg}
164 if [ -f $1/boot/memtest86 ]
167 echo " memtest86" >> $kmsg
168 echo "label memtest86" >> $icfg
169 echo " kernel memtest86" >> $icfg
173 if [ -e $1/boot/grub/stage2_eltorito ]
175 icfg=$1/boot/grub/grub.conf
176 echo "default 1" > ${icfg}
177 echo "timeout 150" >> ${icfg}
181 hmsg=${clst_sharedir}/livecd/files/x86-help.msg
182 hmsg_txt="$(cat ${hmsg})"
185 echo "title help" >> ${icfg}
186 echo "pause ${hmsg_txt}" >> ${icfg}
189 for x in ${clst_boot_kernel}
191 eval custom_kopts=\$${x}_kernelopts
192 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
194 echo "title ${x}" >> ${icfg}
196 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
198 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
200 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
203 if [ -e $1/boot/${x}.igz ]
205 echo "initrd /boot/${x}.igz" >> ${icfg}
209 echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
210 echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
211 if [ -e $1/boot/${x}.igz ]
213 echo "initrd /boot/${x}.igz" >> ${icfg}
217 if [ -f $1/boot/memtest86 ]
220 echo "title memtest86" >> ${icfg}
221 echo "kernel /boot/memtest86" >> ${icfg}