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.8 2005/06/30 16:07:46 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 acpi=off ${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 if [ -e $1/boot/isolinux.bin ]
97 # the rest of this function sets up the config file for isolinux
98 icfg=$1/boot/isolinux.cfg
99 kmsg=$1/boot/kernels.msg
100 hmsg=$1/boot/help.msg
101 echo "default ${first}" > ${icfg}
102 echo "timeout 150" >> ${icfg}
103 echo "prompt 1" >> ${icfg}
104 echo "display boot.msg" >> ${icfg}
105 echo "F1 kernels.msg" >> ${icfg}
106 echo "F2 help.msg" >> ${icfg}
108 echo "Available kernels:" > ${kmsg}
109 cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg}
111 case ${clst_livecd_type} in
117 for x in ${clst_boot_kernel}
120 eval custom_kopts=\$${x}_kernelopts
121 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
123 echo "label ${x}" >> ${icfg}
124 echo " kernel ${x}" >> ${icfg}
125 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
127 echo " append ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet ${keymap}" >> ${icfg}
129 echo " append ${default_append_line} vga=791 splash=silent ${keymap}" >> ${icfg}
133 echo " ${x}" >> ${kmsg}
134 echo "label ${x}-nofb" >> ${icfg}
135 echo " kernel ${x}" >> ${icfg}
136 echo " append ${default_append_line} ${keymap}" >> ${icfg}
138 echo " ${x}-nofb" >> ${kmsg}
141 if [ -f $1/boot/memtest86 ]
144 echo " memtest86" >> $kmsg
145 echo "label memtest86" >> $icfg
146 echo " kernel memtest86" >> $icfg
150 if [ -e $1/boot/grub/stage2_eltorito ]
152 icfg=$1/boot/grub/grub.conf
153 echo "default 1" > ${icfg}
154 echo "timeout 150" >> ${icfg}
158 hmsg=${clst_sharedir}/livecd/files/x86-help.msg
159 hmsg_txt="$(cat ${hmsg})"
162 echo "title help" >> ${icfg}
163 echo "pause ${hmsg_txt}" >> ${icfg}
166 for x in ${clst_boot_kernel}
168 eval custom_kopts=\$${x}_kernelopts
169 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
171 echo "title ${x}" >> ${icfg}
173 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
175 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
177 echo "kernel /boot/${x} ${default_append_line} vga=791 dokeymap splash=silent" >> ${icfg}
180 if [ -e $1/boot/${x}.igz ]
182 echo "initrd /boot/${x}.igz" >> ${icfg}
186 echo "title ${x} [ No FrameBuffer ]" >> ${icfg}
187 echo "kernel ${x} /boot/${x} ${default_append_line}" >> ${icfg}
188 if [ -e $1/boot/${x}.igz ]
190 echo "initrd /boot/${x}.igz" >> ${icfg}
194 if [ -f $1/boot/memtest86 ]
197 echo "title memtest86" >> ${icfg}
198 echo "kernel /boot/memtest86" >> ${icfg}