[arch-releng] [PATCH] archiso_loop_mnt - cleaner boot from loopmounted iso file

Adam Purkrt adam at purkrt.net
Sat Jul 11 19:00:34 UTC 2015

I would like to suggest the patch below, to archiso_loop_mnt hook.

Currently, when booting loopmounted iso file, it is necessary to
specify not only img_dev and img_loop (which should be sufficient),
but also archisolabel or archisodevice. With the patch, archisodevice
is directly populated with the correct loop device, and it is not
necessary to specify the label when booting from loopmounted iso,
which makes for leaner and cleaner grub.cfg.

The kernel command line in grub.cfg currently needed:

linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201507
img_dev=$imgdevpath img_loop=$isofile earlymodules=loop

after the patch:

linux (loop)/arch/boot/x86_64/vmlinuz img_dev=$imgdevpath
img_loop=$isofile earlymodules=loop

Some more comments at https://bbs.archlinux.org/viewtopic.php?id=199516

diff --git a/archiso/initcpio/hooks/archiso_loop_mnt
index 46338e5..f95a47d 100644
--- a/archiso/initcpio/hooks/archiso_loop_mnt
+++ b/archiso/initcpio/hooks/archiso_loop_mnt
@@ -18,7 +18,9 @@ archiso_loop_mount_handler () {
         echo $(readlink -f ${img_dev}) >> /run/archiso/used_block_devices

-    if ! _dev_loop=$(losetup --find --show --read-only
"/run/archiso/img_dev/${img_loop}"); then
+    if _dev_loop=$(losetup --find --show --read-only
"/run/archiso/img_dev/${img_loop}"); then
+        archisodevice="${_dev_loop}"
+    else
         echo "ERROR: Setting loopback device for file

More information about the arch-releng mailing list