Commit f2dcec3f authored by Daniel Baumann's avatar Daniel Baumann

Simplifying code a bit after removal of no longer supported overlay alternatives.

parent c2bad45e
...@@ -1292,16 +1292,22 @@ do_union () ...@@ -1292,16 +1292,22 @@ do_union ()
rw_opt="rw" rw_opt="rw"
ro_opt="rr+wh" ro_opt="rr+wh"
noxino_opt="noxino" noxino_opt="noxino"
unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}"
if [ -n "${unionro}" ]
then
for rofs in ${unionro}
do
unionmountopts="${unionmountopts}:${rofs}=${ro_opt}"
done
fi
mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
;; ;;
*) overlay)
rw_opt="rw" rw_opt="rw"
ro_opt="ro" ro_opt="ro"
;;
esac
case "${UNIONTYPE}" in
overlay)
# XXX: can multiple unionro be used? (overlay only handles two dirs, but perhaps they can be chained?) # XXX: can multiple unionro be used? (overlay only handles two dirs, but perhaps they can be chained?)
# XXX: and can unionro be optional? i.e. can overlay skip lowerdir? # XXX: and can unionro be optional? i.e. can overlay skip lowerdir?
if echo ${unionro} | grep -q " " if echo ${unionro} | grep -q " "
...@@ -1314,18 +1320,6 @@ do_union () ...@@ -1314,18 +1320,6 @@ do_union ()
unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}" unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}"
mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}" mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
;; ;;
*)
unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}"
if [ -n "${unionro}" ]
then
for rofs in ${unionro}
do
unionmountopts="${unionmountopts}:${rofs}=${ro_opt}"
done
fi
mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
;;
esac esac
} }
......
...@@ -8,16 +8,12 @@ setup_unionfs () ...@@ -8,16 +8,12 @@ setup_unionfs ()
rootmnt="${2}" rootmnt="${2}"
addimage_directory="${3}" addimage_directory="${3}"
case ${UNIONTYPE} in
aufs|overlay)
if ! cut -f2 /proc/filesystems | grep -q "^${UNIONTYPE}\$" if ! cut -f2 /proc/filesystems | grep -q "^${UNIONTYPE}\$"
then then
panic "${UNIONTYPE} not available." panic "${UNIONTYPE} not available."
fi fi
modprobe -q -b ${UNIONTYPE} modprobe -q -b ${UNIONTYPE}
;;
esac
# run-init can't deal with images in a subdir, but we're going to # run-init can't deal with images in a subdir, but we're going to
# move all of these away before it runs anyway. No, we're not, # move all of these away before it runs anyway. No, we're not,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment