Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/hooks/archiso_loop_mnt
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-01-09 20:33:35 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2012-01-11 04:44:41 -0300
commit0720ac9bd4ee82d924f6c0e568aa4477297772d1 (patch)
tree82c52c6ff5eba0d714748d8793c26248e04e89b5 /archiso/hooks/archiso_loop_mnt
parent36f327c6d45bf739587e89fa102e5beb400b6281 (diff)
[archiso] Refactor: Use losetup from util-linux
New losetup from util-linux 2.21 uses new /dev/loop-control from Linux 3.1. Needs mkinitcpio-0.8.2+ (provides modules.devname, or workaround with earlymodules=loop) Get advantages from it! Removing custom shell code. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso/hooks/archiso_loop_mnt')
-rw-r--r--archiso/hooks/archiso_loop_mnt10
1 files changed, 4 insertions, 6 deletions
diff --git a/archiso/hooks/archiso_loop_mnt b/archiso/hooks/archiso_loop_mnt
index e52dc69..664f3a5 100644
--- a/archiso/hooks/archiso_loop_mnt
+++ b/archiso/hooks/archiso_loop_mnt
@@ -10,15 +10,13 @@ run_hook () {
archiso_loop_mount_handler () {
newroot="${1}"
+ local _dev_loop
+
msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}"
_mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r"
- _dev_loop=$(losetup -f)
- if ! losetup "${_dev_loop}" "/run/archiso/img_dev/${img_loop}"; then
- echo "ERROR: Setting loopback device '${_dev_loop}'"
- echo " for file '/run/archiso/img_dev/${img_loop}'"
- echo " Falling back to interactive prompt"
- echo " You can try to fix the problem manually, log out when you are finished"
+ if ! _dev_loop=$(losetup --find --show "/run/archiso/img_dev/${img_loop}"); then
+ echo "ERROR: Setting loopback device for file '/run/archiso/img_dev/${img_loop}'"
launch_interactive_shell
fi