From: Chris Gianelloni Date: Thu, 26 Jan 2006 21:53:55 +0000 (+0000) Subject: Added initial support for EFI booting on x86. This is completely untested, so use... X-Git-Tag: CATALYST_2_0_6_916~448 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eef893880d0465ec69382cd6318a77e90579f918;p=catalyst.git 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. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1046 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 26fffb92..4c5721ff 100644 --- 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 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 targets/support/functions.sh: kmerge should have been kerncache diff --git a/catalyst b/catalyst index d82715b2..096652af 100755 --- 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 @@ -11,7 +11,7 @@ import os,sys,imp,string,getopt import pdb __maintainer__="Chris Gianelloni " -__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 index 00000000..7f853601 Binary files /dev/null and b/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2 differ diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh index 45bac061..b58c1126 100755 --- a/targets/support/bootloader-setup.sh +++ b/targets/support/bootloader-setup.sh @@ -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 diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh index c6259478..aff75f68 100755 --- a/targets/support/create-iso.sh +++ b/targets/support/create-iso.sh @@ -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 $?