julian-klode / sicherboot

Unmaintained systemd-boot integration with secure boot support; consider https://github.com/Foxboron/sbctl instead.
34 stars 5 forks source link

Ubuntu install fails due to missing /etc/kernel/cmdline file #12

Open redtux opened 3 years ago

redtux commented 3 years ago

As described in https://bugs.launchpad.net/ubuntu/+source/sicherboot/+bug/1883345 (and replied to by @julian-klode), there is a bug with the Ubuntu package, requiring the non-existent file /etc/kernel/cmdline. The installer needs to create the file (e.g. by creating a symlink to /proc/cmdline - in case the format is the same), or it needs to depend on a package that creates this file.

Maryse47 commented 3 years ago

/proc/cmdline is read-only file that shows cmdline of currently running kernel therefore it doesn't make sense to symlink it as /etc/kernel/cmdline.

redtux commented 3 years ago

Alright, but the installer cannot expect a file that is not there, and then just fail instead of creating it. In case the format is the same it could just be copied from proc or extracted from grub, or just provide an example file with all options commented out.

Maryse47 commented 3 years ago

I thin the better solution is to fallback to /proc/cmdline in case /etc/kernel/cmdline doesn't exist. In fact this is what manpage of kernel-install says:

/etc/kernel/cmdline /proc/cmdline

Read by 90-loaderentry.install. The content of the file /etc/kernel/cmdline specifies the kernel command line to use. If that file does not exist, /proc/cmdline is used.

I think it shouldn't be complicated to fix this.