Replace "." with "source".
[catalyst.git] / targets / support / bootloader-setup.sh
old mode 100755 (executable)
new mode 100644 (file)
index 8cd53f7..2832b9f
@@ -1,16 +1,16 @@
 #!/bin/bash
-. ${clst_sharedir}/targets/support/functions.sh
-. ${clst_sharedir}/targets/support/filesystem-functions.sh
+source ${clst_sharedir}/targets/support/functions.sh
+source ${clst_sharedir}/targets/support/filesystem-functions.sh
 
 # $1 is the destination root
 
 extract_cdtar $1
 extract_kernels $1/boot
-check_dev_manager
 check_bootargs
 check_filesystem_type
 
 default_append_line="root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot"
+[ -n "${clst_splash_theme}" ] && default_append_line="${default_append_line} splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet"
 
 case ${clst_hostarch} in
        alpha)
@@ -43,53 +43,18 @@ case ${clst_hostarch} in
                icfg=$1/boot/palo.conf
                kmsg=$1/boot/kernels.msg
                hmsg=$1/boot/help.msg
-               echo "--commandline=0/${first} initrd=${first}.igz root=/dev/ram0 init=/linuxrc ${cmdline_opts}" >> ${icfg}
+               # Make sure we strip the extension to the kernel to allow palo to choose
+               boot_kernel_common_name=${first/%32/}
+               boot_kernel_common_name=${boot_kernel_common_name/%64/}
+               echo "--commandline=0/${boot_kernel_common_name} initrd=${first}.igz root=/dev/ram0 init=/linuxrc cdroot ${cmdline_opts}" >> ${icfg}
                echo "--bootloader=boot/iplboot" >> ${icfg}
                echo "--ramdisk=boot/${first}.igz" >> ${icfg}
-       ;;
-       ppc)
-               # NO SOFTLEVEL SUPPORT YET
-               icfg=$1/boot/yaboot.conf
-               kmsg=$1/boot/boot.msg
-
-               echo "default ${first}" > ${icfg}
-               echo "timeout 300" >> ${icfg}
-               echo "device=cd:" >> ${icfg}
-               echo "root=/dev/ram" >> ${icfg}
-               echo "fgcolor=white" >> ${icfg}
-               echo "bgcolor=black" >> ${icfg}
-               echo "message=/boot/boot.msg" >> ${icfg}
-
-               # Here is where I fix up the boot.msg file.
-               sed -e 's/ARCH/PowerPC/' \
-                       -e 's/HARDWARE/32-bit Apple and Pegasos hardware/' \
-                       -i $kmsg
-
-               # Here we wipe out the /ppc directory, if it exists.
-               rm -rf $1/ppc
-
                for x in ${clst_boot_kernel}
-               do      
-                       eval custom_kopts=\$${x}_kernelopts
-                       echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
-                       echo "image=/boot/${x}" >> ${icfg}
-
-                       if [ -e "$1/boot/${x}.igz" ]
-                       then
-                               echo "initrd=/boot/${x}.igz" >> ${icfg}
-                       fi
-
-                       echo "label=${x}" >> ${icfg}
-                       echo "read-write" >> ${icfg}
-                       if [ -n "${clst_livecd_splash_theme}" ]
-                       then
-                               echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet\"" >> ${icfg}
-                       else
-                               echo "append=\"${default_append_line}\"" >> ${icfg}
-                       fi
+               do
+                       echo "--recoverykernel=boot/${x}" >> ${icfg}
                done
        ;;
-       ppc64)
+       ppc*|powerpc*)
                # NO SOFTLEVEL SUPPORT YET
                icfg=$1/boot/yaboot.conf
                kmsg=$1/boot/boot.msg
@@ -99,27 +64,27 @@ case ${clst_hostarch} in
                echo "fgcolor=white" >> ${icfg}
                echo "bgcolor=black" >> ${icfg}
                echo "message=/boot/boot.msg" >> ${icfg}
-               
+
                # Here is where I fix up the boot.msg file.
                sed -e 's/ARCH/PowerPC/' \
-                       -e 's/HARDWARE/64-bit Apple and IBM hardware/' \
+                       -e 's/HARDWARE/Apple and IBM hardware/' \
                        -i $kmsg
 
-               # Setup the IBM yaboot.conf     
+               # Setup the IBM yaboot.conf
                etc_icfg=$1/etc/yaboot.conf
-               mkdir -p $1/etc 
+               mkdir -p $1/etc
                IBM_YABOOT="FALSE"
                echo "root=/dev/ram" >> ${etc_icfg}
                echo "fgcolor=white" >> ${etc_icfg}
                echo "bgcolor=black" >> ${etc_icfg}
                echo "message=/boot/boot.msg" >> ${etc_icfg}
-               
+
                for x in ${clst_boot_kernel}
-               do      
+               do
                        eval "clst_kernel_console=\$clst_boot_kernel_${x}_console"
                        eval "clst_kernel_machine_type=\$clst_boot_kernel_${x}_machine_type"
                        eval custom_kopts=\$${x}_kernelopts
-                               
+
                        echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
                        if [ "${clst_kernel_machine_type}" == "ibm" ]
                        then
@@ -136,12 +101,7 @@ case ${clst_hostarch} in
 
                                        echo "label=${x}" >> ${etc_icfg}
                                        echo "read-write" >> ${icfg}
-                                       if [ -n "${clst_livecd_splash_theme}" ]
-                                       then
-                                               echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet\"" >> ${etc_icfg}
-                                       else
-                                               echo "append=\"${default_append_line}\"" >> ${etc_icfg}
-                                       fi
+                                       echo "append=\"${default_append_line}\"" >> ${etc_icfg}
 
                                        for y in ${clst_kernel_console}
                                        do
@@ -169,14 +129,11 @@ case ${clst_hostarch} in
 
                                        echo "label=${x}" >> ${etc_icfg}
                                        echo "read-write" >> ${etc_icfg}
-                                       if [ -n "${clst_livecd_splash_theme}" ]
-                                       then
-                                               echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet\"" >> ${etc_icfg}
-                                       else
-                                               echo "append=\"${default_append_line}\"" >> ${etc_icfg}
-                                       fi
+                                       echo "append=\"${default_append_line}\"" >> ${etc_icfg}
                                fi
                        else
+                               # Here we wipe out the /ppc directory, if it exists.
+                               rm -rf $1/ppc
                                if [ -n "${clst_kernel_console}" ]
                                then
                                        echo >> ${icfg}
@@ -189,13 +146,8 @@ case ${clst_hostarch} in
 
                                        echo "label=${x}" >> ${icfg}
                                        echo "read-write" >> ${icfg}
-                                       if [ -n "${clst_livecd_splash_theme}" ]
-                                       then
-                                               echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet\"" >> ${icfg}
-                                       else
-                                               echo "append=\"${default_append_line}\"" >> ${icfg}
-                                       fi
-                                       
+                                       echo "append=\"${default_append_line}\"" >> ${icfg}
+
                                        for y in ${clst_kernel_console}
                                        do
                                                echo >> ${icfg}
@@ -221,18 +173,13 @@ case ${clst_hostarch} in
 
                                        echo "label=${x}" >> ${icfg}
                                        echo "read-write" >> ${icfg}
-                                       if [ -n "${clst_livecd_splash_theme}" ]
-                                       then
-                                               echo "append=\"${default_append_line} splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet\"" >> ${icfg}
-                                       else
-                                               echo "append=\"${default_append_line}\"" >> ${icfg}
-                                       fi
+                                       echo "append=\"${default_append_line}\"" >> ${icfg}
                                fi
                        fi
                done
 
                if [ "${IBM_YABOOT}" == "FALSE" ]
-               then 
+               then
                        rm ${etc_kmsg}
                        rmdir $1/etc
                        if [ -d $1/ppc ]
@@ -288,6 +235,11 @@ case ${clst_hostarch} in
                        echo "  initrd=/efi/boot/${x}.igz" >> ${iacfg}
                        echo >> ${iacfg}
                        echo "image=/efi/boot/${x}" >> ${iacfg}
+                       echo "  label=${x}-ilo">> ${iacfg}
+                       echo '  append="'initrd=${x}.igz ${default_append_line}' console=tty0 console=ttyS3,9600"' >> ${iacfg}
+                       echo "  initrd=/efi/boot/${x}.igz" >> ${iacfg}
+                       echo >> ${iacfg}
+                       echo "image=/efi/boot/${x}" >> ${iacfg}
                        echo "  label=${x}-sgi">> ${iacfg}
                        echo '  append="'initrd=${x}.igz ${default_append_line}' console=tty0 console=ttySG0,115200"' >> ${iacfg}
                        echo "  initrd=/efi/boot/${x}.igz" >> ${iacfg}
@@ -305,6 +257,7 @@ case ${clst_hostarch} in
                        kmsg=$1/isolinux/kernels.msg
                        echo "default ${first}" > ${icfg}
                        echo "timeout 150" >> ${icfg}
+                       echo "ontimeout localhost" >> ${icfg}
                        echo "prompt 1" >> ${icfg}
                        echo "display boot.msg" >> ${icfg}
                        echo "F1 kernels.msg" >> ${icfg}
@@ -327,7 +280,7 @@ case ${clst_hostarch} in
                                eval custom_kopts=\$${x}_kernelopts
                                echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
                                echo >> ${icfg}
-                               
+
                                eval "clst_kernel_softlevel=\$clst_boot_kernel_${x}_softlevel"
 
                                if [ -n "${clst_kernel_softlevel}" ]
@@ -336,12 +289,7 @@ case ${clst_hostarch} in
                                        do
                                                echo "label ${x}-${y}" >> ${icfg}
                                                echo "  kernel ${x}" >> ${icfg}
-                                               if [ -n "${clst_livecd_splash_theme}" ]
-                                               then
-                                                       echo "  append ${default_append_line} softlevel=${y} initrd=${x}.igz vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet" >> ${icfg}
-                                               else
-                                                       echo "  append ${default_append_line} softlevel=${y} initrd=${x}.igz vga=791" >> ${icfg}
-                                               fi
+                                               echo "  append ${default_append_line} softlevel=${y} initrd=${x}.igz vga=791" >> ${icfg}
 
                                                echo >> ${icfg}
                                                echo "   ${x}" >> ${kmsg}
@@ -354,12 +302,7 @@ case ${clst_hostarch} in
                                else
                                        echo "label ${x}" >> ${icfg}
                                        echo "  kernel ${x}" >> ${icfg}
-                                       if [ -n "${clst_livecd_splash_theme}" ]
-                                       then
-                                               echo "  append ${default_append_line} initrd=${x}.igz vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet" >> ${icfg}
-                                       else
-                                               echo "  append ${default_append_line} initrd=${x}.igz vga=791" >> ${icfg}
-                                       fi
+                                       echo "  append ${default_append_line} initrd=${x}.igz vga=791" >> ${icfg}
                                        echo >> ${icfg}
                                        echo "   ${x}" >> ${kmsg}
                                        echo "label ${x}-nofb" >> ${icfg}
@@ -377,6 +320,10 @@ case ${clst_hostarch} in
                                echo "label memtest86" >> $icfg
                                echo "  kernel memtest86" >> $icfg
                        fi
+                       echo >> $icfg
+                       echo "label localhost" >> $icfg
+                       echo "  localboot -1" >> $icfg
+                       echo "  MENU HIDE" >> $icfg
                fi
 
                if [ -e $1/boot/efi/elilo.efi ]
@@ -405,8 +352,8 @@ case ${clst_hostarch} in
 
                if [ -e $1/boot/grub/stage2_eltorito ]
                then
-                       icfg=$1/boot/grub/grub.conf
-#                      echo "default 1" > ${icfg}
+                       icfg=$1/boot/grub/menu.lst
+                       echo "default 0" > ${icfg}
                        echo "timeout 15" >> ${icfg}
                        echo "pager on" >> ${icfg}
 
@@ -428,20 +375,15 @@ case ${clst_hostarch} in
                                eval custom_kopts=\$${x}_kernelopts
                                echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
                                echo >> ${icfg}
-                               
+
                                eval "clst_kernel_softlevel=\$clst_boot_kernel_${x}_softlevel"
-                               
+
                                if [ -n "${clst_kernel_softlevel}" ]
                                then
                                        for y in ${clst_kernel_softlevel}
                                        do
                                                echo "title ${x}-${y}" >> ${icfg}
-                                               if [ -n "${clst_livecd_splash_theme}" ]
-                                               then
-                                                       echo "kernel /boot/${x} softlevel=${y} ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet" >> ${icfg}
-                                               else
-                                                       echo "  append ${default_append_line} softlevel=${y} initrd=${x}.igz vga=791" >> ${icfg}
-                                               fi
+                                               echo "  append ${default_append_line} softlevel=${y} initrd=${x}.igz vga=791" >> ${icfg}
                                                if [ -e $1/boot/${x}.igz ]
                                                then
                                                        echo "initrd /boot/${x}.igz" >> ${icfg}
@@ -457,12 +399,7 @@ case ${clst_hostarch} in
                                        done
                                else
                                        echo "title ${x}" >> ${icfg}
-                                       if [ -n "${clst_livecd_splash_theme}" ]
-                                       then
-                                               echo "kernel /boot/${x} ${default_append_line} vga=791 splash=silent,theme:${clst_livecd_splash_theme} CONSOLE=/dev/tty1 quiet" >> ${icfg}
-                                       else
-                                               echo "kernel /boot/${x} ${default_append_line} vga=791" >> ${icfg}
-                                       fi
+                                       echo "kernel /boot/${x} ${default_append_line} vga=791" >> ${icfg}
                                        if [ -e $1/boot/${x}.igz ]
                                        then
                                                echo "initrd /boot/${x}.igz" >> ${icfg}