I am looking into using Dracut to create an initrd that can boot and transition to a squash filesystem that is pre-stored on the same iso media where the system is booted from.
However, dracut is unable to correctly mount the squashfs and consequently fails to find the rootfs.
Following the instructions in the section "Booting live images", it indicates I can store my OS as a squashfs on the ISO media (at least that is my understanding).
My grub kernel parameters are:
set wrapperUUID=f0a152c9-5201-4d54-98ba-f3316270ba59
linux /boot/vmlinuz \
overlay-size=70% \
debug=7 \
console=tty0 \
apparmor=0 \
rootdelay=5 \
root=live:UUID=$wrapperUUID \
rd.shell \
rd.debug \
iso-scan/filename=artifacts/squashfs.img \
rd.live.image \
rd.live.debug=1 \
rd.live.ram=1 \
rd.live.dir=LiveOS \
rd.live.squashimg=squashfs.img \
rd.writable.fsimg=1
The flow is like this (from experimenting with raw file systems):
- dracut looks for
iso-scan/filename
and when found it will create a loop device using it. In my case, it does find my squash file system, and create a loop device successfully. - dracut will then look for the Label/UUID/PartLabel I've specified through the root=live:UUID:xyz. This is where it fails since there's really no UUID/label associated with the squashfs.
From reading online, it looks like squshfs indeed does not support labels/uuid/partuiids:
- https://github.com/plougher/squashfs-tools/pull/264
- https://github.com/plougher/squashfs-tools/issues/59
Note that I have verified that if I create the iso-scan/filename image using ext4, dracut can find it using its UUID and I can proceed through the live image scenario successfully.
My questions:
- In a dracut live image setup, can I have a squash filesystem image directly on the ISO media? (would like to avoid the wrapping in an ext4 or an iso file systems)
- If so, how can I get dracut to work around the inability to search by UUID/labels/etc?