Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rd.live.overlay.overlayfs doesn't seem to work when $DRACUT_SYSTEMD=1 #1820

Open
jdharms opened this issue May 12, 2022 · 5 comments
Open

rd.live.overlay.overlayfs doesn't seem to work when $DRACUT_SYSTEMD=1 #1820

jdharms opened this issue May 12, 2022 · 5 comments
Labels
bug Our bugs dmsquash-live Issues related to the dmsquash-live module

Comments

@jdharms
Copy link

jdharms commented May 12, 2022

Describe the bug
I'm attempting to boot into a squashfs image with an overlayfs overlay. The switch root fails, here are some relevant lines from my rdsosreport.txt:


[   36.385975] localhost systemctl[782]: Got message type=error sender=org.freedesktop.systemd1 destination=n/a path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=org.freedesktop.DBus.Error.InvalidArgs error-message=Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.

[   36.385975] localhost systemctl[782]: Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.

[   36.385975] localhost systemctl[782]: Bus n/a: changing state RUNNING → CLOSED

[   36.386080] localhost systemd[1]: Failed to process message type=method_call sender=n/a destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=SwitchRoot cookie=1 reply_cookie=0 signature=ss error-name=n/a error-message=n/a: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.

If I remove or alter the line here: https://github.com/dracutdevs/dracut/blob/master/modules.d/90dmsquash-live/dmsquash-live-root.sh#L394 to add the overlayfs even with DRACUT_SYSTEMD is not zero then my system boots exactly how I would expect it to.

Is this conditional necessary? Is systemd not doing something that dracut assumes it should do?

Distribution used
Ubuntu 22.04

Dracut version
dracut --version reports only dracut. apt info dracut reports version 051-1. Was installed via apt.

Init system
systemd

To Reproduce
My dracut.conf:

hostonly=no
hostonly_cmdline="root=live:UUID=xxxxxxx-xxxx debug mitigations=auto rd.live.debug=1 rd.live.overlay.overlayfs=1 rd.shell"
compress=xz
uefi=yes
uefi_stub=/usr/lib/...........
add_dracutmodules+=" dmsquash-live "

/LiveOS/squashfs.img is a squashfs image containing a flat ubuntu root fs.

Expected behavior
Should set up an overlayfs fs over the squashfs image

@jdharms jdharms added the bug Our bugs label May 12, 2022
@alexxy
Copy link

alexxy commented May 20, 2022

Also noticed same issue with dracut 053 using livenet, however starting

systemctl start sysroot.mount 

mounts /sysroot

@LaszloGombos
Copy link
Collaborator

LaszloGombos commented May 20, 2022

@jdharms If you do not actually need systemd in your initramfs, you can disable it and just specify the dracut modules you actually need, e.g.

dracutmodules+="dmsquash-live"

There is a PR up for review for a test case that uses this technique and it is passing (against latest upstream) - https://github.com/dracutdevs/dracut/pull/1813/files#diff-6aa993c0ff374636137737561ae60ed7e576e1891e210e322680f9662ebdef13R110

@alexxy
Copy link

alexxy commented Jun 8, 2022

Also seems like its related to systemd version. Like a issue #1822. I found old version of live image with dracut 053 and systemd 249 and it works with same setup, however systemd 250+ stopped working

@FGrose
Copy link
Contributor

FGrose commented Aug 5, 2022

@jdharms Please adjust dmsquash-live-root.sh lines 9-13 to

if getargbool 0 rd.live.debug -n -y rdlivedebug; then
    [ -z "$DRACUT_SYSTEMD" ] && exec > /run/initramfs/liveroot.$$.out 2>&1
    set -x
    export RD_DEBUG=yes
    [ "$BASH" ] && export \
        PS4='+ (${BASH_SOURCE}@${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
fi

and then report the relevant journal section or /run/initramfs/liveroot.$$.out.

(Notice that if your flat rootfs does not contain the empty directory /proc, the test at line 304
elif [ -d /run/initramfs/squashfs/proc ]; then will fail.)

@LaszloGombos LaszloGombos added the dmsquash-live Issues related to the dmsquash-live module label Feb 28, 2023
@LaszloGombos
Copy link
Collaborator

LaszloGombos commented May 20, 2023

I think this (or similar) issue can be reproduced by running test-16 with the following change in the source tree

--- a/test/TEST-16-DMSQUASH/test.sh
+++ b/test/TEST-16-DMSQUASH/test.sh
@@ -136,8 +136,8 @@ SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs3"
 EOF
 
     "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
-        --modules "test dash dmsquash-live qemu" \
+        --modules "test dash dmsquash-live qemu dracut-systemd" \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Our bugs dmsquash-live Issues related to the dmsquash-live module
Projects
None yet
Development

No branches or pull requests

4 participants