Skip to content

Commit

Permalink
Simplifying code a bit after removal of no longer supported overlay a…
Browse files Browse the repository at this point in the history
…lternatives.
  • Loading branch information
daniel-baumann committed Jan 4, 2015
1 parent c2bad45 commit f2dcec3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
28 changes: 11 additions & 17 deletions components/9990-misc-helpers.sh
Expand Up @@ -1292,16 +1292,22 @@ do_union ()
rw_opt="rw"
ro_opt="rr+wh"
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"
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: and can unionro be optional? i.e. can overlay skip lowerdir?
if echo ${unionro} | grep -q " "
Expand All @@ -1314,18 +1320,6 @@ do_union ()
unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}"
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
}

Expand Down
14 changes: 5 additions & 9 deletions components/9990-overlay.sh
Expand Up @@ -8,16 +8,12 @@ setup_unionfs ()
rootmnt="${2}"
addimage_directory="${3}"

case ${UNIONTYPE} in
aufs|overlay)
if ! cut -f2 /proc/filesystems | grep -q "^${UNIONTYPE}\$"
then
panic "${UNIONTYPE} not available."
fi
if ! cut -f2 /proc/filesystems | grep -q "^${UNIONTYPE}\$"
then
panic "${UNIONTYPE} not available."
fi

modprobe -q -b ${UNIONTYPE}
;;
esac
modprobe -q -b ${UNIONTYPE}

# 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,
Expand Down

0 comments on commit f2dcec3

Please sign in to comment.