Changeset 3528 in MondoRescue


Ignore:
Timestamp:
Mar 4, 2016, 8:53:07 AM (8 years ago)
Author:
Bruno Cornec
Message:

More UEFI fixes for mindi

  • Fix numeric tests which were done wrongly with string
  • Generate also the BIOS boot mode info in UEFI mode to allow the generation of dual mode ISO images
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3527 r3528  
    15041504LogAll "INFO: Copying $kernelpath to $MINDI_TMP/target/vmlinuz"
    15051505cp $kernelpath $MINDI_TMP/target/vmlinuz 2>> $LOGFILE
    1506 if [ "$?" -ne "0" ] ; then
     1506if [ $? -ne 0 ] ; then
    15071507    LogAll "ERROR: Failed to copy $kernelpath $MINDI_TMP/target/"
    15081508    retval=$(($retval+1))
     
    15101510LogAll "INFO: Copying $MINDI_TMP/initrd.img to $MINDI_TMP/target/initrd.img"
    15111511cp $MINDI_TMP/initrd.img $MINDI_TMP/target/ 2>> $LOGFILE
    1512 if [ "$?" -ne "0" ] ; then
     1512if [ $? -ne 0 ] ; then
    15131513    LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $MINDI_TMP/target/"
    15141514    retval=$(($retval+1))
     
    15191519    (cd $MINDI_TMP/target ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI)
    15201520    tbc="EFI"
     1521    # Also prepare a BIOS compatible boot
     1522    if  [ "$target" = "ISO" ]; then
     1523        cp $ISOLINUX $MINDI_TMP/target/$tbc/ 2>> $LOGFILE
     1524    fi
    15211525else
    15221526    (cd $MINDI_TMP/target ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux)
     
    15291533    if  [ "$target" = "ISO" ]; then
    15301534        cp $ISOLINUX $MINDI_TMP/target/$tbc/ 2>> $LOGFILE
    1531         if [ "$?" -ne "0" ] ; then
     1535        if [ $? -ne 0 ] ; then
    15321536            LogAll "ERROR: Failed to copy $ISOLINUX to $MINDI_TMP/target/$tbc"
    15331537            retval=$(($retval+1))
     
    15401544        FindMboot32Binary
    15411545        cp $xenkernelpath $MINDI_TMP/target/xen.gz 2>> $LOGFILE
    1542         if [ "$?" -ne "0" ] ; then
     1546        if [ $? -ne 0 ] ; then
    15431547            LogAll "ERROR: Failed to copy $xenkernelpath to $MINDI_TMP/target/"
    15441548            retval=$(($retval+1))
    15451549        fi
    15461550        cp $MBOOTC32 $MINDI_TMP/target/$tbc/mboot.c32  2>> $LOGFILE
    1547         if [ "$?" -ne "0" ] ; then
     1551        if [ $? -ne 0 ] ; then
    15481552            LogAll "ERROR: Failed to copy $MBOOTC32 to $MINDI_TMP/target/$tbc"
    15491553            retval=$(($retval+1))
     
    15561560if [ _"$MONDO_SHARE" != _"" ]; then
    15571561    cp -rf $MINDI_TMP/target/$tbc $MONDO_ROOT 2>> $LOGFILE
    1558     if [ "$?" -ne "0" ] ; then
     1562    if [ $? -ne 0 ] ; then
    15591563        LogAll "ERROR: Failed to copy $MINDI_TMP/target/$tbc to $MONDO_ROOT"
    15601564        LogAll "       Please check the target directory."
     
    15631567    if [ $KERNEL_IS_XEN = "yes" ]; then
    15641568        cp -f $MINDI_TMP/target/xen.gz $MONDO_ROOT 2>> $LOGFILE
    1565         if [ "$?" -ne "0" ] ; then
     1569        if [ $? -ne 0 ] ; then
    15661570            LogAll "ERROR: Failed to copy $MINDI_TMP/target/xen.gz to $MONDO_ROOT"
    15671571            LogAll "       Please check the target directory."
     
    15711575    cp -f $MONDO_SHARE/autorun $MINDI_TMP/target 2>> $LOGFILE
    15721576    cp -f $MINDI_TMP/target/vmlinuz $MONDO_ROOT 2>> $LOGFILE
    1573     if [ "$?" -ne "0" ] ; then
     1577    if [ $? -ne 0 ] ; then
    15741578        LogAll "ERROR: Failed to copy $MINDI_TMP/vmlinuz to $MONDO_ROOT"
    15751579        LogAll "       Please check the target directory."
     
    15771581    fi
    15781582    cp -f $MINDI_TMP/target/initrd.img $MONDO_ROOT 2>> $LOGFILE
    1579     if [ "$?" -ne "0" ] ; then
     1583    if [ $? -ne 0 ] ; then
    15801584        LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $MONDO_ROOT"
    15811585        LogAll "       Please check the target directory."
     
    17161720LogAll "INFO: Moving boot info on $MINDI_TMP/mpt"
    17171721mv $MINDI_TMP/target/* $MINDI_TMP/mpt
    1718 if [ "$?" -ne "0" ] ; then
     1722if [ $? -ne 0 ] ; then
    17191723    LogFile "--------------------------------"
    17201724    LogFile "INFO: Size of $MINDI_TMP/mpt:"
     
    17361740    LogAll "INFO: Invoking $CMD"
    17371741    (cd "$MINDI_TMP/mpt" ; $CMD .) > /dev/null 2> $MINDI_TMP/mkisofs.log
    1738     if [ "$?" -ne "0" ] ; then
     1742    if [ $? -ne 0 ] ; then
    17391743        if [ "$BOOT_TYPE" = "UEFI" ]; then
    17401744            CMD=`echo $CMD | perl -p -e 's|--efi-boot |-eltorito-platform 0xEF -eltorito-boot |; s|-efi-boot |-eltorito-platform 0xEF -eltorito-boot |;'`
     1745            LogAll "INFO: Invoking instead $CMD"
    17411746            (cd "$MINDI_TMP/mpt" ; $CMD .) > /dev/null 2> $MINDI_TMP/mkisofs.log
    1742             if [ "$?" -eq "0" ] ; then
     1747            if [ $? -eq 0 ] ; then
    17431748                LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso"
    17441749            else
     
    21022107    if [ -e "$MONDO_SHARE/restore-scripts" ]; then
    21032108        cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
    2104         [ "$?" -ne "0" ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     2109        [ $? -ne 0 ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
    21052110    fi
    21062111    if [ -d "/lib/dev-state" ]; then
     
    21172122    if [ $LVM != "false" ]; then
    21182123        $MINDI_LIB/analyze-my-lvm > $bigdir/tmp/i-want-my-lvm
    2119         if [ "$?" -ne "0" ]; then
     2124        if [ $? -ne 0 ]; then
    21202125            LVM="false"
    21212126            rm -f $bigdir/tmp/i-want-my-lvm
     
    21482153    boottype=syslinux
    21492154    mkdir -p $bootdir
     2155    FindLdlinux32Binary
    21502156    if [ "$BOOT_TYPE" != "BIOS" ]; then
    21512157        if [ "$BOOT_TYPE" = "UNKNOWN" ]; then
     
    22122218            fi
    22132219        fi
    2214     else   
     2220        # In all cases prepare syslinux content for BIOS mode
     2221        # so that we can have multi boot mode media BIOS+UEFI
     2222        if [ -e "$LDLINUXC32" ]; then
     2223            LogFile "INFO: Copying $LDLINUXC32 to $bigdir/EFI"
     2224            cp $LDLINUXC32 "$bigdir/EFI" 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $bigtdir/EFI. Did you run out of disk space?"
     2225        fi
     2226    else
    22152227        # Useful for syslinux 5.x
    2216         FindLdlinux32Binary
    22172228        if [ -e "$LDLINUXC32" ]; then
    22182229            LogFile "INFO: Copying $LDLINUXC32 to $bootdir"
     
    22272238
    22282239    MakeBootConfFile $boottype > $bootconf
     2240    if [ "$BOOT_TYPE" = "UEFI" ]; then
     2241        # Also generate the syslinux conf
     2242        MakeBootConfFile syslinux > "$bigdir/EFI/syslinux.cfg"
     2243    fi
    22292244
    22302245    echo -en "INFO: Tarring and zipping the data content..."
     
    23112326    cp -f $1 $tmpfile 2>> $LOGFILE
    23122327    strip $tmpfile 2> /dev/null
    2313     if [ "$?" -eq "0" ] ; then
     2328    if [ $? -eq 0 ] ; then
    23142329        cp -f $tmpfile $1 2>> $LOGFILE
    23152330        LogFile "INFO: Stripped binary $2"
     
    23232338        fname=$1
    23242339        file $fname | grep -q gzip
    2325         if [ "$?" -eq "0" ] ; then
     2340        if [ $? -eq 0 ] ; then
    23262341            # Used by ia64
    2327             fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    2328         else
    2329             fkern_ver=`strings $fname 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
     2342            fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
     2343        else
     2344            fkern_ver=`strings $fname 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23302345        fi
    23312346        echo "$fkern_ver"
     
    23662381        kdate=`uname -v | $AWK '{for(i=1;i<NF;i++){if(index($i,":")){print $i;};};}' | $AWK '{print $NF;}'`
    23672382        file $fname | grep -q gzip
    2368         if [ "$?" -eq "0" ] ; then
     2383        if [ $? -eq 0 ] ; then
    23692384            # Used by ia64
    23702385            if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then
Note: See TracChangeset for help on using the changeset viewer.