summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
Diffstat (limited to 'archiso')
-rw-r--r--archiso/hooks/archiso17
1 files changed, 10 insertions, 7 deletions
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso
index 202325f..7012343 100644
--- a/archiso/hooks/archiso
+++ b/archiso/hooks/archiso
@@ -22,16 +22,17 @@ _make_loop_dev() {
echo /dev/loop${loop_dev_count}
}
-# args: source, mountpoint
+# args: source, newroot, mountpoint
_mnt_fs() {
local img="${1}"
- local mnt="${2}"
+ local newroot="${2}"
+ local mnt="${3}"
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}"
+ mkdir -p "${newroot}${mnt}"
_next_loop_dev
ro_dev=$(_make_loop_dev "${img}")
@@ -60,10 +61,12 @@ _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}' (${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}'"
+ msg ":: Mounting '/dev/mapper/${dm_snap_name}' (${ro_dev_fs_type}) to '${newroot}${mnt}'"
+ if ! mount -t "${ro_dev_fs_type}" "/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
}
@@ -214,7 +217,7 @@ archiso_mount_handler() {
[[ "${aitab_arch}" != "any" && "${aitab_arch}" != "${arch}" ]] && continue
if [[ "${aitab_fs_type}" != "none" ]]; then
_mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.fs.sfs" "/run/archiso/sfs/${aitab_img}"
- _mnt_fs "/run/archiso/sfs/${aitab_img}/${aitab_img}.fs" "${newroot}${aitab_mnt}"
+ _mnt_fs "/run/archiso/sfs/${aitab_img}/${aitab_img}.fs" "${newroot}" "${aitab_mnt}"
else
_mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${aitab_arch}/${aitab_img}.sfs" "${newroot}${aitab_mnt}"
fi