Commit 4d37d708 authored by Gerardo Exequiel Pozzi's avatar Gerardo Exequiel Pozzi
Browse files

Split aufs mount command from _mnt_squashfs()

New function _mnt_aufs(). Don't display incorrect message (Adding new aufs...)
when no aufs branch is mounted, because mount type is bind.

Also, makes the code more clean :)

Signed-off-by: default avatarGerardo Exequiel Pozzi <>
parent c65f463c
# args: source, mountpoint
_mnt_aufs() {
msg "::: Adding new aufs branch: ${src} to ${mnt}"
mkdir -p "${mnt}"
/bin/mount -t aufs -o remount,append:"${src}"=ro none "${mnt}"
# args: source, mountpoint # args: source, mountpoint
_mnt_bind() { _mnt_bind() {
src="${1}" src="${1}"
...@@ -16,16 +25,17 @@ _mnt_squashfs() { ...@@ -16,16 +25,17 @@ _mnt_squashfs() {
tmp_mnt="/tmpfs/mnt/${img_name}" tmp_mnt="/tmpfs/mnt/${img_name}"
if [ "${copytoram}" = "y" ]; then if [ "${copytoram}" = "y" ]; then
msg ":: Copying squashfs image to RAM" msg -n ":: Copying squashfs image to RAM"
/bin/cp "${img}" "/tmpfs.sqfs/${img_fullname}" /bin/cp "${img}" "/tmpfs.sqfs/${img_fullname}"
img="/tmpfs.sqfs/${img_fullname}" img="/tmpfs.sqfs/${img_fullname}"
msg "done."
fi fi
msg "::: Adding new aufs branch: ${img_name}"
mkdir -p "${tmp_mnt}" mkdir -p "${tmp_mnt}"
/bin/mount -r -t squashfs "${img}" "${tmp_mnt}" /bin/mount -r -t squashfs "${img}" "${tmp_mnt}"
if [ "/${mnt#/*/}" = "/" ]; then if [ "/${mnt#/*/}" = "/" ]; then
/bin/mount -t aufs -o remount,append:"${tmp_mnt}"=ro none "${mnt}" _mnt_aufs "${tmp_mnt}" "${mnt}"
else else
_mnt_bind "${tmp_mnt}" "${mnt}" _mnt_bind "${tmp_mnt}" "${mnt}"
fi fi
Supports Markdown
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