Added initial support for EFI booting on x86. This is completely untested, so use...
authorChris Gianelloni <wolf31o2@gentoo.org>
Thu, 26 Jan 2006 21:53:55 +0000 (21:53 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Thu, 26 Jan 2006 21:53:55 +0000 (21:53 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1046 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
catalyst
livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2 [new file with mode: 0644]
targets/support/bootloader-setup.sh
targets/support/create-iso.sh

index 26fffb927d0324407ad271f22c16dfb3abecea97..4c5721ff63f90728a4a05224b30d1b5a4391804b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.531 2006/01/26 20:57:59 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.532 2006/01/26 21:53:54 wolf31o2 Exp $
+
+  26 Jan 2006; Chris Gianelloni <wolf31o2@gentoo.org> catalyst,
+  +livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2,
+  targets/support/bootloader-setup.sh, targets/support/create-iso.sh:
+  Added initial support for EFI booting on x86. This is completely untested,
+  so use it at your own risk. Also, no bug reports without patches, please.
+  This is catalyst 2.0_rc23.
 
   26 Jan 2006; Eric Edgar <rocket@gentoo.org> targets/support/functions.sh:
   kmerge should have been kerncache
index d82715b2f379c1a643e12ad98cc4b4cb3fada0fc..096652af0bff1f017733a901490040f620e2c134 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -1,7 +1,7 @@
 #!/usr/bin/python -OO
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.130 2006/01/26 15:36:46 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.131 2006/01/26 21:53:54 wolf31o2 Exp $
 
 # Maintained in full by:
 # Eric Edgar <rocket@gentoo.org>
@@ -11,7 +11,7 @@ import os,sys,imp,string,getopt
 import pdb
 
 __maintainer__="Chris Gianelloni <wolf31o2@gentoo.org>"
-__version__="2.0_rc22"
+__version__="2.0_rc23"
 
 conf_values={}
 
diff --git a/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2 b/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2
new file mode 100644 (file)
index 0000000..7f85360
Binary files /dev/null and b/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2 differ
index 45bac061d1c8fc048d259ce858a8cbee70fced0d..b58c1126f8c89dc7a196e2a1f190e3f326afbeec 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.25 2006/01/25 16:07:35 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.26 2006/01/26 21:53:55 wolf31o2 Exp $
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
 
@@ -136,9 +136,9 @@ case ${clst_mainarch} in
                        echo '  append="'initrd=${x}.igz ${default_append_line}' console=tty0 console=ttyS0,9600"' >> ${iacfg}
                        echo "  initrd=/efi/boot/${x}.igz" >> ${iacfg}
                        echo >> ${iacfg}
+                       mv $1/boot/${x}{,.igz} $1/boot/efi/boot
                done
                cp ${iacfg} $1/boot/efi/boot
-               mv $1/boot/${x}{,.igz} $1/boot/efi/boot
                ;;
        x86|amd64)
                if [ -e $1/isolinux/isolinux.bin ]
@@ -225,6 +225,29 @@ case ${clst_mainarch} in
                        fi
                fi
 
+               if [ -e $1/boot/efi/elilo.efi ]
+               then
+                       iacfg=$1/boot/elilo.conf
+                       echo 'prompt' > ${iacfg}
+                       echo 'message=/efi/boot/elilo.msg' >> ${iacfg}
+                       echo 'chooser=simple' >> ${iacfg}
+                       echo 'timeout=50' >> ${iacfg}
+                       echo >> ${iacfg}
+                       for x in ${clst_boot_kernel}
+                       do
+                               echo "image=/efi/boot/${x}" >> ${iacfg}
+                               echo "  label=${x}" >> ${iacfg}
+                               echo '  append="'initrd=${x}.igz ${default_append_line}'"' >> ${iacfg}
+                               echo "  initrd=/efi/boot/${x}.igz" >> ${iacfg}
+                               echo >> ${iacfg}
+                               echo "image=/efi/boot/${x}" >> ${iacfg}
+                               echo >> ${iacfg}
+                               cp -f $1/boot/${x}{,.igz} $1/boot/efi/boot > /dev/null
+                               cp -f $1/isolinux/${x}{,.igz} $1/boot/efi/boot > /dev/null
+                       done
+                       cp ${iacfg} $1/boot/efi/boot
+               fi
+
                if [ -e $1/boot/grub/stage2_eltorito ]
                then
                        icfg=$1/boot/grub/grub.conf
index c6259478c9e3da79cd0eb2fef116d5d68d71af0f..aff75f684aadd8749642a4b83962fd8837e1492f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.21 2006/01/16 15:25:08 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.22 2006/01/26 21:53:55 wolf31o2 Exp $
 
 . ${clst_sharedir}/targets/support/functions.sh
 . ${clst_sharedir}/targets/support/filesystem-functions.sh
@@ -119,6 +119,79 @@ case ${clst_mainarch} in
                esac
                palo -f boot/palo.conf -C ${1}
        ;;
+       ia64)
+               if [ ! -e ${clst_target_path}/gentoo.efimg ]
+               then
+                       iaSizeTemp=$(du -sk ${clst_target_path}/boot 2>/dev/null)
+                       iaSizeB=$(echo ${iaSizeTemp} | cut '-d ' -f1)
+                       iaSize=$((${iaSizeB}+32)) # Add slack
+
+                       dd if=/dev/zero of=${clst_target_path}/gentoo.efimg bs=1k \
+                               count=${iaSize}
+                       mkdosfs -F 16 -n GENTOO ${clst_target_path}/gentoo.efimg
+
+                       mkdir ${clst_target_path}/gentoo.efimg.mountPoint
+                       mount -t vfat -o loop ${clst_target_path}/gentoo.efimg \
+                               ${clst_target_path}/gentoo.efimg.mountPoint
+
+                       echo '>> Populating EFI image...'
+                       cp -pPRv ${clst_target_path}/boot/* \
+                               ${clst_target_path}/gentoo.efimg.mountPoint
+
+                       umount ${clst_target_path}/gentoo.efimg.mountPoint
+                       rmdir ${clst_target_path}/gentoo.efimg.mountPoint
+               else
+                       echo ">> Found populated EFI image at \
+                               ${clst_target_path}/gentoo.efimg"
+               fi
+               echo '>> Removing /boot...'
+               rm -rf ${clst_target_path}/boot
+
+               echo '>> Generating ISO...'
+               echo "mkisofs -J -R -l -V \"${clst_iso_volume_id}\" -o ${1} -b \
+                       gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path}" 
+               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b gentoo.efimg -c \
+                       boot.cat -no-emul-boot \
+                       ${clst_target_path} || die "Cannot make ISO image" 
+       ;;
+       mips)
+               case ${clst_fstype} in
+                       normal)
+                               # Gather up all our bits, and generate a tmp config file
+                               # for sgibootcd
+                               mkdir ${clst_target_path}/loopback ${clst_target_path}/sgibootcd
+                               mv ${clst_target_path}/image.loop ${clst_target_path}/loopback
+                               rm -f ${clst_target_path}/livecd
+                               img="${clst_target_path}/loopback/image.loop"
+                               knl="${clst_target_path}/kernels"
+                               arc="${clst_target_path}/arcload"
+                               cfg="${clst_target_path}/sgibootcd/sgibootcd.cfg"
+                               touch ${cfg}
+
+                               # Add the kernels first
+                               for x in ${clst_boot_kernel}; do
+                                       echo -e "f=${knl}/${x}@${x}" >> ${cfg}
+                               done
+
+                               # Next, the bootloaders
+                               echo -e "f=${arc}/sash64@sash64" >> ${cfg}
+                               echo -e "f=${arc}/sashARCS@sashARCS" >> ${cfg}
+                               echo -e "f=${arc}/arc.cf@arc.cf" >> ${cfg}
+
+                               # Next, the Loopback Image
+                               echo -e "p0=${img}" >> ${cfg}
+
+                               # Finally, the required SGI Partitions
+                               echo -e "p8=#dvh" >> ${cfg}
+                               echo -e "p10=#volume" >> ${cfg}
+
+                               # All done; feed the config to sgibootcd and end up with an
+                               # image
+                               /usr/bin/sgibootcd c=${cfg} o=${clst_iso}
+                       ;;
+                       *) die "SGI LiveCDs only support the 'normal' fstype!"  ;;
+               esac
+       ;;
        ppc*)
                case ${clst_livecd_cdfstype} in
                        zisofs)
@@ -180,76 +253,113 @@ case ${clst_mainarch} in
 
                rm /tmp/mkisofs.sparc.fu
        ;;
-       ia64)
-               if [ ! -e ${clst_target_path}/gentoo.efimg ]
+       x86|amd64)
+               if [ -e ${clst_target_path}/boot/elilo.efi ]
                then
-                       iaSizeTemp=$(du -sk ${clst_target_path}/boot 2>/dev/null)
-                       iaSizeB=$(echo ${iaSizeTemp} | cut '-d ' -f1)
-                       iaSize=$((${iaSizeB}+32)) # Add slack
+                       if [ ! -e ${clst_target_path}/gentoo.efimg ]
+                       then
+                               iaSizeTemp=$(du -sk ${clst_target_path}/boot 2>/dev/null)
+                               iaSizeB=$(echo ${iaSizeTemp} | cut '-d ' -f1)
+                               iaSize=$((${iaSizeB}+32)) # Add slack
 
-                       dd if=/dev/zero of=${clst_target_path}/gentoo.efimg bs=1k \
-                               count=${iaSize}
-                       mkdosfs -F 16 -n GENTOO ${clst_target_path}/gentoo.efimg
+                               dd if=/dev/zero of=${clst_target_path}/gentoo.efimg bs=1k \
+                                       count=${iaSize}
+                               mkdosfs -F 16 -n GENTOO ${clst_target_path}/gentoo.efimg
 
-                       mkdir ${clst_target_path}/gentoo.efimg.mountPoint
-                       mount -t vfat -o loop ${clst_target_path}/gentoo.efimg \
-                               ${clst_target_path}/gentoo.efimg.mountPoint
+                               mkdir ${clst_target_path}/gentoo.efimg.mountPoint
+                               mount -t vfat -o loop ${clst_target_path}/gentoo.efimg \
+                                       ${clst_target_path}/gentoo.efimg.mountPoint
 
-                       echo '>> Populating EFI image...'
-                       cp -pPRv ${clst_target_path}/boot/* \
-                               ${clst_target_path}/gentoo.efimg.mountPoint
+                               echo '>> Populating EFI image...'
+                               cp -pPRv ${clst_target_path}/boot/* \
+                                       ${clst_target_path}/gentoo.efimg.mountPoint
 
-                       umount ${clst_target_path}/gentoo.efimg.mountPoint
-                       rmdir ${clst_target_path}/gentoo.efimg.mountPoint
-               else
-                       echo ">> Found populated EFI image at \
-                               ${clst_target_path}/gentoo.efimg"
+                               umount ${clst_target_path}/gentoo.efimg.mountPoint
+                               rmdir ${clst_target_path}/gentoo.efimg.mountPoint
+                       else
+                               echo ">> Found populated EFI image at \
+                                       ${clst_target_path}/gentoo.efimg"
+                       fi
+                       echo '>> Removing /boot...'
+                       rm -rf ${clst_target_path}/boot
                fi
-               echo '>> Removing /boot...'
-               rm -rf ${clst_target_path}/boot
 
-               echo '>> Generating ISO...'
-               echo "mkisofs -J -R -l -V \"${clst_iso_volume_id}\" -o ${1} -b \
-                       gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path}" 
-               mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b gentoo.efimg -c \
-                       boot.cat -no-emul-boot \
-                       ${clst_target_path} || die "Cannot make ISO image" 
-       ;;      
-       x86|amd64)
                if [ -e ${clst_target_path}/isolinux/isolinux.bin ]
                then
-                       echo "Creating ISO using ISOLINUX bootloader"
                        if [ -d ${clst_target_path}/boot ]
                        then
                                if [ -n "$(ls ${clst_target_path}/boot)" ]
                                then
                                        mv ${clst_target_path}/boot/* ${clst_target_path}/isolinux
+                                       rm -r ${clst_target_path}/boot
+                                       echo "Creating ISO using ISOLINUX bootloader"
+                                       case ${clst_fstype} in
+                                               zisofs)
+                                                       echo "mkisofs -J -R -l -V \
+                                                               \"${clst_iso_volume_id}\" -o ${1} -b \
+                                                               isolinux/isolinux.bin -c isolinux/boot.cat \
+                                                               -no-emul-boot -boot-load-size 4 \
+                                                               -boot-info-table -z ${clst_target_path}"
+                                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o \
+                                                               ${1} -b isolinux/isolinux.bin -c \
+                                                               isolinux/boot.cat -no-emul-boot \
+                                                               -boot-load-size 4 -boot-info-table -z \
+                                                               ${clst_target_path} \
+                                                               || die "Cannot make ISO image"
+                                               ;;
+                                               *)
+                                                       echo "mkisofs -J -R -l -V \
+                                                               \"${clst_iso_volume_id}\" -o ${1} -b \
+                                                               isolinux/isolinux.bin -c isolinux/boot.cat \
+                                                               -no-emul-boot -boot-load-size 4 \
+                                                               -boot-info-table ${clst_target_path}"
+                                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o \
+                                                               ${1} -b isolinux/isolinux.bin -c \
+                                                               isolinux/boot.cat -no-emul-boot \
+                                                               -boot-load-size 4 -boot-info-table \
+                                                               ${clst_target_path} \
+                                                               || die "Cannot make ISO image"
+                                               ;;
+                                       esac
+                               elif [ -e ${clst_target_path}/gentoo.efimg ]
+                               then
+                                       echo "Creating ISO using both ISOLINUX and EFI bootloader"
+                                       case ${clst_fstype} in
+                                               zisofs)
+                                                       echo "mkisofs -J -R -l -V \
+                                                               \"${clst_iso_volume_id}\" -o ${1} -b \
+                                                               isolinux/isolinux.bin -c isolinux/boot.cat \
+                                                               -no-emul-boot -boot-load-size 4 \
+                                                               -boot-info-table -eltorito-alt-boot -b \
+                                                               gentoo.efimg -c boot.cat \
+                                                               -no-emul-boot -z ${clst_target_path}"
+                                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o \
+                                                               ${1} -b isolinux/isolinux.bin -c \
+                                                               isolinux/boot.cat -no-emul-boot \
+                                                               -boot-load-size 4 -boot-info-table \
+                                                               -eltorito-alt-boot -b gentoo.efimg -c \
+                                                               boot.cat -no-emul-boot -z ${clst_target_path} \
+                                                               || die "Cannot make ISO image"
+                                               ;;
+                                               *)
+                                                       echo "mkisofs -J -R -l -V \
+                                                               \"${clst_iso_volume_id}\" -o ${1} -b \
+                                                               isolinux/isolinux.bin -c isolinux/boot.cat \
+                                                               -no-emul-boot -boot-load-size 4 \
+                                                               -boot-info-table -eltorito-alt-boot -b \
+                                                               gentoo.efimg -c boot.cat \
+                                                               -no-emul-boot ${clst_target_path}"
+                                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o \
+                                                               ${1} -b isolinux/isolinux.bin -c \
+                                                               isolinux/boot.cat -no-emul-boot \
+                                                               -boot-load-size 4 -boot-info-table \
+                                                               -eltorito-alt-boot -b gentoo.efimg -c boot.cat \
+                                                               -no-emul-boot ${clst_target_path} \
+                                                               || die "Cannot make ISO image"
+                                               ;;
+                                       esac
                                fi
-                               rm -r ${clst_target_path}/boot
                        fi
-
-                       case ${clst_fstype} in
-                               zisofs)
-                                       echo "mkisofs -J -R -l -V \"${clst_iso_volume_id}\" -o \
-                                               ${1} -b isolinux/isolinux.bin -c isolinux/boot.cat \
-                                               -no-emul-boot -boot-load-size 4 -boot-info-table -z \
-                                               ${clst_target_path}"
-                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b \
-                                               isolinux/isolinux.bin -c isolinux/boot.cat \
-                                               -no-emul-boot -boot-load-size 4 -boot-info-table -z \
-                                               ${clst_target_path} || die "Cannot make ISO image"
-                               ;;
-                               *)
-                                       echo "mkisofs -J -R -l -V \"${clst_iso_volume_id}\" -o \
-                                               ${1} -b isolinux/isolinux.bin -c isolinux/boot.cat \
-                                               -no-emul-boot -boot-load-size 4 -boot-info-table \
-                                               ${clst_target_path}"
-                                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b \
-                                       isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
-                                       -boot-load-size 4 -boot-info-table ${clst_target_path} \
-                                       || die "Cannot make ISO image"
-                               ;;
-                       esac
                elif [ -e ${clst_target_path}/boot/grub/stage2_eltorito ]
                then
                        echo "Creating ISO using GRUB bootloader"
@@ -275,6 +385,14 @@ case ${clst_mainarch} in
                                                ${clst_target_path} || die "Cannot make ISO image"
                                ;;
                        esac
+               elif [ -e ${clst_target_path}/gentoo.efimg ]
+               then
+                       echo 'Creating ISO using EFI bootloader'
+                       echo "mkisofs -J -R -l -V \"${clst_iso_volume_id}\" -o ${1} -b \
+                               gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path}" 
+                       mkisofs -J -R -l -V "${clst_iso_volume_id}" -o ${1} -b \
+                               gentoo.efimg -c boot.cat -no-emul-boot ${clst_target_path} \
+                               || die "Cannot make ISO image" 
                else    
                        case ${clst_fstype} in
                                zisofs)
@@ -292,43 +410,5 @@ case ${clst_mainarch} in
                        esac
                fi
        ;;
-       mips)
-               case ${clst_fstype} in
-                       normal)
-                               # Gather up all our bits, and generate a tmp config file
-                               # for sgibootcd
-                               mkdir ${clst_target_path}/loopback ${clst_target_path}/sgibootcd
-                               mv ${clst_target_path}/image.loop ${clst_target_path}/loopback
-                               rm -f ${clst_target_path}/livecd
-                               img="${clst_target_path}/loopback/image.loop"
-                               knl="${clst_target_path}/kernels"
-                               arc="${clst_target_path}/arcload"
-                               cfg="${clst_target_path}/sgibootcd/sgibootcd.cfg"
-                               touch ${cfg}
-
-                               # Add the kernels first
-                               for x in ${clst_boot_kernel}; do
-                                       echo -e "f=${knl}/${x}@${x}" >> ${cfg}
-                               done
-
-                               # Next, the bootloaders
-                               echo -e "f=${arc}/sash64@sash64" >> ${cfg}
-                               echo -e "f=${arc}/sashARCS@sashARCS" >> ${cfg}
-                               echo -e "f=${arc}/arc.cf@arc.cf" >> ${cfg}
-
-                               # Next, the Loopback Image
-                               echo -e "p0=${img}" >> ${cfg}
-
-                               # Finally, the required SGI Partitions
-                               echo -e "p8=#dvh" >> ${cfg}
-                               echo -e "p10=#volume" >> ${cfg}
-
-                               # All done; feed the config to sgibootcd and end up with an
-                               # image
-                               /usr/bin/sgibootcd c=${cfg} o=${clst_iso}
-                       ;;
-                       *) die "SGI LiveCDs only support the 'normal' fstype!"  ;;
-               esac
-       ;;
 esac
 exit  $?