From 0cee1b956b2e64cca0f85bf5e3ca85916498365a Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Thu, 5 Jan 2012 17:58:12 -0300 Subject: [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 --- archiso/hooks/archiso | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'archiso/hooks') 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 -- cgit v1.2.3-70-g09d2