summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-01-05 17:58:12 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-01-05 17:58:12 -0300
commit2b211a90172374607c901064ce155f32b1a14fec (patch)
tree9d9d6fc9cff674d8d34c458b6d9ce14f54a4a198
parent197cf4327aa20f74eb4d63b3185aee38363026be (diff)
downloadarchiso32-2b211a90172374607c901064ce155f32b1a14fec.tar.xz
[archiso] Make fstab from initramfs
This is needed for initscripts 2012.01, at least the entry for /. Otherwise / is remounted ro, but not remounted rw later. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
-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