[archiso] Setup ro loop devs as read-only

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
Gerardo Exequiel Pozzi 2012-02-22 19:26:49 -03:00
parent 9703564262
commit e6c885d29f
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ _mnt_fs() {
local dm_snap_name="${dm_snap_prefix}_${img_name}" local dm_snap_name="${dm_snap_prefix}_${img_name}"
local ro_dev ro_dev_size rw_dev local ro_dev ro_dev_size rw_dev
ro_dev=$(losetup --find --show "${img}") ro_dev=$(losetup --find --show --read-only "${img}")
ro_dev_size=$(blockdev --getsz ${ro_dev}) ro_dev_size=$(blockdev --getsz ${ro_dev})
if [[ "${cow_persistent}" == "P" ]]; then if [[ "${cow_persistent}" == "P" ]]; then

View File

@ -15,7 +15,7 @@ archiso_loop_mount_handler () {
msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}" msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}"
_mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" _mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then if ! _dev_loop=$(losetup --find --show --read-only "/run/archiso/img_dev/${img_loop}"); then
echo "ERROR: Setting loopback device for file '/run/archiso/img_dev/${img_loop}'" echo "ERROR: Setting loopback device for file '/run/archiso/img_dev/${img_loop}'"
launch_interactive_shell launch_interactive_shell
fi fi