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

systemd-boot cmdline single #18456

Closed
Kunzol opened this issue Feb 3, 2021 · 3 comments
Closed

systemd-boot cmdline single #18456

Kunzol opened this issue Feb 3, 2021 · 3 comments

Comments

@Kunzol
Copy link

Kunzol commented Feb 3, 2021

systemd version the issue has been seen with

seen in 241-7, but the code says the problem is in newer versions, too

Used distribution

Debian 10 Buster

Linux kernel version used (uname -a)

Linux debianhost 5.4.94-050494-generic #202101301330 SMP Sat Jan 30 13:34:41 UTC 2021 x86_64 GNU/Linux

CPU architecture issue was seen on

amd64

Expected behaviour you didn't see

I think that the script "src/kernel-install/90-loaderentry.install" does not handle the special case if booted with
option "single".

Unexpected behaviour you saw

System boots to recovery (aka single user mode) all the time.

Steps to reproduce the problem

On bootup in the systemd-boot menu, edit the line and add "single", to get into the recovery (aka single
user mode).
In recovery you just say "exit" or press ctrl-D. This will boot the system in normal mode (usually multi-user).
BUT, in "/proc/cmdline" there is still the option "single" at the end of the line.
Now install a kernel update or do "update-initramfs", which will update the "systemd-boot" loader-entries by running the
kernel-install scripts including "90-loaderentry.install".
The updated loader-entry will have the entry "single" under "options".
On next reboot, the system will again go to recovery.
At the end, you will never get rid of the option "single".
The only way out is to create "/etc/kernel/cmdline" without the "single" in the line.
I saw this in Debian 10 (buster), but did not see a change in the source of newer versions.

@poettering
Copy link
Member

We can't possibly fix this: apparently "single" was a one-time thing for you, but it might not be for others. /proc/cmdline can't inform us about your intention with this.

generally, generating the kernel cmdline from /proc/cmdline is a fallback only, and works for simple cases but not the general case. The correct place to configure your kernel cmdline is /etc/kernel/cmdline, there's no way around that...

@Kunzol
Copy link
Author

Kunzol commented Feb 3, 2021

I came to this because I thought about having a "rescue" menu entry in systemd-boot like with grub.
But the "framework" of systemd-boot is not (yet) as advanced as grub in this respect.

Using the systemd-boot editor to modify the boot process should always be a one-time thing.
But I don't see a possibility to put the information about this editing somewhere, where it can be read after boot.

On the other side your argument about creating /etc/kernel/cmdline is valid, too. In grub it is the same (debian: /etc/default/grub), where the configuration is expected. Maybe /etc/kernel/cmdline should be created directly on first start of kernel-install.

Thanks for the discussion.

@Kunzol Kunzol closed this as completed Feb 4, 2021
@poettering
Copy link
Member

Also see #18406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants