diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh index f4d0855..fa043e5 100755 --- a/tools/livecd-iso-to-disk.sh +++ b/tools/livecd-iso-to-disk.sh @@ -418,7 +418,7 @@ fi # do some basic sanity checks. checkMounted $USBDEV -if [ -n "$format" ];then +if [ -z "$skipcopy" -a -n "$format" ];then checkLVM $USBDEV # checks for a valid filesystem if [ -n "$efi" ];then @@ -619,7 +619,7 @@ if [ "$isotype" = "installer" ]; then sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI fi -if [ "$overlaysizemb" -gt 0 ]; then +if [ -z "$skipcopy" -a "$overlaysizemb" -gt 0 ]; then echo "Initializing persistent overlay file" OVERFILE="overlay-$( /sbin/blkid -s LABEL -o value $USBDEV )-$( /sbin/blkid -s UUID -o value $USBDEV )" if [ "$USBFS" = "vfat" ]; then @@ -628,17 +628,20 @@ if [ "$overlaysizemb" -gt 0 ]; then else dd if=/dev/null of=$USBMNT/$LIVEOS/$OVERFILE count=1 bs=1M seek=$overlaysizemb fi +fi +# include these with --skipcopy boot reconfiguration to support boot file repair +if [ -s $USBMNT/$LIVEOS/$OVERFILE ]; then sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG $BOOTCONFIG_EFI sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG $BOOTCONFIG_EFI fi -if [ "$swapsizemb" -gt 0 ]; then +if [ -z "$skipcopy" -a "$swapsizemb" -gt 0 ]; then echo "Initializing swap file" dd if=/dev/zero of=$USBMNT/$LIVEOS/swap.img count=$swapsizemb bs=1M mkswap -f $USBMNT/$LIVEOS/swap.img fi -if [ "$homesizemb" -gt 0 ]; then +if [ -z "$skipcopy" -a "$homesizemb" -gt 0 ]; then echo "Initializing persistent /home" homesource=/dev/zero [ -n "$cryptedhome" ] && homesource=/dev/urandom