Changeset 3746 in MondoRescue for branches/3.3/mindi/mindi


Ignore:
Timestamp:
Nov 19, 2019, 1:25:56 PM (4 years ago)
Author:
Bruno Cornec
Message:

Reinstall mbr.bin (or pgtmbr.bin) from syslinux before calling boot loader restoration to avoid having nothing if we boot from a partition
(tested with SLES 12)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi/mindi

    r3744 r3746  
    134134if [ -d "/sys/firmware/efi" ]; then
    135135    BOOT_TYPE="UEFI"
    136 else
    137     # Find MBR in case of bootable USB device to build
    138     MBRFILE=/usr/lib/syslinux/mbr.bin
    139     [ ! -r "$MBRFILE" ] && MBRFILE=/usr/lib64/syslinux/mbr.bin
    140     [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/syslinux/mbr.bin
    141     [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib/syslinux/mbr.bin
    142     [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib64/syslinux/mbr.bin
    143 fi
     136fi
     137
     138# Find MBR file in case of bootable USB device to build and for restoring it
     139MBRFILE=/usr/lib/syslinux/mbr.bin
     140[ ! -r "$MBRFILE" ] && MBRFILE=/usr/lib64/syslinux/mbr.bin
     141[ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/syslinux/mbr.bin
     142[ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib/syslinux/mbr.bin
     143[ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib64/syslinux/mbr.bin
     144
     145# Find GPTMBR in case of bootable USB device to build and for restoring it
     146GPTMBRFILE=/usr/lib/syslinux/gptmbr.bin
     147[ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/lib64/syslinux/gptmbr.bin
     148[ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/share/syslinux/gptmbr.bin
     149[ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/share/lib/syslinux/gptmbr.bin
     150[ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/share/lib64/syslinux/gptmbr.bin
    144151
    145152# Function to log on screen only
     
    24392446            cp -pRdf $MINDI_TMP/$q $bigdir/tmp 2>> $LOGFILE
    24402447        done
     2448        for q in $MBRFILE $GPTMBRFILE; do
     2449            if [ -r $q ]; then
     2450                cp -a $q $bigdir/tmp 2>> $LOGFILE
     2451            else
     2452                LogFile "Unable to copy $q to bigdir. May be unable to restore MBR"
     2453            fi
     2454        done
    24412455    fi
    24422456
     
    33703384$FDISK -l >> $LOGFILE
    33713385LogFile "----------------"
     3386LogFile "MBRFILE = $MBRFILE"
     3387LogFile "GPTMBRFILE = $GPTMBRFILE"
    33723388
    33733389# Compute libata version
Note: See TracChangeset for help on using the changeset viewer.