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.5 2005/06/16 13:40:01 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
15 default_append_line="initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=off ${cmdline_opts} ${custom_kopts} cdroot"
17 case ${clst_mainarch} in
19 acfg=$1/etc/aboot.conf
21 for x in ${clst_boot_kernel}
23 echo -n "${bctr}:/boot/${x} " >> ${acfg}
24 echo -n "initrd=/boot/${x}.igz root=/dev/ram0 " >> ${acfg}
25 echo "init=/linuxrc ${cmdline_opts} cdroot" >> ${acfg}
33 icfg=$1/boot/palo.conf
34 kmsg=$1/boot/kernels.msg
36 echo "--commandline=0/${first} initrd=${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts}" >> ${icfg}
37 echo "--bootloader=boot/iplboot" >> ${icfg}
38 echo "--ramdisk=boot/${x}.igz" >> ${icfg}
40 # for x in $clst_boot_kernel
43 # eval custom_kopts=\$${x}_kernelopts
44 # echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
46 # echo "label $x" >> $icfg
47 # echo " kernel $x" >> $icfg
48 # echo " append initrd=$x.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot vga=0x317 splash=silent" >> $icfg
51 # echo "label $x-nofb" >> $icfg
52 # echo " kernel $x" >> $icfg
53 # echo " append initrd=$x.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot" >> $icfg
55 # echo " ${x}-nofb" >> $kmsg
61 # The specs indicate the kernels to be build. We need to put
62 # those kernels and the corresponding initrd.img.gz(s) in the
63 # /boot directory. This directory contains a message boot.msg
64 # containing some info to be displayed on boot, a configuration
65 # (yaboot.conf) specifying the boot options (kernel/initrd
66 # combinations). The boot directory also contains a file called
67 # yaboot, which normally gets copied from the live environment.
68 # For now we supply a prebuilt file, prebuilt configuration
69 # and prebuilt boot message. This can be enhanced later on
70 # but the following suffices for now:
73 scfg=$1/boot/silo.conf
74 echo "default=\"help\"" > ${scfg}
75 echo "message=\"/boot/boot.msg\"" >> ${scfg}
77 for x in ${clst_boot_kernel}
80 echo "image=\"/boot/${x}\"" >> ${scfg}
81 echo -e "\tlabel=\"${x}\"" >> ${scfg}
82 echo -e "\tappend=\"initrd=/boot/${x}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts} cdroot\"" >> ${scfg}
86 echo "image=\"cat /boot/silo.conf\"" >> ${scfg}
87 echo -e "label=\"config\"" >> ${scfg}
88 echo "image=\"cat /boot/video.msg\"" >> ${scfg}
89 echo -e "label=\"video\"" >> ${scfg}
90 echo "image=\"cat /boot/help.msg\"" >> ${scfg}
91 echo -e "label=\"help\"" >> ${scfg}
94 if [ -e $1/boot/isolinux.bin ]
96 # the rest of this function sets up the config file for isolinux
97 icfg=$1/boot/isolinux.cfg
98 kmsg=$1/boot/kernels.msg
100 echo "default ${first}" > ${icfg}
101 echo "timeout 150" >> ${icfg}
102 echo "prompt 1" >> ${icfg}
103 echo "display boot.msg" >> ${icfg}
104 echo "F1 kernels.msg" >> ${icfg}
105 echo "F2 help.msg" >> ${icfg}
107 echo "Available kernels:" > ${kmsg}
108 cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg}
110 for x in ${clst_boot_kernel}
113 eval custom_kopts=\$${x}_kernelopts
114 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
116 echo "label ${x}" >> ${icfg}
117 echo " kernel ${x}" >> ${icfg}
118 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
120 echo " append ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
122 echo " append ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
126 echo " ${x}" >> ${kmsg}
127 echo "label ${x}-nofb" >> ${icfg}
128 echo " kernel ${x}" >> ${icfg}
129 echo " append ${default_append_line} " >> ${icfg}
131 echo " ${x}-nofb" >> ${kmsg}
134 if [ -f $1/boot/memtest86 ]
137 echo " memtest86" >> $kmsg
138 echo "label memtest86" >> $icfg
139 echo " kernel memtest86" >> $icfg
143 if [ -e $1/boot/grub/stage2_eltorito ]
145 icfg=$1/boot/grub/grub.conf
146 echo "default 1" > ${icfg}
147 echo "timeout 150" >> ${icfg}
151 hmsg=${clst_sharedir}/livecd/files/x86-help.msg
152 hmsg_txt="$(cat ${hmsg})"
155 echo "title help" >> ${icfg}
156 echo "pause ${hmsg_txt}" >> ${icfg}
159 for x in ${clst_boot_kernel}
161 eval custom_kopts=\$${x}_kernelopts
162 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
164 echo "title ${x}" >> ${icfg}
166 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
168 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
170 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
173 if [ -e $1/boot/${x}.igz ]
175 echo "initrd /boot/${x}.igz" >> ${icfg}
179 echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
180 echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
181 if [ -e $1/boot/${x}.igz ]
183 echo "initrd /boot/${x}.igz" >> ${icfg}
187 if [ -f $1/boot/memtest86 ]
190 echo "title memtest86" >> ${icfg}
191 echo "kernel /boot/memtest86" >> ${icfg}