Changeset 3480 in MondoRescue


Ignore:
Timestamp:
Oct 16, 2015, 4:05:28 PM (9 years ago)
Author:
Bruno Cornec
Message:

Create partition for GPT device and prepare loop device to mount it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3479 r3480  
    4242
    4343EXTRA_SPACE=120000      # increase if you run out of ramdisk space
    44 BOOT_SIZE=86000         # size of the boot disk
     44BOOT_SIZE=86000         # size of the boot disk in KB
    4545
    4646PROMPT_MAKE_CD_IMAGE="yes"
     
    19251925        # syslinux should be run on a  local file (doen't work through NFS Cf: #297)
    19261926        syslinux $imagefile >> $LOGFILE 2>> $LOGFILE
     1927        imagefile2=$imagefile
    19271928    fi
    19281929    if [ "$BOOT_TYPE" = "UEFI" ]; then
    19291930        # Should be GPT in that case to allow direct boot
    19301931        parted -s $imagefile mklabel gpt
     1932        parted -s $imagefile mkpart fat32 1 ${BOOT_SIZE}k 2> /dev/null
     1933        kpartx -a $imagefile
     1934        imagefile2=/dev/mapper/`kpartx -l $imagefile | awk '{print $1}'`
    19311935    fi
    19321936    LogFile "INFO: Creating vfat filesystem on $imagefile"
    1933     mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
     1937    mkfs.vfat $imagefile2 >> $LOGFILE 2>> $LOGFILE
    19341938
    19351939    # Only move it now to its final destination and use it now
     
    19371941    imagefile=$MINDI_CACHE/mindi-bootroot.img
    19381942
    1939     mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)"
     1943    mount -t vfat -o loop $imagefile2 $mountpoint || LogAll "ERROR: Cannot mount (PBDI)"
    19401944
    19411945    LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."
     
    20072011        LogAll "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n"
    20082012    fi
    2009     #[ "$imagefile" != "" ] && rm -f $imagefile
    20102013    [ "$retval" -ne "0" ] && LogAll "ERROR: PrepareBootDiskImage() is returning $retval"
    20112014    return $retval
Note: See TracChangeset for help on using the changeset viewer.