summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorSimo Leone <simo@archlinux.org>2007-10-24 20:18:48 -0500
committerSimo Leone <simo@archlinux.org>2007-10-24 20:20:59 -0500
commitcd4b603584fb4965976b54b89d0c43bfd433f2c2 (patch)
treec31c13edb2fca53243d2559da999ce1401304031 /hooks
parentadbe44f229c1ad23a9af86c4dca379b103ccb5ca (diff)
downloadarchiso32-cd4b603584fb4965976b54b89d0c43bfd433f2c2.tar.xz
Remove dupe code for mounting base image
Also improved variable naming. Signed-off-by: Simo Leone <simo@archlinux.org>
Diffstat (limited to 'hooks')
-rw-r--r--hooks/archiso18
1 files changed, 6 insertions, 12 deletions
diff --git a/hooks/archiso b/hooks/archiso
index c09d7bd..354b602 100644
--- a/hooks/archiso
+++ b/hooks/archiso
@@ -36,27 +36,20 @@ run_hook ()
exit 1
fi
- squashimg="${BOOT_MOUNT}/archlive.sqfs"
+ base_img="${BOOT_MOUNT}/archlive.sqfs"
if [ "${copytoram}" = "y" ]; then
- /bin/cat ${squashimg} > /tmpfs/archlive.sqfs
- squashimg="/tmpfs/archlive.sqfs"
+ /bin/cat ${base_img} > /tmpfs/archlive.sqfs
+ base_img="/tmpfs/archlive.sqfs"
fi
msg ":: Mounting squashfs image"
/bin/modprobe -q squashfs >/dev/null 2>&1
- /bin/mkdir -p /tmpfs/squashfs_root
- if ! /bin/losetup /dev/loop0 "${squashimg}" >/dev/null 2>&1; then
- echo "ERROR: Cannot mount loop device /dev/loop0...aborting"
- exit 1
- fi
-
- /bin/mount -r -t squashfs /dev/loop0 /tmpfs/squashfs_root
msg ":: Mounting root (union) filesystem"
/bin/modprobe -q unionfs >/dev/null 2>&1
/bin/mount -t unionfs -o dirs=/tmpfs=rw none /real_root
- export LOOP_NUM="1"
+ export LOOP_NUM="0"
addon_dir="${BOOT_MOUNT}/addons"
# always layer default configuration
@@ -76,7 +69,8 @@ run_hook ()
done < ${addon_dir}/config
fi
- /bin/mount -t unionfs -o remount,add=:/tmpfs/squashfs_root=ro none /real_root
+ # layer the "pristine" base system image last
+ _mnt_squashfs ${base_img}
if [ -d /proc/sys/dev/cdrom ]; then
echo 0 > /proc/sys/dev/cdrom/lock