Merge lp:~binli/ubuntu/trusty/casper/overlayfs into lp:ubuntu/trusty/casper

Proposed by Bin Li
Status: Merged
Merge reported by: Adam Conrad
Merged at revision: not available
Proposed branch: lp:~binli/ubuntu/trusty/casper/overlayfs
Merge into: lp:ubuntu/trusty/casper
Diff against target: 69 lines (+23/-6)
2 files modified
debian/changelog (+14/-0)
scripts/casper (+9/-6)
To merge this branch: bzr merge lp:~binli/ubuntu/trusty/casper/overlayfs
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+256113@code.launchpad.net

Description of the change

Support newer overlayfs in newer kernel.(LP: #1401620, LP: #1412411)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-04-09 18:47:09 +0000
3+++ debian/changelog 2015-04-14 09:00:51 +0000
4@@ -1,3 +1,17 @@
5+casper (1.341) UNRELEASED; urgency=medium
6+
7+ [Andy Whitcroft]
8+ * scripts/casper: switch up to overlayfs V2 format (overlay filesystem
9+ type) when available. (LP: #1412411)
10+
11+ * scripts/casper: move union content into a subdirectory of the /cow
12+ device, to allow us to create a workdir where that is needed for
13+ overlayfs. Also attempt to mount overlayfs with and without the
14+ workdir= to cope with the semantic change in newer kernels.
15+ (LP: #1401620)
16+
17+ -- Bin Li <bin.li@canonical.com> Tue, 14 Apr 2015 16:49:31 +0800
18+
19 casper (1.340) trusty; urgency=medium
20
21 * Remove 23etc_modules which does more harm than good (LP: #1296386)
22
23=== modified file 'scripts/casper'
24--- scripts/casper 2014-03-19 14:22:36 +0000
25+++ scripts/casper 2015-04-14 09:00:51 +0000
26@@ -380,7 +380,7 @@
27 rootmnt="$2"
28
29 if [ "${UNIONFS}" = 'DEFAULT' ]; then
30- for union in 'overlayfs' 'aufs' 'unionfs'
31+ for union in 'overlay' 'overlayfs' 'aufs' 'unionfs'
32 do
33 modprobe "${MP_QUIET}" -b ${union} || true
34 if cut -f2 /proc/filesystems | grep -q "^${union}\$"; then
35@@ -461,17 +461,18 @@
36 fi
37
38 mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || panic "Can not mount $cowdevice on /cow"
39+ mkdir -p /cow/upper /cow/work
40
41 case ${UNIONFS} in
42 unionfs-fuse)
43- (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 "${UNIONFS} mount failed")
44+ (ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow/upper=RW:$rofsstring "$rootmnt" || panic "${UNIONFS} mount failed")
45 mkdir -p /dev/.initramfs/varrun
46 pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
47 ;;
48 aufs|unionfs)
49- mount -t ${UNIONFS} -o noatime,dirs=/cow=rw:$rofsstring ${UNIONFS} "$rootmnt" || panic "${UNIONFS} mount failed"
50+ mount -t ${UNIONFS} -o noatime,dirs=/cow/upper=rw:$rofsstring ${UNIONFS} "$rootmnt" || panic "${UNIONFS} mount failed"
51 ;;
52- overlayfs)
53+ overlay|overlayfs)
54 # Mount the layers pairwise from the bottom onto rootmnt,
55 # for the second and later layers rootmnt forms the lower layer.
56 mounts=""
57@@ -486,8 +487,10 @@
58 lower="$mount"
59 continue
60 fi
61- mount -t overlayfs -o "upperdir=$mount,lowerdir=$lower" \
62- "$mount" "$rootmnt"
63+ mount -t ${UNIONFS} -o "upperdir=$mount/upper,lowerdir=$lower,workdir=$mount/work" \
64+ "$mount" "$rootmnt" || \
65+ mount -t ${UNIONFS} -o "upperdir=$mount/upper,lowerdir=$lower" \
66+ "$mount" "$rootmnt"
67 lower="$rootmnt"
68 done
69 ;;

Subscribers

People subscribed via source and target branches

to all changes: