Changeset 3479


Ignore:
Timestamp:
Oct 16, 2015, 12:14:52 PM (2 years ago)
Author:
bruno
Message:
  • Adds " around file tests with -e in mindi
  • Move ldlinux detection earlier in order to integrate it in EFI/BOOT for UEFI mode
  • in UEFI mode force GPT label on boot file (requires parted)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3476 r3479  
    15051505    # copy boot stuff now generated in PrepareDataDiskImage
    15061506    if [ "$BOOT_TYPE" = "UEFI" ]; then
    1507         FindLdlinuxe64Binary
    1508         if [ -e $LDLINUXE64 ]; then
    1509             cp $LDLINUXE64 $MINDI_TMP/iso/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXE64 to mindi tmp ($MINDI_TMP/iso/). Did you run out of disk space?"
    1510         fi
    15111507        (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI)
    15121508        tbc="EFI"
    15131509    else
    1514         # Useful for syslinux 5.x
    1515         FindLdlinux32Binary
    1516         if [ -e $LDLINUXC32 ]; then
    1517             cp $LDLINUXC32 $MINDI_TMP/iso/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to mindi tmp ($MINDI_TMP/iso/). Did you run out of disk space?"
    1518         fi
    15191510        (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./boot)
    15201511        tbc="boot"
     
    15261517            cp $MBOOTC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MBOOTC32 to mondo tmp ($MONDO_ROOT/). Did you run out of disk space?"
    15271518        fi
    1528         if [ -e $LDLINUXC32 ]; then
     1519        if [ -e "$LDLINUXC32" ]; then
    15291520            cp $LDLINUXC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $MONDO_ROOT/. Did you run out of disk space?"
    1530         fi
    1531         if [ -e $LDLINUXE64 ]; then
    1532             cp $LDLINUXE64 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXE64 to $MONDO_ROOT/. Did you run out of disk space?"
    15331521        fi
    15341522        cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy $kernelpath to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
     
    15431531            cp -rf $MINDI_TMP/iso/{initrd.img,vmlinuz,isolinux.bin,message.txt,boot*.txt,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?"
    15441532            cfgf=`find $MINDI_TMP/iso -name 'isolinux.cfg' | head -1`
    1545             if [ -e $cfgf ]; then
     1533            if [ -e "$cfgf" ]; then
    15461534                cp $cfgf $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy $cfgf to $MONDO_ROOT. Did you run out of disk space?"
    15471535            fi
     
    19341922    mkdir -p $mountpoint
    19351923    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
    1936     LogFile "INFO: Creating vfat filesystem on $imagefile"
    1937     mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
    19381924    if [ "$BOOT_TYPE" = "BIOS" ]; then
    19391925        # syslinux should be run on a  local file (doen't work through NFS Cf: #297)
    19401926        syslinux $imagefile >> $LOGFILE 2>> $LOGFILE
    19411927    fi
     1928    if [ "$BOOT_TYPE" = "UEFI" ]; then
     1929        # Should be GPT in that case to allow direct boot
     1930        parted -s $imagefile mklabel gpt
     1931    fi
     1932    LogFile "INFO: Creating vfat filesystem on $imagefile"
     1933    mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
    19421934
    19431935    # Only move it now to its final destination and use it now
     
    21992191            umount /boot/efi 2>&1 > /dev/null
    22002192        fi
    2201     fi
     2193
     2194        FindLdlinuxe64Binary
     2195        if [ -e "$LDLINUXE64" ]; then
     2196            LogFile "INFO: Copying $LDLINUXE64 to $efidir"
     2197            cp $LDLINUXE64 $efidir 2>> $LOGFILE || Die "Cannot copy $LDLINUXE64 to $efidir). Did you run out of disk space?"
     2198        fi
     2199    else   
     2200        # Useful for syslinux 5.x
     2201        FindLdlinux32Binary
     2202        if [ -e "$LDLINUXC32" ]; then
     2203            LogFile "INFO: Copying $LDLINUXC32 to $bootdir"
     2204            cp $LDLINUXC32 $bootdir 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $bootdir). Did you run out of disk space?"
     2205        fi
     2206    fi
     2207
    22022208    MakeBootConfFile $boottype > $bootconf
    22032209
     
    25642570    # recent bash says that -d is true for a link to a dir !
    25652571    for f in `sort -u $MINDI_TMP/minimal.lis`; do
    2566         if [ -e $f -a ! -d $f ] || [ -h $f ]; then
     2572        if [ -e "$f" -a ! -d "$f" ] || [ -h $f ]; then
    25672573            # Do not overwrite files already in destination (avoid using option -n of cp not portable)
    25682574            if [ ! -e "$mountpoint/$f" ]; then
     
    25832589
    25842590    # For older distributions expecting /sbin/init provides it
    2585     if [ ! -e sbin/init ]; then
     2591    if [ ! -e "sbin/init" ]; then
    25862592        (cd sbin ; ln -sf ../usr/sbin/init .)
    25872593    fi
     
    26472653            # recent bash says that -d is true for a link to a dir !
    26482654            for f in `sort -u $MINDI_TMP/udev.lis`; do
    2649                 if [ -e $f -a ! -d $f ] || [ -h $f ]; then
     2655                if [ -e "$f" -a ! -d "$f" ] || [ -h "$f" ]; then
    26502656                    # Do not overwrite files already in destination (avoid using option -n of cp not portable)
    26512657                    if [ ! -e "$mountpoint/$f" ]; then
     
    27612767
    27622768    # Ensure that with mindi-busybox 1.21, the links also exists under /bin for older distro which need it for their scripts
    2763     (cd $mountpoint/usr/bin ; for i in `ls`; do if [ ! -e $mountpoint/bin/$i ]; then (cd $mountpoint/bin ; ln -sf ../usr/bin/$i .); fi; done)
     2769    (cd $mountpoint/usr/bin ; for i in `ls`; do if [ ! -e "$mountpoint/bin/$i" ]; then (cd $mountpoint/bin ; ln -sf ../usr/bin/$i .); fi; done)
    27642770
    27652771    # Copy an additional ProLiant tool for OBDR support
     
    30053011LogFile "-------------"
    30063012mount >> $LOGFILE
    3007 if [ -e /etc/raidtab ]; then
     3013if [ -e "/etc/raidtab" ]; then
    30083014    LogFile "-------------"
    30093015    LogFile "/etc/raidtab content:"
     
    30133019    LogFile "No file /etc/raidtab"
    30143020fi
    3015 if [ -e /etc/mdadm.conf ]; then
     3021if [ -e "/etc/mdadm.conf" ]; then
    30163022    LogFile "-------------"
    30173023    LogFile "/etc/mdadm.conf content:"
     
    30313037cat /proc/swaps >> $LOGFILE
    30323038LogFile "-------------"
    3033 if [ -e /proc/mdstat ]; then
     3039if [ -e "/proc/mdstat" ]; then
    30343040    LogFile "cat /proc/mdstat:"
    30353041    LogFile "-------------"
Note: See TracChangeset for help on using the changeset viewer.