[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>
This commit is contained in:
Gerardo Exequiel Pozzi 2012-01-05 17:58:12 -03:00
parent 197cf4327a
commit 2b211a9017

View File

@ -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