desultory / ugrd

A minimalistic initramfs generator, designed for FDE
GNU General Public License v2.0
37 stars 13 forks source link

Plymouth module gives error #24

Open Lik-the-Fluffin opened 4 months ago

Lik-the-Fluffin commented 4 months ago

ugrd 1.14.3 My config

ValueError: [devpts] No source type found in mount

/dev/pts is mounted

sys-boot/plymouth and sys-boot/plymouth-openrc-plugin are installed

desultory commented 4 months ago

I was never able to get the plymouth module working, I think the "quiet" arg may be required in the kernel command line.

desultory commented 4 months ago

I'm not entirely sure when each device has to be mounted, but I was never able to get more than a black screen where I can't use bash while testing.

A critical thing that is missing is some method to hook plymouth up to cryptsetup. At the moment, the cryptsetup module can only get interactive input from the command line. I'm not sure, but I think some kind of wrapper will have to be added to make it work with plymouth.

Lik-the-Fluffin commented 4 months ago

In mkinitcpio "plymouth ask-for-password" is used. Solar theme has password prompt menu. Make quicktest: # plymouthd; plymouth --show-splash; plymouth ask-for-password; sleep 5; killall plymouthd In a tty it waits indefinitely until password is written, then password is passed to the tty

desultory commented 4 months ago

So far, I have not been able to get plymouth to show anything, I haven't tested in quite a while. I think you may need to add "splash" and "quiet" to the linkux kernel commandline for plymouth to even have a chance at running. It's difficult to do that and debug things, because I have never been able to get plymouth to properly start from a bash shell.

If you pull in the debug module and start_shell is enabled, it should give you a bash prompt near the start of the initrd runtime, you can use this to test things pretty easily. If you need to pull more tools you can add them to the "binaries" list

Lik-the-Fluffin commented 4 months ago

Is there intended way to change keyboard layout in debug shell? I can barely write in qwerty, and didn't found any working methods to change layout even in dracut

desultory commented 4 months ago

Is there intended way to change keyboard layout in debug shell? I can barely write in qwerty, and didn't found any working methods to change layout even in dracut

you can use the keymap module, you just need to specify the keymap path in the config.

desultory commented 4 months ago

https://github.com/desultory/ugrd/blob/main/src/ugrd/base/keymap.toml

I don't think it's currently documented, but you just load that module (ugrd.base.keymap) and then specify a keymap_file in your configg

Lik-the-Fluffin commented 4 months ago

I made it (somewhat) work! my config Most important part:

binaries = ['plymouthd', 'plymouth', 'plymouth-set-default-theme', 'udevadm', 'nano', 'cat', 'killall', 'less', 'sed', 'echo', 'awk', 'grep']
paths = ['/run/plymouth']
dependencies = ['/usr/share/plymouth/themes/solar/box.png', '/usr/share/plymouth/themes/solar/bullet.png', '/usr/share/plymouth/themes/solar/entry.png', '/usr/share/plymouth/themes/solar/lock.png', '/usr/share/plymouth/themes/solar/progress_bar.png', '/usr/share/plymouth/themes/solar/solar.plymouth', '/usr/share/plymouth/themes/solar/star.png', '/etc/plymouth/plymouthd.conf', '/ply', '/usr/lib64/plymouth/details.la', '/usr/lib64/plymouth/details.so', '/usr/lib64/plymouth/fade-throbber.la', '/usr/lib64/plymouth/fade-throbber.so', '/usr/lib64/plymouth/label.la', '/usr/lib64/plymouth/label.so', '/usr/lib64/plymouth/script.la', '/usr/lib64/plymouth/script.so', '/usr/lib64/plymouth/space-flares.la', '/usr/lib64/plymouth/space-flares.so', '/usr/lib64/plymouth/text.la', '/usr/lib64/plymouth/text.so', '/usr/lib64/plymouth/tribar.la', '/usr/lib64/plymouth/tribar.so', '/usr/lib64/plymouth/two-step.la', '/usr/lib64/plymouth/two-step.so', '/usr/share/plymouth/themes/text/text.plymouth', '/usr/share/plymouth/themes/details/details.plymouth', '/usr/share/plymouth/plymouthd.defaults', '/usr/lib64/plymouth/renderers/drm.la', '/usr/lib64/plymouth/renderers/drm.so', '/usr/lib64/plymouth/renderers/frame-buffer.la', '/usr/lib64/plymouth/renderers/frame-buffer.so', '/usr/share/plymouth/themes/spinner/animation-0001.png', '/usr/share/plymouth/themes/spinner/animation-0002.png', '/usr/share/plymouth/themes/spinner/animation-0003.png', '/usr/share/plymouth/themes/spinner/animation-0004.png', '/usr/share/plymouth/themes/spinner/animation-0005.png', '/usr/share/plymouth/themes/spinner/animation-0006.png', '/usr/share/plymouth/themes/spinner/animation-0007.png', '/usr/share/plymouth/themes/spinner/animation-0008.png', '/usr/share/plymouth/themes/spinner/animation-0009.png', '/usr/share/plymouth/themes/spinner/animation-0010.png', '/usr/share/plymouth/themes/spinner/animation-0011.png', '/usr/share/plymouth/themes/spinner/animation-0012.png', '/usr/share/plymouth/themes/spinner/animation-0013.png', '/usr/share/plymouth/themes/spinner/animation-0014.png', '/usr/share/plymouth/themes/spinner/animation-0015.png', '/usr/share/plymouth/themes/spinner/animation-0016.png', '/usr/share/plymouth/themes/spinner/animation-0017.png', '/usr/share/plymouth/themes/spinner/animation-0018.png', '/usr/share/plymouth/themes/spinner/animation-0019.png', '/usr/share/plymouth/themes/spinner/animation-0020.png', '/usr/share/plymouth/themes/spinner/animation-0021.png', '/usr/share/plymouth/themes/spinner/animation-0022.png', '/usr/share/plymouth/themes/spinner/animation-0023.png', '/usr/share/plymouth/themes/spinner/animation-0024.png', '/usr/share/plymouth/themes/spinner/animation-0025.png', '/usr/share/plymouth/themes/spinner/animation-0026.png', '/usr/share/plymouth/themes/spinner/animation-0027.png', '/usr/share/plymouth/themes/spinner/animation-0028.png', '/usr/share/plymouth/themes/spinner/animation-0029.png', '/usr/share/plymouth/themes/spinner/animation-0030.png', '/usr/share/plymouth/themes/spinner/animation-0031.png', '/usr/share/plymouth/themes/spinner/animation-0032.png', '/usr/share/plymouth/themes/spinner/animation-0033.png', '/usr/share/plymouth/themes/spinner/animation-0034.png', '/usr/share/plymouth/themes/spinner/animation-0035.png', '/usr/share/plymouth/themes/spinner/animation-0036.png', '/usr/share/plymouth/themes/spinner/bullet.png', '/usr/share/plymouth/themes/spinner/capslock.png', '/usr/share/plymouth/themes/spinner/entry.png', '/usr/share/plymouth/themes/spinner/keyboard.png', '/usr/share/plymouth/themes/spinner/keymap-render.png', '/usr/share/plymouth/themes/spinner/lock.png', '/usr/share/plymouth/themes/spinner/spinner.plymouth', '/usr/share/plymouth/themes/spinner/throbber-0001.png', '/usr/share/plymouth/themes/spinner/throbber-0002.png', '/usr/share/plymouth/themes/spinner/throbber-0003.png', '/usr/share/plymouth/themes/spinner/throbber-0004.png', '/usr/share/plymouth/themes/spinner/throbber-0005.png', '/usr/share/plymouth/themes/spinner/throbber-0006.png', '/usr/share/plymouth/themes/spinner/throbber-0007.png', '/usr/share/plymouth/themes/spinner/throbber-0008.png', '/usr/share/plymouth/themes/spinner/throbber-0009.png', '/usr/share/plymouth/themes/spinner/throbber-0010.png', '/usr/share/plymouth/themes/spinner/throbber-0011.png', '/usr/share/plymouth/themes/spinner/throbber-0012.png', '/usr/share/plymouth/themes/spinner/throbber-0013.png', '/usr/share/plymouth/themes/spinner/throbber-0014.png', '/usr/share/plymouth/themes/spinner/throbber-0015.png', '/usr/share/plymouth/themes/spinner/throbber-0016.png', '/usr/share/plymouth/themes/spinner/throbber-0017.png', '/usr/share/plymouth/themes/spinner/throbber-0018.png', '/usr/share/plymouth/themes/spinner/throbber-0019.png', '/usr/share/plymouth/themes/spinner/throbber-0020.png', '/usr/share/plymouth/themes/spinner/throbber-0021.png', '/usr/share/plymouth/themes/spinner/throbber-0022.png', '/usr/share/plymouth/themes/spinner/throbber-0023.png', '/usr/share/plymouth/themes/spinner/throbber-0024.png', '/usr/share/plymouth/themes/spinner/throbber-0025.png', '/usr/share/plymouth/themes/spinner/throbber-0026.png', '/usr/share/plymouth/themes/spinner/throbber-0027.png', '/usr/share/plymouth/themes/spinner/throbber-0028.png', '/usr/share/plymouth/themes/spinner/throbber-0029.png', '/usr/share/plymouth/themes/spinner/throbber-0030.png']

I disabled ugrd.base.plymouth and made everything manually.

to start it you need to execute '/ply' file, it has a simple script:

  mkdir -m 0755 /run/plymouth
  mkdir -m755 -p /dev/pts
  mount -t devpts devpts /dev/pts -o nosuid,noexec,gid=5,mode=620
  plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session
  plymouth show-splash

Mostly I just copied from arch package and dracut

It gave me static image of standard theme static

Lik-the-Fluffin commented 4 months ago

Also plymouth correctly executed during shutdown and I saw animation

desultory commented 4 months ago

I made it (somewhat) work! my config Most important part:

binaries = ['plymouthd', 'plymouth', 'plymouth-set-default-theme', 'udevadm', 'nano', 'cat', 'killall', 'less', 'sed', 'echo', 'awk', 'grep']
paths = ['/run/plymouth']
dependencies = ['/usr/share/plymouth/themes/solar/box.png', '/usr/share/plymouth/themes/solar/bullet.png', '/usr/share/plymouth/themes/solar/entry.png', '/usr/share/plymouth/themes/solar/lock.png', '/usr/share/plymouth/themes/solar/progress_bar.png', '/usr/share/plymouth/themes/solar/solar.plymouth', '/usr/share/plymouth/themes/solar/star.png', '/etc/plymouth/plymouthd.conf', '/ply', '/usr/lib64/plymouth/details.la', '/usr/lib64/plymouth/details.so', '/usr/lib64/plymouth/fade-throbber.la', '/usr/lib64/plymouth/fade-throbber.so', '/usr/lib64/plymouth/label.la', '/usr/lib64/plymouth/label.so', '/usr/lib64/plymouth/script.la', '/usr/lib64/plymouth/script.so', '/usr/lib64/plymouth/space-flares.la', '/usr/lib64/plymouth/space-flares.so', '/usr/lib64/plymouth/text.la', '/usr/lib64/plymouth/text.so', '/usr/lib64/plymouth/tribar.la', '/usr/lib64/plymouth/tribar.so', '/usr/lib64/plymouth/two-step.la', '/usr/lib64/plymouth/two-step.so', '/usr/share/plymouth/themes/text/text.plymouth', '/usr/share/plymouth/themes/details/details.plymouth', '/usr/share/plymouth/plymouthd.defaults', '/usr/lib64/plymouth/renderers/drm.la', '/usr/lib64/plymouth/renderers/drm.so', '/usr/lib64/plymouth/renderers/frame-buffer.la', '/usr/lib64/plymouth/renderers/frame-buffer.so', '/usr/share/plymouth/themes/spinner/animation-0001.png', '/usr/share/plymouth/themes/spinner/animation-0002.png', '/usr/share/plymouth/themes/spinner/animation-0003.png', '/usr/share/plymouth/themes/spinner/animation-0004.png', '/usr/share/plymouth/themes/spinner/animation-0005.png', '/usr/share/plymouth/themes/spinner/animation-0006.png', '/usr/share/plymouth/themes/spinner/animation-0007.png', '/usr/share/plymouth/themes/spinner/animation-0008.png', '/usr/share/plymouth/themes/spinner/animation-0009.png', '/usr/share/plymouth/themes/spinner/animation-0010.png', '/usr/share/plymouth/themes/spinner/animation-0011.png', '/usr/share/plymouth/themes/spinner/animation-0012.png', '/usr/share/plymouth/themes/spinner/animation-0013.png', '/usr/share/plymouth/themes/spinner/animation-0014.png', '/usr/share/plymouth/themes/spinner/animation-0015.png', '/usr/share/plymouth/themes/spinner/animation-0016.png', '/usr/share/plymouth/themes/spinner/animation-0017.png', '/usr/share/plymouth/themes/spinner/animation-0018.png', '/usr/share/plymouth/themes/spinner/animation-0019.png', '/usr/share/plymouth/themes/spinner/animation-0020.png', '/usr/share/plymouth/themes/spinner/animation-0021.png', '/usr/share/plymouth/themes/spinner/animation-0022.png', '/usr/share/plymouth/themes/spinner/animation-0023.png', '/usr/share/plymouth/themes/spinner/animation-0024.png', '/usr/share/plymouth/themes/spinner/animation-0025.png', '/usr/share/plymouth/themes/spinner/animation-0026.png', '/usr/share/plymouth/themes/spinner/animation-0027.png', '/usr/share/plymouth/themes/spinner/animation-0028.png', '/usr/share/plymouth/themes/spinner/animation-0029.png', '/usr/share/plymouth/themes/spinner/animation-0030.png', '/usr/share/plymouth/themes/spinner/animation-0031.png', '/usr/share/plymouth/themes/spinner/animation-0032.png', '/usr/share/plymouth/themes/spinner/animation-0033.png', '/usr/share/plymouth/themes/spinner/animation-0034.png', '/usr/share/plymouth/themes/spinner/animation-0035.png', '/usr/share/plymouth/themes/spinner/animation-0036.png', '/usr/share/plymouth/themes/spinner/bullet.png', '/usr/share/plymouth/themes/spinner/capslock.png', '/usr/share/plymouth/themes/spinner/entry.png', '/usr/share/plymouth/themes/spinner/keyboard.png', '/usr/share/plymouth/themes/spinner/keymap-render.png', '/usr/share/plymouth/themes/spinner/lock.png', '/usr/share/plymouth/themes/spinner/spinner.plymouth', '/usr/share/plymouth/themes/spinner/throbber-0001.png', '/usr/share/plymouth/themes/spinner/throbber-0002.png', '/usr/share/plymouth/themes/spinner/throbber-0003.png', '/usr/share/plymouth/themes/spinner/throbber-0004.png', '/usr/share/plymouth/themes/spinner/throbber-0005.png', '/usr/share/plymouth/themes/spinner/throbber-0006.png', '/usr/share/plymouth/themes/spinner/throbber-0007.png', '/usr/share/plymouth/themes/spinner/throbber-0008.png', '/usr/share/plymouth/themes/spinner/throbber-0009.png', '/usr/share/plymouth/themes/spinner/throbber-0010.png', '/usr/share/plymouth/themes/spinner/throbber-0011.png', '/usr/share/plymouth/themes/spinner/throbber-0012.png', '/usr/share/plymouth/themes/spinner/throbber-0013.png', '/usr/share/plymouth/themes/spinner/throbber-0014.png', '/usr/share/plymouth/themes/spinner/throbber-0015.png', '/usr/share/plymouth/themes/spinner/throbber-0016.png', '/usr/share/plymouth/themes/spinner/throbber-0017.png', '/usr/share/plymouth/themes/spinner/throbber-0018.png', '/usr/share/plymouth/themes/spinner/throbber-0019.png', '/usr/share/plymouth/themes/spinner/throbber-0020.png', '/usr/share/plymouth/themes/spinner/throbber-0021.png', '/usr/share/plymouth/themes/spinner/throbber-0022.png', '/usr/share/plymouth/themes/spinner/throbber-0023.png', '/usr/share/plymouth/themes/spinner/throbber-0024.png', '/usr/share/plymouth/themes/spinner/throbber-0025.png', '/usr/share/plymouth/themes/spinner/throbber-0026.png', '/usr/share/plymouth/themes/spinner/throbber-0027.png', '/usr/share/plymouth/themes/spinner/throbber-0028.png', '/usr/share/plymouth/themes/spinner/throbber-0029.png', '/usr/share/plymouth/themes/spinner/throbber-0030.png']

I disabled ugrd.base.plymouth and made everything manually.

to start it you need to execute '/ply' file, it has a simple script:

  mkdir -m 0755 /run/plymouth
  mkdir -m755 -p /dev/pts
  mount -t devpts devpts /dev/pts -o nosuid,noexec,gid=5,mode=620
  plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session
  plymouth show-splash

Mostly I just copied from arch package and dracut

It gave me static image of standard theme static

what did you have to set in your kernel command line?

If you want to help, you can more or less override the config in the existing plymouth module with what works. I think that udevadm bit may not be required, or may not function since no other udev things are pulled.

If you want to make the script output bash lines, you more or less just need to define a python function which returns a list of bash lines, and then you define an import in the toml, the key is the init runlevel, so the bash runs at the right time.

Lik-the-Fluffin commented 4 months ago

what did you have to set in your kernel command line?

root=/dev/mapper/root rootflags=subvol=@root quiet splash

desultory commented 4 months ago

concerning all of those dependencies, you could make a "build_pre" function which iterates over files in a directory and adds them to the dependencies list, that way you don't need to manually define them.

You could also add a theme processor that adds them based on the theme that is selected. As long as the function puts the files in the dependencies list before build_tasks is run, it should be added to the image

desultory commented 4 months ago

what did you have to set in your kernel command line?

root=/dev/mapper/root rootflags=subvol=@root quiet splash

would you mind testing without the splash option? I'm wondering what is required. The tricky bit here is that UGRD doesn't control the kernel command line parameters, and i think splash may have to be set explicitly otherwise plymouth won't function at all. I never set splash in my testing before which is probably why it never worked.

And for what it's worth, you shouldn't need to specify the root or rootflags with ugrd, by default it will add these parameters to the image, and will use them as a backup if the provided parameters don't work, or are not specified.

Lik-the-Fluffin commented 4 months ago

I'm not sure how can I set my cmdline now.

efibootmgr Boot01FF* UMC /EFI/Linux/gentoo-6.6.35-gentoo-dist.efi on 04A4-FD69 HD(2,GPT,bf7c7c30-f664-47a3-bd6f-9d9da25ad6cc,0x39d86800,0x5ff800)/File(\EFI\Linux\gentoo-6.6.35-gentoo-dist.efi) root=/dev/mapper/root rootflags=subvol=@root quiet loglevel=5

/etc/kernel/cmdline root=/dev/mapper/root rootflags=subvol=@root quiet loglevel=5 /etc/kernel/uefi-mkconfig root=/dev/mapper/root rootflags=subvol=@root quiet loglevel=5

but after emerge --config and reboot I still have root=/dev/mapper/root rootflags=subvol=@root quiet splash

Fully reinstalling kernel didn't help too

desultory commented 4 months ago

if that is your entire cmdline, it doesn't seem like it's even using ugrd, unless you're using a uki. I think UKIs can have their own embedded cmdline, and can definitely have their own initramfs. There is no harm in having those extra root/subvol definitions. It would be helpful to know what is setting the command line definitively in your setup.

Lik-the-Fluffin commented 4 months ago

result of kernel --config

In installkernel config /etc/kernel/install.conf

layout=uki
initrd_generator=ugrd
uki_generator=ukify

ukify is using /etc/kernel/cmdline

 * Calling ukify with arguments: build --linux=/usr/src/linux-6.6.35-gentoo-dist/arch/x86/boot/bzImage --uname=6.6.35-gentoo-dist --output=/usr/src/linux-6.6.35-gentoo-dist/arch/x86/boot/uki.efi --initrd=/boot/amd-uc.img --initrd=/usr/src/linux-6.6.35-gentoo-dist/arch/x86/boot/initrd --cmdline=@/etc/kernel/cmdline
Host arch 'x86_64', EFI arch 'x64'

uefi-mkconfig using /etc/kernel/uefi-mkconfig

Running /usr/lib/kernel/postinst.d/95-efistub-uefi-mkconfig.install 6.6.35-gentoo-dist /efi/EFI/Linux/gentoo-6.6.35-gentoo-dist.efi...

 * Updating UEFI configuration...
 * Running uefi-mkconfig...
 * Using kernel commands from "/etc/kernel/uefi-mkconfig"
 * Creating UEFI entry "0200" for "/efi/EFI/Linux/gentoo-6.6.35-gentoo-dist-old.efi" found on "nvme0n1p2"
 * No initramfs found for "/efi/EFI/Linux/gentoo-6.6.35-gentoo-dist-old.efi".
 * Creating UEFI entry "01FF" for "/efi/EFI/Linux/gentoo-6.6.35-gentoo-dist.efi" found on "nvme0n1p2"
 * No initramfs found for "/efi/EFI/Linux/gentoo-6.6.35-gentoo-dist.efi".
 * Done

both files have quiet loglevel=5

With dracut, uefi-mkconfig controlled cmdline. I made full search in /etc and /usr and no file has quiet splash line. Maybe something is using /proc/cmdline to set cmdline for initramfs

Lik-the-Fluffin commented 4 months ago

I extracted initrd from uki and unpacked it. /proc/cmdline is a file inside initramfs and it has quiet splash line, so maybe info from efi entry is not even used

Lik-the-Fluffin commented 4 months ago

I extracted initrd from uki and unpacked it. /proc/cmdline is a file inside initramfs and it has quiet splash line, so maybe info from efi entry is not even used

OK I was half wrong, initramfs has /proc/cmdline file, but then proc pseudo fs is mounted over /proc and I changing this file in initrd wont do anything.

There is no file on my entire filesystem that contains quiet splash, I searched everywhere. Something must read it from my /proc/cmdline at runtime

Lik-the-Fluffin commented 4 months ago

I extracted every file from uki, made tar with them

cmdline file has quiet loglevel=5

but ./rodata ./linux ./data ./text files are binary, so maybe one of them contains cmdline

desultory commented 4 months ago

With dracut, uefi-mkconfig controlled cmdline. I made full search in /etc and /usr and no file has quiet splash line. Maybe something is using /proc/cmdline to set cmdline for initramfs

Many tools have a habit of defaulting to this if no cmdline was specified. I think until recently, uefk-mkconfig did this.

I extracted initrd from uki and unpacked it. /proc/cmdline is a file inside initramfs and it has quiet splash line, so maybe info from efi entry is not even used

Interesting, generally at runtime /proc has a procfs mounted to it, so I'm not sure what would read this file, as it ends up containing the passed command line once the system is running.

I extracted initrd from uki and unpacked it. /proc/cmdline is a file inside initramfs and it has quiet splash line, so maybe info from efi entry is not even used

OK I was half wrong, initramfs has /proc/cmdline file, but then proc pseudo fs is mounted over /proc and I changing this file in initrd wont do anything.

There is no file on my entire filesystem that contains quiet splash, I searched everywhere. Something must read it from my /proc/cmdline at runtime

yeah exactly this, I'd be a bit surprised if some mechanism read this, maybe as part of the efi stub loader? It doesn't seem impossible, just strange.

I extracted every file from uki, made tar with them

cmdline file has quiet loglevel=5

but ./rodata ./linux ./data ./text files are binary, so maybe one of them contains cmdline

If you're interested in going down this rabbit hole, i recommend reading the UKI spec: https://uapi-group.org/specifications/specs/unified_kernel_image/

Currently UGRD doesn't really handle UKI stuff because an initramfs is more of a UKI component than anything. The other reason is because afaik the only ways to make a UKI are to use ukify or objcopy stuff manually, and I don't think it makes sense to add those deps to the initramfs generator, when they can be used by installkernel if they are installed on the system. This stuff is already handled by installkernel, and I think that makes the most sense.

Lik-the-Fluffin commented 4 months ago

Somehow enabling secure boot fixed my issue and now I boot with my cmdline.

I think you may need to add "splash" and "quiet"

splash is essential to start plymouth, without it I got stuck at the debug shell

quiet is only needed to hide boot logs from people with chronic terminal fear. Plymouth start normal with or without that option

desultory commented 4 months ago

Somehow enabling secure boot fixed my issue and now I boot with my cmdline.

I think you may need to add "splash" and "quiet"

splash is essential to start plymouth, without it I got stuck at the debug shell

quiet is only needed to hide boot logs from people with chronic terminal fear. Plymouth start normal with or without that option

interesting, i thought both were required. I put a good bit of effort into making the quiet function work properly to try to stage this change lol.

https://wiki.ubuntu.com/Plymouth#Checking_Plymouth_Can_Run_in_the_Initramfs I see here it recommend both, im also not sure what that "--kernel-command-line" bit does. since i don't think it has any way of changing what the kernel is using, and it makes sense the kernel must have the splash option for this to work. I think i recall hearing that any cmdline output to the tty device plymouth uses (where it goes by default) may upset plymouth and break it.

I don't even see splash listed here: https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html which is weird.

Lik-the-Fluffin commented 4 months ago

not sure what that "--kernel-command-line" bit does.

I tested it: I disabled quiet and splash in my cmdline then added this parameter: plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session --kernel-command-line="quiet splash" plymouth started without errors

plymouthd --help
  --kernel-command-line=<string>    Fake kernel command line to use

So there are two ways to make plymouth work: add splash to cmdline or use --kernel-command-line="splash"

desultory commented 4 months ago

not sure what that "--kernel-command-line" bit does.

I tested it: I disabled quiet and splash in my cmdline then added this parameter: plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session --kernel-command-line="quiet splash" plymouth started without errors

plymouthd --help
  --kernel-command-line=<string>    Fake kernel command line to use

So there are two ways to make plymouth work: add splash to cmdline or use --kernel-command-line="splash"

It may make sense for the plymouth module to do nothing but attempt to start it, maybe having some safe method to fail and use the TTY. It may make sense to have a "force" option in ugrd that adds the kernel command line bit, so it doesn't need to be specified in the actual cmdline. It may be worth warning about this at runtime so users know it must be specified in the kernel command line, or forced.

I'm mostly considering how bad it would be if enabling the module always forced it, and if there was some issue at boot time, I think it's essential that including the plymouth module doesn't really risk totally breaking the boot process.

Lik-the-Fluffin commented 4 months ago

I wrote basic plymouth module, it is able to start at boot time https://github.com/Lik-the-Fluffin/ugrd

desultory commented 4 months ago

I wrote basic plymouth module, it is able to start at boot time https://github.com/Lik-the-Fluffin/ugrd

Most of that looks good, but I have a few concerns. Currently, the system attempts to validate the created CPIO by checking against entries in the dependencies/copy vars. If the copy function pulls a whole dir, then validation won't confirm every desired file was pulled in. It may make sense to add some macro to populate the dependencies/copies dicts recursively, but this can generally be done by going through directories within the module, as most of the time it's not as simple as pulling every file, and you may want files of a certain type only.

https://github.com/desultory/ugrd/compare/main...Lik-the-Fluffin:ugrd:main#diff-5041eb743a6df5f62a43256225830dcc1d7dd89606595d0664b29422435cebdeR10 I like your idea of validating this, but this should probably be a separate "_validate" function with the "@contains('validate')" decorator on it so it only runs when validation is enabled. You could also just make it always check but make it warn instead of raise an exception if validation is disabled. It may be nice to have an option to bake those parameters into the plymouth run args so the cmdline doesn't need to be checked. I have mixed feelings about reading cmdline settings from system config files, the thing is you can't be certain uefi-mkconfig was used even if it's installed, it may be worth warning the user that cmdline settings must be verified by the user, unless they are forced as a plymouth arg.

desultory commented 4 months ago

https://github.com/desultory/ugrd/compare/main...Lik-the-Fluffin:ugrd:main#diff-5041eb743a6df5f62a43256225830dcc1d7dd89606595d0664b29422435cebdeR22 this bit could also be streamlined into the framework a bit by making it define a mountpoint, i think default mounts should be run after it does an inital mount of /dev /proc /sys /run, etc. You just have to be sure that the plymouth init bit runs after that.

desultory commented 4 months ago

https://github.com/desultory/ugrd/compare/main...Lik-the-Fluffin:ugrd:main#diff-5041eb743a6df5f62a43256225830dcc1d7dd89606595d0664b29422435cebdeR16

im working on testing this stuff.

I think it may make sense to try to parse the config file it finds, and if that doesn't work, it can pull the default config. Just checking it exists isn't enough because the distro installed config is empty.

I'm updating ugrd a bit to help make the mounting more sensible, this should work:

[mounts.devpts]
type = "devpts"
destination = "/dev/pts"
options = ['nosuid', 'noexec', 'gid=5', 'mode=0620']
path = "/dev/pts"
remake_mountpoint = true
no_validate = true

It will warn about it not being validated but that's ok, I also need to add the devpts "type"

desultory commented 1 month ago

I've added plymouth support.

I'm not sure if the cryptsetup key prompts could be improved, right now it internally handles a different control flow based on whether or not pylmouth has been internally marked as started. It could be error prone.

The main issue is that plymouth seems to wait until the device timeout has complteted before using an efi console. By default, ugrd masks video drivers so this timeout must always complete before anything is visually shown. As far as I can tell, it still passes input to the script, so keys can be entered blind, but this isn't ideal.