Changeset 3421 in MondoRescue for branches


Ignore:
Timestamp:
Aug 26, 2015, 12:15:40 PM (9 years ago)
Author:
Bruno Cornec
Message:
  • Add fixes for UEFI support (creates a EFI dir or boot dir in the ISO to allow for boot in UEFI with presence of grub legacy info, mindi now detects alone UEFI mode or BIOS mode, mindi now prints the mkisofs cmdline, and only warn on mondorescue.cfg if called from mondo)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3420 r3421  
    113113ISO_OPT="-J -r -v -p Mindi -publisher http://www.mondorescue.org -A Mindi"
    114114
    115 # Mindi should master this in fact
    116 #BOOT_TYPE="BIOS"
     115# Mindi set this as default in case it's invoked alone
     116BOOT_TYPE="BIOS"
     117# and we also check whether we're UEFI or not.
     118if [ -d "/sys/firmware/efi" ]; then
     119    BOOT_TYPE="UEFI"
     120fi
    117121
    118122# Mandriva system e.g. use cdrkit, which uses genisoimage instead of mkisofs.
     
    14891493        cp $ISOLINUX $MINDI_TMP/iso/isolinux.bin 2>> $LOGFILE || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?"
    14901494    fi
     1495
     1496    # copy boot stuff now generated in PrepareDataDiskImage
     1497    if [ $BIOS_TYPE = "UEFI" ]; then
     1498        (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI)
     1499        tbc="EFI"
     1500    else
     1501        (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./boot)
     1502        tbc="boot"
     1503    fi
     1504
    14911505    old_pwd=`pwd`
    14921506    cd "$MINDI_TMP/iso"
    14931507    if [ "$ARCH" != "ia64" ] ; then
    14941508        if [ _"$MONDO_SHARE" != _"" ]; then
    1495             cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt,boot*.txt,pxe.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1509            cp -rf $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt,boot.*,pxe.txt,$tbc} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
    14961510            if [ -e $MINDI_TMP/iso/ldlinux.c32 ]; then
    14971511                cp $MINDI_TMP/iso/ldlinux.c32 $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy ldlinux.c32 (from $MINDI_TMP/iso/$LDLINUXC32) to $MONDO_ROOT. Did you run out of disk space?"
     
    15021516            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
    15031517        fi
    1504         $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log
     1518        CMD="$ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ."
    15051519    else
    1506         $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.img -c images/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log
    1507     fi
     1520        CMD="$ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.img -c images/boot.cat -no-emul-boot ."
     1521    fi
     1522    LogFile "Invoking $CMD"
     1523    $CMD > /dev/null 2> $MINDI_TMP/mkisofs.log
    15081524    if [ "$?" -ne "0" ] ; then
    15091525        LogFile "----------- $ISO_CMD's errors --------------"
     
    18761892    mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)"
    18771893
    1878     # copy boot stuff into it now generated in PrepareDataDisk
    1879     (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz boot)
    1880 
    18811894    LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."
    18821895    cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE
     
    20932106        if [ "$BOOT_TYPE" = "UEFI" ]; then
    20942107            # UEFI
    2095             lilodir=$bootdir/EFI
     2108            lilodir=$bigdir/EFI/BOOT
    20962109            mkdir -p $lilodir
    20972110            liloconf="$lilodir/grub.conf"
    2098             lilobin="grub.efi"
     2111            # grub.efi for rhel6 and grubx64.efi for rhel7
     2112            lilobin="grub*.efi"
    20992113           
    21002114            MakeBootConfFile grub > $liloconf
     
    21202134            mountefi=1
    21212135        fi
    2122         el=`find /boot/efi -iname $lilobin`
     2136        el=`find /boot/efi -iname "$lilobin"`
    21232137        cp $el $lilodir
    21242138        if [ $mountefi -eq 1 ]; then
     
    21292143    fi
    21302144
    2131     if [ "$BOOT_TYPE" = "UEFI"] && [ -f "$lilodir/grub.conf" ]; then
     2145    #if [ "$BOOT_TYPE" = "UEFI" ] && [ -f "$lilodir/grub.conf" ]; then
    21322146        # for grub 0.97 the conf file is not read with the grub.efi file :-(
    21332147        # Not very nice, but needed it seems
    2134         LogFile "Copying grub.conf file as we use legacy grub on UEFI"
    2135         mkdir -p $bootdir/boot/grub
    2136         cp $lilodir/grub.conf $bootdir/boot/grub
    2137     fi
     2148        #LogFile "Copying grub.conf file as we use legacy grub on UEFI"
     2149        #mkdir -p $bootdir/boot/grub
     2150        #cp $lilodir/grub.conf $bootdir/boot/grub
     2151    #fi
    21382152
    21392153    echo -en "Tarring and zipping the data content..."
     
    33543368    LogIt "--------------------------"
    33553369else
    3356     LogIt "ERROR: You don't have a $MRCFG file !"
     3370    if [ _"$MONDO_SHARE" != _"" ] ; then
     3371        LogIt "ERROR: You don't have a $MRCFG file !"
     3372    fi
    33573373fi
    33583374# cleanup
Note: See TracChangeset for help on using the changeset viewer.