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


Ignore:
Timestamp:
Feb 26, 2014, 10:46:25 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Moves the creation of the symlinks for directories on /bin, /sbin in TurnTgzIntoRdz after mounting the FS so that it's done at the right place now.
  • Apply again a patch on mindi to detect correctly kernel version 3 and upper which had disappeared :-(
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3247 r3248  
    18581858
    18591859PrepareBootDiskImage_LILO() {
    1860     local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf
     1860    local imagesdir dev imagefile fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf
    18611861    imagesdir=$MINDI_CACHE
    18621862    kernelpath=$1
     
    18701870    echo -en "..."
    18711871    imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img
    1872     mountpoint=$MINDI_TMP/mountpoint.$$
    18731872    mkdir -p $mountpoint
    18741873    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
     
    19681967
    19691968PrepareBootDiskImage_ISOLINUX() {
    1970     local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage retval
     1969    local imagesdir dev imagefile fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage retval
    19711970    imagesdir=$MINDI_CACHE
    19721971    kernelpath=$1
     
    19801979    echo -en "..."
    19811980    imagefile=$MINDI_TMP/mindi-bootroot.$BOOT_SIZE.img
    1982     mountpoint=$MINDI_TMP/mountpoint.$$
    19831981    mkdir -p $mountpoint
    19841982    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
     
    20982096    mkdir -p $bigdir/usr/sbin
    20992097    includefile=$MINDI_TMP/$$.includefile.txt
    2100 
    2101     # Check whether /lib64 or /lib or /sbin or /bin is a link and if so explicitly create one in rootfs (Fedora 17 crazyness)
    2102     for d in bin sbin lib lib64; do
    2103         if [ -h "/$d" ]; then
    2104             thelink=`readlink /$d`
    2105             mkdir -p $mountpoint/$thelink || LogIt "ERROR: Unable to create $thelink in $mountpoint."
    2106             mv $mountpoint/$d/* $mountpoint/$d/.??* $mountpoint/$thelink 2> /dev/null
    2107             if [ -d "$mountpoint/$d" -a ! -h "$mountpoint/$d" ]; then
    2108                 rmdir $mountpoint/$d
    2109             fi
    2110             if [ ! -h $mountpoint/$d ]; then
    2111                 rm -f $mountpoint/$d 2> /dev/null
    2112                 (cd $mountpoint ; ln -s $thelink $d) || LogIt "ERROR: /$d is a symbolic link, but I couldn't create it in $mountpoint."
    2113             fi
    2114         fi
    2115     done
    21162098
    21172099    lfiles=`ls $DEPLIST_DIR/* | grep -v /minimal`
     
    23432325        if [ "$?" -eq "0" ] ; then
    23442326            # Used by ia64
    2345             fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
     2327            fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23462328        else
    2347             fkern_ver=`strings $fname 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
     2329            fkern_ver=`strings $fname 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23482330        fi
    23492331        echo "$fkern_ver"
     
    24952477
    24962478TurnTgzIntoRdz() {
    2497     local tgz_dir_fname rdz_fname tempfile mountpoint old_pwd nodes kernelsize maxsize res currsize not_copied j k s w needed_modules_path
     2479    local tgz_dir_fname rdz_fname tempfile old_pwd nodes kernelsize maxsize res currsize not_copied j k s w needed_modules_path d thelink
    24982480
    24992481    tgz_dir_fname=$1
     
    25032485    maxsize=$(($maxsize*2)); # to allow for compression of 50%
    25042486    tempfile=$MINDI_TMP/temp.rd
    2505     mountpoint=$MINDI_TMP/mnt1
    25062487    res=0
    25072488    echo -en "..."
     
    25172498    cd "$mountpoint"
    25182499
     2500    # Check whether /lib64 or /lib or /sbin or /bin is a link and if so explicitly create one in rootfs (Fedora 17 crazyness)
     2501    for d in bin sbin lib lib64; do
     2502        if [ -h "/$d" ]; then
     2503            thelink=`readlink /$d`
     2504            mkdir -p $mountpoint/$thelink || LogIt "ERROR: Unable to create $thelink in $mountpoint."
     2505            mv $mountpoint/$d/* $mountpoint/$d/.??* $mountpoint/$thelink 2> /dev/null
     2506            if [ -d "$mountpoint/$d" -a ! -h "$mountpoint/$d" ]; then
     2507                rmdir $mountpoint/$d
     2508            fi
     2509            if [ ! -h $mountpoint/$d ]; then
     2510                rm -f $mountpoint/$d 2> /dev/null
     2511                (cd $mountpoint ; ln -s $thelink $d) || LogIt "ERROR: /$d is a symbolic link, but I couldn't create it in $mountpoint."
     2512            fi
     2513        fi
     2514    done
     2515    LogFile "INFO: what is now in $mountpoint"
     2516    ls -alR $mountpoint >> $LOGFILE
    25192517   
    25202518    # Check files before copying to discover configuration issues or McAfee preventing mindi reading these files
     
    33343332[ "$(($RANDOM%64))" -eq "0" ] && LogIt "INFO: Dude, I've looked inside your computer and it's really dusty..."
    33353333
     3334mountpoint=$MINDI_TMP/mountpoint.$$
    33363335PrepareDataDiskImages
    33373336
Note: See TracChangeset for help on using the changeset viewer.