sbctl: update
- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-glibc)
the patch fixes https://github.com/Foxboron/sbctl/issues/102 cc maintainer @ericonr
I don't think the hook should run by default.
Kernels are not necessarily named vmlinuz, it could be vmlinux depending on the architecture.
I could add a check for the existence of vmlinuz. (Note that efibootmgr also uses vmlinuz, and secure boot is a uefi feature, afaik.) If one installs sbctl, don't they want to sign new kernels? or what is your concern?
You have to first create keys and enroll, some users might want to sign kernel with sbctl and move/rename them instead of modifying the tracked binary.
aarch64 supports efi and the kernel binaries are uncompressed and named vmlinux, the efibootmgr hook is not very good for multiple reasons.
how about now? it's disabled by default, and it checks existence of vmlinuz
We generally don't test for values of those environment variables and instead check if they are set or not, that makes the code easier and avoids having to define what yes/no/true/false/0/1 is the correct choice.
Not sure why you would only sign vmlinuz kernels and ignore vmlinux.
[ -z "$SBCTL_SIGN_KERNEL" ] && exit 0
[ -e "boot/vmlinuz-${VERSION}" ] && sign "boot/vmlinuz-${VERSION}"
[ -e "boot/vmlinux-${VERSION}" ] && sign "boot/vmlinux-${VERSION}"
/etc/default/sbctl-kernel-hook:
# SBCTL_SIGN_KERNEL=yes
I guess the set vs yes/no/1/0 is arguable, seems like other hooks tend to check for 1/0, other things like xbps-src and such use the -n/-z style.
Done, thanks.
added a post-removal hook as well.
can this be merged?
update to 0.12, enable pie, enable checks
ready to merge, imo
patch is merged upstream
updated to 0.13, which includes my patch.
should i just drop the kernel hooks for now, and just do the update?
- remove the postrm hook, which does not work
- we currently install (and also in my prior pr) /usr/lib/kernel/install.d/91-sbctl.install, but this is arch/systemd specific, so remove it
i realised the program by default writes key material to /usr/share. make it use /etc/secureboot instead, via a go_ldlfag
@Duncaen , anyone: this has several improvements, has been running fine for some time. any chance it can be merged?
i realised the program by default writes key material to /usr/share. make it use /etc/secureboot instead, via a go_ldlfag
Sucks that its in /usr/share, but breaking already existing installs and diverting from the documentation doesn't seem right.
Upstream issue https://github.com/Foxboron/sbctl/issues/57.
i see your point, and i saw the issue (been there for years). the help function in the sbctl program gets built correctly though, see e.g.
$ sbctl help create-keys
Create a set of secure boot signing keys
Usage:
sbctl create-keys [flags]
Flags:
-d, --database-path string location to create GUID file. defaults to /etc/secureboot (default "/etc/secureboot")
-e, --export string export file path. defaults to /etc/secureboot/keys (default "/etc/secureboot/keys")
-h, --help help for create-keys
i got this idea from nix pkgs. would an install/update message be enough to warn the user? otherwise i'll just remove this change for now.
I would probably prefer to not change it now that it has been like this in the repos for 3 years and we don't know what upstream is going to do.
There are 3 scenarios:
- Upstream changes it to what we "patched" in, everythink good.
- Upstream changes it to something else, users have to manually change again.
- Upstream changes it and adds a fallback mechanism, we don't have to do anything.
Done. I commented out the option and left a comment for future.
I removed the kernel hook, as I prefer to sign the unified kernel image. Also simpler in view of moving kerneks out of /boot. This is now just an update, which i've been using for months with no issues.
0.14 is out, seems to work fine.
version 15 is out: https://github.com/Foxboron/sbctl/releases/tag/0.15
Thanks. I've tested the new version, and it works for me, as well as the migrate subcommand.
I'm open to suggestions as for the sbctl.conf file, which I've taken from upstream.
I do not create /var/lib/sbctl using make_dirs, as currently the program would complain otherwise
and refuse to proceed if that folder is already present.
@Duncaen This version solves the issue with /usr/share, as it finally moves it to /var/lib/sbctl. Let me know if an install message is needed to warn the user.
In general, it may be better to wait a few days until things are more stable, and more people have tested this, so marking as draft.
@dkwo fwiw, the config file is the internal defaults sbctl will use if there is no config file.
It will also merge the internal state with the /etc/sbctl/sbctl.conf file if there is a change. So you don't need to include this in the package.
@Foxboron Thanks a lot! I removed the conf file, and now the package also creates /var/lib/sbctl as expected.
This has been working fine for me.
0.15.4 is out