Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-02-22 19:19:30 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-02-22 21:18:15 -0300
commit7c6c7e1ca52d595a93491b2cef0e6a67a9c4d681 (patch)
tree46b2a2615a217e147d4bf44cfbf3abd326a71b3d
parent25907d823e88f9b890c271fd1bf06e61ceb014b8 (diff)
[archiso] Use _mnt_dev() for SquashFS and dm-mapper
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
-rw-r--r--archiso/hooks/archiso19
1 files changed, 3 insertions, 16 deletions
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index af3d58d..bd7aea7 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -8,8 +8,6 @@ _mnt_fs() {
local dm_snap_name="${dm_snap_prefix}_${img_name}"
local ro_dev ro_dev_size rw_dev
- mkdir -p "${newroot}${mnt}"
-
ro_dev=$(losetup --find --show "${img}")
ro_dev_size=$(blockdev --getsz ${ro_dev})
@@ -33,13 +31,8 @@ _mnt_fs() {
echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name}
- msg ":: Mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'"
- if ! mount "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" ; then
- echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${newroot}${mnt}'"
- launch_interactive_shell
- else
- echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab
- fi
+ _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w"
+ echo "/dev/mapper/${dm_snap_name} ${mnt} auto defaults 0 0" >> ${newroot}/etc/fstab
}
# args: /path/to/image_file, mountpoint
@@ -48,8 +41,6 @@ _mnt_sfs() {
local mnt="${2}"
local img_fullname="${img##*/}"
- mkdir -p "${mnt}"
-
if [[ "${copytoram}" == "y" ]]; then
msg -n ":: Copying squashfs image to RAM..."
if ! cp "${img}" "/run/archiso/copytoram/${img_fullname}" ; then
@@ -59,11 +50,7 @@ _mnt_sfs() {
img="/run/archiso/copytoram/${img_fullname}"
msg "done."
fi
- msg ":: Mounting '${img}' (SquashFS) to '${mnt}'"
- if ! mount -r "${img}" "${mnt}" &> /dev/null ; then
- echo "ERROR: while mounting '${img}' to '${mnt}'"
- launch_interactive_shell
- fi
+ _mnt_dev "${img}" "${mnt}" "-r"
}
# args: device, mountpoint, flags