From 4d37d708846c7bcdfd4581d9215fc660ddec93c0 Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Mon, 1 Mar 2010 10:59:11 -0300 Subject: 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: Gerardo Exequiel Pozzi --- archiso/hooks/archiso | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'archiso/hooks') diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index 1ac4d86..73f4df9 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -1,3 +1,12 @@ +# args: source, mountpoint +_mnt_aufs() { + src="${1}" + mnt="${2}" + 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 _mnt_bind() { src="${1}" @@ -16,16 +25,17 @@ _mnt_squashfs() { tmp_mnt="/tmpfs/mnt/${img_name}" if [ "${copytoram}" = "y" ]; then - msg ":: Copying squashfs image to RAM" + msg -n ":: Copying squashfs image to RAM" /bin/cp "${img}" "/tmpfs.sqfs/${img_fullname}" img="/tmpfs.sqfs/${img_fullname}" + msg "done." fi - msg "::: Adding new aufs branch: ${img_name}" mkdir -p "${tmp_mnt}" /bin/mount -r -t squashfs "${img}" "${tmp_mnt}" + if [ "/${mnt#/*/}" = "/" ]; then - /bin/mount -t aufs -o remount,append:"${tmp_mnt}"=ro none "${mnt}" + _mnt_aufs "${tmp_mnt}" "${mnt}" else _mnt_bind "${tmp_mnt}" "${mnt}" fi -- cgit v1.2.2