[Fedora-livecd-list] Review request for --skipcopy patches

Bruno Wolff III bruno at wolff.to
Mon Jul 26 06:17:27 UTC 2010


I have attached two patches from bug 582051 that are intended to make
--skipcopy more useful for testing. One is for functionallity, the other
expands the documentation of what skipcopy skips a bit better.

As discussed in the bug report I don't like:

+if [ -s $USBMNT/$LIVEOS/$OVERFILE ]; then

and think that it should be:

+if [ "$overlaysizemb" -gt 0 ]; then

This is easier to understand and seems more likely to be correct.
I am not sure if my comment about my suggestion was misunderstood, but I
don't see why my suggestion wouldn't work and the one provided would.
But maybe there is something subtle going on.

Since --skipcopy is for testing I don't think the patch will have much
impact on normal use.

So I would be inclined to except this patch if modified as I suggest, but I'd
like to get more feedback.
-------------- next part --------------
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index c673eef..70af44b 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -44,7 +44,7 @@ Disables the encryption of the home directory.
 
 =item --skipcopy
 
-Skips the copy of the live image to the USB stick.
+Skips the copy of the live image to the USB stick, bypassing the actions of the --format, --overlay-size-mb, --home-size-mb, & --swap-size-mb options, if present on the command line. (The --skipcopy option is used while testing the script, in order to avoid repeated and lengthy copy commands, or to repair disk configuration files.)
 
 =item --efi
 
-------------- next part --------------
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


More information about the livecd mailing list