Changeset 3499 in MondoRescue for branches/3.2/mindi/mindi


Ignore:
Timestamp:
Feb 9, 2016, 2:41:11 AM (8 years ago)
Author:
Bruno Cornec
Message:
  • Creates TMPDIR if it doesn't exist for mindi and analyze-my-lvm
  • Use syslinux dir systematically for boot env whatever the boot loader of this family as it works for all.
  • Improve seed for deps computation in mindi by global sorting
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3493 r3499  
    3939
    4040# Temporary directory for mindi
    41 TMPDIR=/tmp
     41TMPDIR=${TMPDIR:=/tmp}
     42if [ ! -d $TMPDIR ]; then
     43    mkdir -p $TMPDIR
     44fi
    4245
    4346EXTRA_SPACE=120000      # increase if you run out of ramdisk space
     
    10561059   
    10571060    if [ $LVM != "false" ]; then
    1058         LogAll "INFO: Analyzing LVM..."
     1061        LogFile "INFO: Analyzing LVM..."
    10591062        $MINDI_LIB/analyze-my-lvm > $MINDI_TMP/lvm.res
    10601063        if [ $? -ne 0 ]; then
     
    14891492    done
    14901493
    1491     MakeMessageFile $MINDI_TMP/iso | cut -c1-80 > $MINDI_TMP/iso/message.txt
    1492 
    1493     if [ $KERNEL_IS_XEN = "yes" ]; then
    1494         FindMboot32Binary
    1495         cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"
    1496         cp $MBOOTC32 $MINDI_TMP/iso/mboot.c32  2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/mboot.c32). Did you run out of disk space?"
    1497     fi
    1498 
    14991494    cp $kernelpath $MINDI_TMP/iso/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/vmlinuz). Did you run out of disk space?"
    15001495    cp $MINDI_TMP/initrd.img $MINDI_TMP/iso/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MINDI_TMP/iso/initrd.img. Did you run out of disk space?"
     
    15051500        tbc="EFI"
    15061501    else
    1507         (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./boot)
    1508         tbc="boot"
    1509     fi
     1502        (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux)
     1503        tbc="syslinux"
     1504    fi
     1505
     1506    MakeMessageFile $MINDI_TMP/iso/$tbc | cut -c1-80 > $MINDI_TMP/iso/$tbc/message.txt
     1507
    15101508    if [ "$ARCH" != "ia64" ] ; then
     1509        if [ $KERNEL_IS_XEN = "yes" ]; then
     1510            FindMboot32Binary
     1511            cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"
     1512            cp $MBOOTC32 $MINDI_TMP/iso/$tbc/mboot.c32  2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/$tbc/mboot.c32). Did you run out of disk space?"
     1513        fi
     1514
    15111515        cp $ISOLINUX $MINDI_TMP/iso/$tbc/isolinux.bin 2>> $LOGFILE || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?"
    1512     fi
    1513 
    1514     if [ _"$MONDO_SHARE" != _"" ]; then
    1515         if [ $KERNEL_IS_XEN = "yes" ]; then
    1516             cp $xenkernelpath $MONDO_ROOT/xen.gz 2>> $LOGFILE || Die "Cannot copy $xenkernelpath to mondo tmp ($MONDO_ROOT/xen.gz). Did you run out of disk space?"
    1517             cp $MBOOTC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MBOOTC32 to mondo tmp ($MONDO_ROOT/). Did you run out of disk space?"
    1518         fi
     1516
    15191517        if [ -e "$LDLINUXC32" ]; then
    1520             cp $LDLINUXC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $MONDO_ROOT/. Did you run out of disk space?"
    1521         fi
    1522         cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy $kernelpath to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
    1523         cp $MINDI_TMP/initrd.img $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MINDI_TMP/initrd.img to $MONDO_ROOT/. Did you run out of disk space?"
    1524     fi
    1525 
    1526    
    1527     old_pwd=`pwd`
    1528     cd "$MINDI_TMP/iso"
    1529     if [ "$ARCH" != "ia64" ] ; then
    1530         cfgf=`find $MINDI_TMP/iso -name 'syslinux.cfg' | head -1`
    1531         cfgf2=`echo $cfgf | sed 's/syslinux.cfg/isolinux.cfg/'`
    1532         mv $cfgf $cfgf2
    1533         # For isolinux boot, name the directory correctly as well as the conf file
    1534         if [ -e "$MINDI_TMP/iso/boot" ]; then
    1535             mv $MINDI_TMP/iso/boot $MINDI_TMP/iso/isolinux
    1536             tbc="isolinux"
    1537         fi
     1518            cp $LDLINUXC32 $MINDI_TMP/iso/$tbc 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $MINDI_TMP/iso/$tbc. Did you run out of disk space?"
     1519        fi
     1520
    15381521        if [ _"$MONDO_SHARE" != _"" ]; then
    1539             cp -rf $MINDI_TMP/iso/{initrd.img,vmlinuz,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?"
     1522            cp -rf $MINDI_TMP/iso/{initrd.img,vmlinuz,$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?"
    15401523            if [ $KERNEL_IS_XEN = "yes" ]; then
    15411524                cp -f $MINDI_TMP/iso/xen.gz $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy Xen kernel to $MONDO_ROOT. Did you run out of disk space?"
     
    15471530        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"
    15481531    fi
     1532
     1533    old_pwd=`pwd`
     1534    cd "$MINDI_TMP/iso"
    15491535    LogFile "Invoking $CMD"
    15501536    $CMD . > /dev/null 2> $MINDI_TMP/mkisofs.log
     
    18801866        else
    18811867            ps="/"
    1882             if [ "$type" = "syslinux" ]; then
    1883                 ps=""
    1884             fi
    18851868            if [ $KERNEL_IS_XEN = "no" ]; then
    18861869                outstr="label $i\n\tkernel ${ps}vmlinuz\n\tappend initrd=${ps}initrd.img root=/dev/ram0 rw ramdisk_size=$ramdisk_size ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS\n"
     
    19161899    old_pwd=`pwd`
    19171900    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
     1901    TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?"
    19181902    echo -en "Making "$BOOT_SIZE"KB boot disk..."
    1919     TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?"
    1920     echo -en "..."
    19211903    imagefile=$MINDI_TMP/mindi-bootroot.img
    19221904    mkdir -p $mountpoint
    19231905    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
     1906    echo -en "..."
    19241907    #if [ "$BOOT_TYPE" = "UEFI" ]; then
    19251908        # Should be GPT in that case to allow direct boot
     
    19551938        retval=$(($retval+1))
    19561939    fi
    1957     MakeMessageFile $mountpoint | cut -c1-80 > $mountpoint/message.txt
     1940    #MakeMessageFile $mountpoint | cut -c1-80 > $mountpoint/message.txt
    19581941
    19591942    mkdir -p $mountpoint/tmp
     
    20001983        (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI)
    20011984    else
    2002         (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./boot)
     1985        (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux)
    20031986    fi
    20041987
     
    21542137    # to get it on the media (in addition to the boot part
    21552138    # and also to support UEFI boot mechanism
    2156     bootdir=$bigdir/boot
     2139    bootdir=$bigdir/syslinux
    21572140    bootconf="$bootdir/syslinux.cfg"
    2158     boottype=isolinux
     2141    boottype=syslinux
    21592142    mkdir -p $bootdir
    21602143    if [ "$BOOT_TYPE" != "BIOS" ]; then
     
    22112194        fi
    22122195
    2213         if [ $boottype = "isolinux" ]; then
     2196        if [ $boottype = "syslinux" ]; then
    22142197            FindLdlinuxe64Binary
    22152198            if [ -e "$LDLINUXE64" ]; then
     
    25832566    done
    25842567    LogAll "Processing all dependencies of required files..."
    2585     for f in `cat $MINDI_TMP/minimal.lis` `sort -u $MINDI_TMP/minimal2.lis`; do
     2568    for f in `sort -u $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis`; do
    25862569        mr-read-all-link $f >> $MINDI_TMP/minimal.lis
    25872570    done
     
    26012584    rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
    26022585
     2586    fnllist=`echo $finallist | sort -u`
    26032587    #tar cf - $finallist 2> $templog | tar xf - || LogIt "WARNING: Problem in minimal analysis" $templog
    26042588    echo "INFO: Copy the minimal env with cp -a --parents $finallist -t $mountpoint" 2>&1 >> $templog
    2605     cp -a --parents $finallist -t $mountpoint 2> $templog || LogIt "WARNING: Problem in minimal analysis" $templog
     2589    cp -a --parents $fnllist -t $mountpoint 2> $templog || LogIt "WARNING: Problem in minimal analysis" $templog
    26062590
    26072591    # In case target /bin dir still doesn't exist, create it before using it
     
    28152799    fi
    28162800
    2817     if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
     2801    if [ ! -e "/sbin/devfsd" ]; then
    28182802        LogFile "INFO: Deleting devfsd daemon from ramdisk"
    28192803        [ ! -e "/sbin/devfsd" ] && LogFile "      ...because /sbin/devfsd not found"
     
    28402824        (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI)
    28412825    else
    2842         (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./boot)
     2826        (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux)
    28432827    fi
    28442828
Note: See TracChangeset for help on using the changeset viewer.