summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2010-02-17 18:57:50 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2010-02-17 19:09:00 -0300
commit211f201644064e1331a46826187d7fbfaa5bef95 (patch)
treeff5bfbe2a2635b5fdef7b6e98bde1c65e7d5f36c
parent7d7dad06e2e9aa16fd27608027b1de06f930242b (diff)
downloadarchiso32-211f201644064e1331a46826187d7fbfaa5bef95.tar.xz
Pass $newroot as part of the $mountpoint avoiding a global variable
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
-rw-r--r--archiso/hooks/archiso18
1 files changed, 10 insertions, 8 deletions
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index 9ba539f..d9b0984 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -1,9 +1,11 @@
# args: source, mountpoint
_mnt_bind()
{
- msg "::: Binding ${1} to ${2}"
- mkdir -p $newroot${2}
- /bin/mount -o bind ${1} $newroot${2}
+ src="${1}"
+ mnt="${2}"
+ msg "::: Binding ${src} to ${mnt}"
+ mkdir -p "${mnt}"
+ /bin/mount -o bind "${src}" "${mnt}"
}
# args: /path/to/image_file
@@ -25,8 +27,8 @@ _mnt_squashfs()
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 "$newroot"
+ if [ "/${mnt#/*/}" = "/" ]; then
+ /bin/mount -t aufs -o remount,append:"${tmp_mnt}"=ro none "${mnt}"
else
_mnt_bind "${tmp_mnt}" "${mnt}"
fi
@@ -113,14 +115,14 @@ archiso_mount_handler() {
[ ! -r "/bootmnt/${img}" ] && continue
if [ "${type}" = "bind" ]; then
- _mnt_bind "/bootmnt/${img}" ${mountpoint}
+ _mnt_bind "/bootmnt/${img}" "${newroot}${mountpoint}"
elif [ "${type}" = "squashfs" ]; then
- _mnt_squashfs "/bootmnt/${img}" "${mountpoint}"
+ _mnt_squashfs "/bootmnt/${img}" "${newroot}${mountpoint}"
fi
done < "${isomounts}"
# Bind our bootmnt dir into the live system
- _mnt_bind /bootmnt /bootmnt
+ _mnt_bind /bootmnt "${newroot}/bootmnt"
if [ "${FSTYPE}" = "iso9660" -o "${FSTYPE}" = "udf" ]; then
if [ -d /proc/sys/dev/cdrom ]; then