23.04: desktop iso peculiarity compared to the live-server one

Adam Vodopjan adam.vodopjan at gmail.com
Thu Jun 22 22:23:28 UTC 2023


Since live-server 21.10 the squashes under casper/ are organized a new way and
there is conf/conf.d/default-layer.conf in initrd with content like this:

    LAYERFS_PATH=ubuntu-server-minimal.ubuntu-server.installer.generic.squashfs

Since 23.04 the desktop iso uses the same way to organize the squashes as
live-server does but there is no conf/conf.d/default-layer.conf in its initrd,
the layer is explicitly set in grub conf:

    linux /casper/vmlinuz layerfs-path=minimal.standard.live.squashfs ..

The problem in my case is it breaks a very generic way to loop-boot ubuntu
desktop and live-server isos. Grub conf example:

    menuitem ubuntu-xx.yy-zzzz-amd64.iso {
        set iso_path="/path/ubuntu-xx.yy-zzzz-amd64.iso"

        loopback loop "$iso_path"
        linux (loop)/casper/vmlinuz* boot=casper iso-scan/filename="$iso_path"
        initrd (loop)/casper/initrd*    
    }

For desktop isos it works since at least 12.04. But 23.04 (and 23.10 daily)
cant boot into the live environment with just that because there is no correct
'layerfs-path=..' piece. It boots into this https://imgur.com/C5NQPpX

Looking into casper:setup_overlay() function I see there are two ways to deal
with squashes. When LAYERFS_PATH ('layerfs-path=..' translates to it) is not
set, it mounts ALL the squashes under casper/ and makes the root out of ALL
those overlayed in reversed lexical order. So what I end up with booting
without layerfs-path set is this bunch of squashes overlayed as root (the order
is preserved):

    minimal.zh.squashfs
    minimal.standard.zh.squashfs
    minimal.standard.squashfs
    minimal.standard.ru.squashfs
    minimal.standard.pt.squashfs
    minimal.standard.no-languages.squashfs
    minimal.standard.live.squashfs
    minimal.standard.it.squashfs
    minimal.standard.fr.squashfs
    minimal.standard.es.squashfs
    minimal.standard.en.squashfs
    minimal.standard.de.squashfs
    minimal.squashfs
    minimal.ru.squashfs
    minimal.pt.squashfs
    minimal.no-languages.squashfs
    minimal.it.squashfs
    minimal.fr.squashfs
    minimal.es.squashfs
    minimal.en.squashfs
    minimal.de.squashfs

To see it yourself, boot the iso in a vm, press 'e' on the default grub entry
to edit it, replace the 'layerfs-path=..' piece with 'break=casper-bottom' and
press C-x to continue. If would end up in a shell were you can run 'mount' to
witness 21 loop mounts for all the squashes along with the massive root overlay
mount.

If only the default layer was set in the initrd the same way as in the
live-server case, it would work.

THE QUESTION I WANTED TO ASK, is: was it intentional to not set the default
layer in initrd in the desktop iso case?




More information about the Ubuntu-devel-discuss mailing list