summaryrefslogtreecommitdiff
path: root/archiso/hooks
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-08-09 16:28:52 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-08-09 16:28:52 -0300
commit57d2ea1f4b3445a2815f6c4e3f49f2ad7209c87e (patch)
tree27edbe98319f349f3a231830b1abe877c6e9a5d2 /archiso/hooks
parentb3f918ee602fa39b9437f57b3fc816bdff2ee44a (diff)
downloadarchiso32-57d2ea1f4b3445a2815f6c4e3f49f2ad7209c87e.tar.xz
[archiso] Add dm_snap_prefix= boot param.
Default value is "arch". This implies that all device mapper node for snapshot devices will be for example: arch_root-image. This helps AIF to hidden these devices from "Device Configuration". Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso/hooks')
-rw-r--r--archiso/hooks/archiso10
1 files changed, 6 insertions, 4 deletions
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index 7e2997a..66dbafd 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -29,6 +29,7 @@ _mnt_fs() {
local mnt="${2}"
local img_fullname="${img##*/}";
local img_name="${img_fullname%%.*}"
+ local dm_snap_name="${dm_snap_prefix}_${img_name}"
local ro_dev ro_dev_size ro_dev_fs_type rw_dev
mkdir -p "${mnt}"
@@ -42,11 +43,11 @@ _mnt_fs() {
_next_loop_dev
rw_dev=$(_make_loop_dev "/cowspace/${img_name}.cow")
- echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${img_name}
+ echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} N 8" | dmsetup create ${dm_snap_name}
- msg ":: Mounting '/dev/mapper/${img_name}' (${ro_dev_fs_type}) to '${mnt}'"
- if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${img_name}" "${mnt}" ; then
- echo "ERROR: while mounting '/dev/mapper/${img_name}' to '${mnt}'"
+ msg ":: Mounting '/dev/mapper/${dm_snap_name}' (${ro_dev_fs_type}) to '${mnt}'"
+ if ! mount -t "${ro_dev_fs_type}" "/dev/mapper/${dm_snap_name}" "${mnt}" ; then
+ echo "ERROR: while mounting '/dev/mapper/${dm_snap_name}' to '${mnt}'"
launch_interactive_shell
fi
}
@@ -81,6 +82,7 @@ run_hook() {
[[ -z "${cowspace_size}" ]] && cowspace_size="75%"
[[ -z "${copytoram_size}" ]] && copytoram_size="75%"
[[ -z "${archisobasedir}" ]] && archisobasedir="arch"
+ [[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch"
[[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}"
if [[ -z "${aitab}" ]]; then
aitab="/bootmnt/${archisobasedir}/aitab"