Merge pull request #303373 from msanft/systemd/kernel-install-configurable

systemd: make installation of kernel-install configurable
This commit is contained in:
Will Fancher 2024-04-11 14:44:09 -04:00 committed by GitHub
commit 540d1a266c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,6 +150,10 @@
, withUserDb ? true
, withUtmp ? !stdenv.hostPlatform.isMusl
, withVmspawn ? true
# kernel-install shouldn't usually be used on NixOS, but can be useful, e.g. for
# building disk images for non-NixOS systems. To save users from trying to use it
# on their live NixOS system, we disable it by default.
, withKernelInstall ? false
# tests assume too much system access for them to be feasible for us right now
, withTests ? false
# build only libudev and libsystemd
@ -628,6 +632,7 @@ stdenv.mkDerivation (finalAttrs: {
(lib.mesonBool "efi" withEfi)
(lib.mesonBool "utmp" withUtmp)
(lib.mesonBool "log-trace" withLogTrace)
(lib.mesonBool "kernel-install" withKernelInstall)
(lib.mesonBool "quotacheck" false)
(lib.mesonBool "ldconfig" false)
(lib.mesonBool "install-sysconfdir" false)
@ -819,7 +824,7 @@ stdenv.mkDerivation (finalAttrs: {
done
rm -rf $out/etc/rpm
'' + lib.optionalString (!withKernelInstall) ''
# "kernel-install" shouldn't be used on NixOS.
find $out -name "*kernel-install*" -exec rm {} \;
'' + lib.optionalString (!withDocumentation) ''