On Sat, 28 Jun 2025 12:59:19 +0000 Wolfgang Zarre <lxde...@zirdeon.com> wrote:
> I'll inform you as soon as I have an idea.
I had a look at it and actually I cannot reproduce root=/dev/mapper/loop.. in 
grub.cfg,
but maybe I did something wrong or I utilise a different scenario.

Anyway, the following I did which was working flawless and I could start it 
with qemu
without issues:

Test with grml-debootstrap on Debian 12:
grml-debootstrap version 0.103 with unmodified default configuration

-------------------------------
diff -Nup /usr/sbin/grml-debootstrap.orig /usr/sbin/grml-debootstrap
--- /usr/sbin/grml-debootstrap.orig     2023-02-20 11:40:07.000000000 +0100
+++ /usr/sbin/grml-debootstrap  2025-07-03 09:10:49.906989258 +0200
@@ -2014,6 +2014,7 @@ chrootscript() {
    else
      einfo "Executing chroot-script now"
      mount -t devtmpfs udev "${MNTPOINT}"/dev
+    mount -o remount,bind,ro "${MNTPOINT}"/dev
      mount -t devpts devpts "${MNTPOINT}"/dev/pts
      if [ "$DEBUG" = "true" ] ; then
        chroot "$MNTPOINT" /bin/bash -x /bin/chroot-script ; RC=$?
-------------------------------



# truncate -s 8G test-image-mbr.img
# fdisk -l test-image-mbr.img
Disk test-image-mbr.img: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x11d9d0cb

Device              Boot Start      End  Sectors Size Id Type
test-image-mbr.img1       2048 16777215 16775168   8G 83 Linux

# losetup -P -f test-image-mbr.img
# grml-debootstrap --verbose --password "Have a guess!"  --target /dev/loop0p1 
--grub /dev/loop0

Seen on console:
...
Setting up udev (252.38-1~deb12u1) ...
A chroot environment has been detected, udev not started.
fchownat() of /dev/kvm failed: Read-only file system
fchownat() of /dev/vhost-net failed: Read-only file system
fchownat() of /dev/vhost-vsock failed: Read-only file system
...

# mount /dev/loop0p1 mnt
# grep UUID mnt/boot/grub/grub.cfg
        linux   /boot/vmlinuz-6.1.0-37-amd64 
root=UUID=e6564375-8c54-4054-a538-b5a95f9627c2 ro  quiet
                linux   /boot/vmlinuz-6.1.0-37-amd64 
root=UUID=e6564375-8c54-4054-a538-b5a95f9627c2 ro  quiet
                linux   /boot/vmlinuz-6.1.0-37-amd64 
root=UUID=e6564375-8c54-4054-a538-b5a95f9627c2 ro single

# umount mnt
# losetup -D
# qemu-system-x86_64 -m 4096 -drive format=raw,file=test-image-mbr.img


Test with grml-debootstrap from master Debian 12:
grml-debootstrap master eae91811116fbc452efe45c6b80ecc647547ea1f

-------------------------------
diff --git a/grml-debootstrap b/grml-debootstrap
index 37893c6..c61e157 100755
--- a/grml-debootstrap
+++ b/grml-debootstrap
@@ -1880,6 +1880,7 @@ chrootscript() {
    else
      einfo "Executing chroot-script now"
      mount -t devtmpfs udev "${MNTPOINT}"/dev
+    mount -o remount,bind,ro "${MNTPOINT}"/dev
      mount -t devpts devpts "${MNTPOINT}"/dev/pts
      if [ "$DEBUG" = "true" ] ; then
        clean_chroot "$MNTPOINT" /bin/bash -x /bin/chroot-script
-------------------------------

# losetup -P -f test-image-mbr.img
# grml-debootstrap --verbose --password "Have a guess!"  --target /dev/loop0p1 
--grub /dev/loop0

No message on console!

# mount /dev/loop0p1 mnt
# grep UUID mnt/boot/grub/grub.cfg
        linux   /boot/vmlinuz-6.12.33+deb13-amd64 
root=UUID=965be905-fb3e-40e3-a738-47e6519b7f50 ro  quiet
                linux   /boot/vmlinuz-6.12.33+deb13-amd64 
root=UUID=965be905-fb3e-40e3-a738-47e6519b7f50 ro  quiet
                linux   /boot/vmlinuz-6.12.33+deb13-amd64 
root=UUID=965be905-fb3e-40e3-a738-47e6519b7f50 ro single 
dis_ucode_ldr

# umount mnt
# losetup -D
# qemu-system-x86_64 -m 4096 -drive format=raw,file=test-image-mbr.img

Obviously, this will not cover every scenario, e.g. efi configuration or 
others, so
please could you let me know which scenario would cause the 
root=/dev/mapper/loop.. issue.


Cheers,
Wolf

Reply via email to