Changeset 3419 in MondoRescue


Ignore:
Timestamp:
Aug 21, 2015, 1:42:54 PM (9 years ago)
Author:
Bruno Cornec
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3417 r3419  
    15531553    LogFile "INFO: Unmounting $USBPART just in case"
    15541554    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    1555     if [ $BOOT_TYPE = "BIOS" ]; then
     1555    if [ "$BOOT_TYPE" = "BIOS" ]; then
    15561556        # If your key has no MBR it may cause an issue
    15571557        # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE
     
    18651865    LogFile "INFO: Creating vfat filesystem on $imagefile"
    18661866    mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
    1867     if [ $BOOT_TYPE = "BIOS" ]; then
     1867    if [ "$BOOT_TYPE" = "BIOS" ]; then
    18681868        # syslinux should be run on a  local file (doen't work through NFS Cf: #297)
    18691869        syslinux $imagefile >> $LOGFILE 2>> $LOGFILE
     
    18761876    mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)"
    18771877
    1878     # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it
    1879     if [ $BOOT_TYPE != "BIOS" ]; then
    1880         if [ $BOOT_TYPE = "UNKNOWN" ]; then
    1881             LogAll "ERROR: UNKNOWN BOOT_TYPE. Please report upstream"
    1882             MindiExit -1
    1883         fi
    1884         # EFI or UEFI
    1885         # BCO names are hard-coded for now
    1886         if [ $BOOT_TYPE = "UEFI" ]; then
    1887             # UEFI
    1888             lilodir=$mountpoint/EFI
    1889             mkdir -p $lilodir
    1890             liloconf="$lilodir/grub.conf"
    1891             lilobin="grub.efi"
    1892            
    1893             MakeBootConfFile grub > $liloconf
    1894         else
    1895             # EFI
    1896             lilodir=$mountpoint
    1897             mkdir -p $lilodir
    1898             liloconf="$mountpoint/elilo.conf"
    1899             lilobin="elilo.efi"
    1900 
    1901             MakeBootConfFile elilo > $liloconf
    1902         fi
    1903 
    1904         # Copy it so that CD-ROM menu entry is satisfied
    1905         mountefi=0
    1906         df -T | grep /boot/efi | grep -qE 'vfat'
    1907         if [ $? -ne 0 ]; then
    1908             mount /boot/efi
    1909             if [ $? -ne 0 ]; then
    1910                 echo "You have to mount your (U)EFI partition when using mindi"
    1911                 MindiExit -1
    1912             fi
    1913             mountefi=1
    1914         fi
    1915         el=`find /boot/efi -iname $lilobin`
    1916         cp $el $lilodir
    1917         if [ $mountefi -eq 1 ]; then
    1918             umount /boot/efi 2>&1 > /dev/null
    1919         fi
    1920     else
    1921         MakeBootConfFile isolinux > $mountpoint/syslinux.cfg
    1922     fi
     1878    # copy boot stuff into it now generated in PrepareDataDisk
     1879    (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz boot)
     1880
    19231881    LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."
    19241882    cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE
    1925     if [ $BOOT_TYPE = "UEFI" ]; then
    1926             # for grub 0.97 the conf file is not read with the grub.efi file :-(
    1927             cp $liloconf $MINDI_TMP
    1928     fi
    19291883    if [ "$?" -ne "0" ] ; then
    19301884        LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
     
    20732027    fi
    20742028
    2075     if [ $BOOT_TYPE = "UEFI" ]; then
    2076             # for grub 0.97 the conf file is not read with the grub.efi file :-(
    2077             # Not very nice, but needed
    2078             if [ -f $MINDI_TMP/grub.conf ]; then
    2079                 mkdir -p $bigdir/boot/grub
    2080                 cp $MINDI_TMP/grub.conf $bigdir/boot/grub
    2081             fi
    2082     fi
    2083 
    20842029    old_pwd=`pwd`
    20852030    cd "$bigdir"
     
    21322077            cp -pRdf $MINDI_TMP/$q $bigdir/tmp 2>> $LOGFILE
    21332078        done
     2079    fi
     2080
     2081    # copy (e)lilo/syslinux/grub/whatever stuff into it as well
     2082    # to get it on the media (in addition to the boot part
     2083    # and also to support UEFI boot mechanism
     2084    bootdir=$bigdir/boot
     2085    mkdir -p $bootdir
     2086    if [ "$BOOT_TYPE" != "BIOS" ]; then
     2087        if [ "$BOOT_TYPE" = "UNKNOWN" ]; then
     2088            LogAll "ERROR: UNKNOWN BOOT_TYPE. Please report upstream"
     2089            MindiExit -1
     2090        fi
     2091        # EFI or UEFI
     2092        # BCO names are hard-coded for now
     2093        if [ "$BOOT_TYPE" = "UEFI" ]; then
     2094            # UEFI
     2095            lilodir=$bootdir/EFI
     2096            mkdir -p $lilodir
     2097            liloconf="$lilodir/grub.conf"
     2098            lilobin="grub.efi"
     2099           
     2100            MakeBootConfFile grub > $liloconf
     2101        else
     2102            # EFI
     2103            lilodir=$bootdir
     2104            mkdir -p $lilodir
     2105            liloconf="$lilodir/elilo.conf"
     2106            lilobin="elilo.efi"
     2107
     2108            MakeBootConfFile elilo > $liloconf
     2109        fi
     2110
     2111        # Copy it so that CD-ROM menu entry is satisfied
     2112        mountefi=0
     2113        df -T | grep /boot/efi | grep -qE 'vfat'
     2114        if [ $? -ne 0 ]; then
     2115            mount /boot/efi
     2116            if [ $? -ne 0 ]; then
     2117                echo "You have to mount your (U)EFI partition when using mindi"
     2118                MindiExit -1
     2119            fi
     2120            mountefi=1
     2121        fi
     2122        el=`find /boot/efi -iname $lilobin`
     2123        cp $el $lilodir
     2124        if [ $mountefi -eq 1 ]; then
     2125            umount /boot/efi 2>&1 > /dev/null
     2126        fi
     2127    else
     2128        MakeBootConfFile isolinux > $bootdir/syslinux.cfg
     2129    fi
     2130
     2131    if [ "$BOOT_TYPE" = "UEFI"] && [ -f "$lilodir/grub.conf" ]; then
     2132        # for grub 0.97 the conf file is not read with the grub.efi file :-(
     2133        # 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
    21342137    fi
    21352138
Note: See TracChangeset for help on using the changeset viewer.