live-snapshot: now supports a static keep file list.
[live-boot-grml.git] / scripts / live
index 62b5224..e211263 100755 (executable)
@@ -875,7 +875,7 @@ try_snap ()
                        fi
                else
                        # cpio.gz snapshot
-                       if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio -i -u -d 2>/dev/null)
+                       if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1)
                        then
                                log_warning_msg "Impossible to include the ${snapfile} Snapshot"
                                return 1
@@ -1008,7 +1008,12 @@ setup_unionfs ()
                        rofslist="${image} ${rofslist}"
                elif [ -f "${image}" ]
                then
-                       backdev=$(get_backing_device "${image}" "-r")
+                       if /sbin/losetup --help 2>&1 | grep -q -- "-r\b"
+                       then
+                               backdev=$(get_backing_device "${image}" "-r")
+                       else
+                               backdev=$(get_backing_device "${image}")
+                       fi
                        fstype=$(get_fstype "${backdev}")
 
                        if [ "${fstype}" = "unknown" ]
@@ -1173,7 +1178,7 @@ setup_unionfs ()
 
        # shows cow fs on /cow for use by live-snapshot
        mkdir -p "${rootmnt}/live/cow"
-       mount -o move /cow "${rootmnt}/live/cow"
+       mount -o move /cow "${rootmnt}/live/cow" || mount -o bind /cow "${rootmnt}/live/cow" || [ "${quiet}" != "y" ] && log_warning_msg "Unable to move or bind /cow to ${rootmnt}/live/cow"
 }
 
 check_dev ()