Skip to content

Commit

Permalink
Merging casper 1.178.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-baumann committed Apr 30, 2010
1 parent dd274d3 commit f28a622
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
21 changes: 21 additions & 0 deletions docs/ChangeLog.casper
@@ -1,3 +1,24 @@
casper (1.178) karmic; urgency=low

* Ensure that unionfs-fuse isn't killed by /etc/init.d/sendsigs on
shutdown (LP: #386010).
* Patches from "phl" (https://launchpad.net/~ubuntu-leledy), adjusted by
me, to fix snapshot resync:
- Avoid using cpio -u -d options if klibc cpio is in use (LP: #384059).
- Copy /etc/casper.conf into /root, otherwise we forget snapshot resync
settings (LP: #384061).
- Adjust the first field of *SNAP entries in casper.conf to be relative
to /cow, not /root (LP: #384066).
- Prefix $DEST with $MOUNTP in casper-snapshot (LP: #384068).
- /etc/init.d/casper is usually called with 'start', so handle that as
well as 'stop' to do snapshot resyncing and CD ejecting (LP: #384076).
* Fix casper-snapshot(1) syntax to avoid missing spaces between options
and their values.
* Fix showmounts when used in conjunction with unionfs-fuse; read-only
filesystems need to be bind-mounted rather than move-mounted.

-- Colin Watson <cjwatson@ubuntu.com> Fri, 12 Jun 2009 13:24:28 +0100

casper (1.177) karmic; urgency=low

* Port from Debian (thanks, Daniel Baumann):
Expand Down
31 changes: 24 additions & 7 deletions scripts/live
Expand Up @@ -1081,14 +1081,23 @@ try_snap ()
RES=$?
else
# cpio.gz snapshot
cd "${snap_mount}"
zcat "${snapback}/${snapfile}" | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1
RES=$?
if [ "${RES}" != "0" ]

# Unfortunately klibc's cpio is incompatible with the
# rest of the world; everything else requires -u -d,
# while klibc doesn't implement them. Try to detect
# whether it's in use.
cpiopath="$(which cpio)" || true
if [ "$cpiopath" ] && grep -aq /lib/klibc "$cpiopath"
then
cpioargs=
else
cpioargs='--unconditional --make-directories'
fi

if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null)
then
log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories\""
log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | cpio $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse\""
fi
cd "${OLDPWD}"
fi

umount "${snapback}" || log_warning_msg "failure to \"umount ${snapback}\""
Expand Down Expand Up @@ -1129,7 +1138,7 @@ try_snap ()
return 1
fi

echo "export ${snap_type}SNAP="${snap_mount}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
echo "export ${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
return 0
}

Expand Down Expand Up @@ -1419,6 +1428,8 @@ setup_unionfs ()
case "${UNIONTYPE}" in
unionfs-fuse)
(ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow=RW:${exposedrootfs}${dir} "${rootmnt}${dir}" || panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option cow,noinitgroups,default_permissions,allow_other,use_ino,suid=/cow=RW:${exposedrootfs}${dir}")
mkdir -p /dev/.initramfs/varrun
pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
;;

*)
Expand All @@ -1430,6 +1441,8 @@ setup_unionfs ()
case "${UNIONTYPE}" in
unionfs-fuse)
(ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow=RW:${rofsstring} "${rootmnt}" || panic "mount ${UNIONTYPE} on ${rootmnt} failed with option cow,noinitgroups,default_permissions,allow_other,use_ino,suid=/cow:RW:${rofsstring}")
mkdir -p /dev/.initramfs/varrun
pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
;;

*)
Expand Down Expand Up @@ -1860,4 +1873,8 @@ mountroot ()
exec 2>&7 7>&-
kill ${tailpid}
[ -w "${rootmnt}/var/log/" ] && cp live.log "${rootmnt}/var/log/" 2>/dev/null
if [ -f /etc/live.conf ]
then
cp /etc/live.conf "${rootmnt}/etc/"
fi
}

0 comments on commit f28a622

Please sign in to comment.