begin minimization of systemd

trivial part
This commit is contained in:
catvayor 2024-10-01 16:43:53 +02:00
parent 8c97f3e257
commit 14b59b5b62
Signed by: lbailly
GPG key ID: CE3E645251AC63F3

View file

@ -259,7 +259,12 @@ extraPkgs // {
patches = o.patches ++ [ patches = o.patches ++ [
./pkgs/qemu/arm-image-friendly-load-addr.patch ./pkgs/qemu/arm-image-friendly-load-addr.patch
]; ];
}); in q.override { nixosTestRunner = true; sdlSupport = false; hostCpuTargets = [ "mips-softmmu" ]; }; }); in q.override {
vde2 = null;
nixosTestRunner = true;
sdlSupport = false;
hostCpuTargets = [ "mips-softmmu" ];
};
rsyncSmall = rsyncSmall =
let r = prev.rsync.overrideAttrs(o: { let r = prev.rsync.overrideAttrs(o: {
@ -330,13 +335,14 @@ extraPkgs // {
}; };
}) { }; }) { };
systemd = prev.systemd.override { systemd =
let base = prev.systemd.override {
withAcl = false; withAcl = false;
withAnalyze = false; withAnalyze = false;
withApparmor = false; withApparmor = false;
withAudit = false; withAudit = false;
withBootloader = false; withBootloader = false;
# withCompression = true; withCompression = false;
withCoredump = false; withCoredump = false;
withCryptsetup = false; withCryptsetup = false;
withRepart = false; withRepart = false;
@ -344,7 +350,7 @@ extraPkgs // {
withEfi = false; withEfi = false;
withFido2 = false; withFido2 = false;
withHomed = false; withHomed = false;
# withHostnamed = true; withHostnamed = false;
withHwdb = false; withHwdb = false;
withImportd = false; withImportd = false;
withIptables = false; withIptables = false;
@ -365,11 +371,11 @@ extraPkgs // {
withQrencode = false; withQrencode = false;
withRemote = false; withRemote = false;
withResolved = false; withResolved = false;
# withShellCompletions = true; withShellCompletions = false;
# withSysusers = true; withSysusers = false;
withSysupdate = false; withSysupdate = false;
# withTimedated = true; withTimedated = false;
# withTimesyncd = true; withTimesyncd = false;
withTpm2Tss = false; withTpm2Tss = false;
withUkify = false; withUkify = false;
withUserDb = false; withUserDb = false;
@ -378,6 +384,62 @@ extraPkgs // {
withKernelInstall = false; withKernelInstall = false;
withLibarchive = false; withLibarchive = false;
}; };
in base.overrideAttrs (o: {
mesonFlags = o.mesonFlags ++ [
# "--optimization=s"
"--default-library=static"
"--buildtype=minsize"
];
postInstall = o.postInstall + ''
rm -rf $out/share
rm $out/lib/libudev.so*
rm -rf $out/lib/systemd/catalog
rm -rf $out/lib/systemd/system-generators
rm $out/lib/systemd/systemd-backlight
rm $out/lib/systemd/systemd-battery-check
rm $out/lib/systemd/systemd-hibernate-resume
rm $out/lib/systemd/systemd-makefs
rm $out/lib/systemd/systemd-nsresourced
rm $out/lib/systemd/systemd-nsresourcework
rm $out/lib/systemd/systemd-shutdown
rm $out/lib/systemd/systemd-sleep
rm $out/lib/systemd/systemd-binfmt
rm $out/lib/systemd/systemd-growfs
rm $out/lib/systemd/systemd-mountfsd
rm $out/lib/systemd/systemd-mountwork
rm $out/lib/systemd/systemd-network-generator
rm $out/lib/systemd/systemd-pstore
rm $out/lib/systemd/systemd-remount-fs
rm $out/lib/systemd/systemd-reply-password
rm $out/lib/systemd/systemd-rfkill
rm $out/lib/systemd/systemd-socket-proxyd
rm $out/lib/systemd/systemd-ssh-proxy
rm $out/lib/systemd/systemd-storagetm
rm $out/lib/systemd/systemd-volatile-root
rm $out/lib/systemd/systemd-xdg-autostart-condition
rm -rf $out/example
rm $out/bin/bootctl
rm $out/bin/systemd-nspawn
rm $out/bin/systemd-ac-power
rm $out/bin/systemd-dissect
rm $out/bin/systemd-ask-password
rm $out/bin/systemd-cgls
rm $out/bin/systemd-cgtop
rm $out/bin/systemd-creds
rm $out/bin/systemd-delta
rm $out/bin/systemd-detect-virt
rm $out/bin/systemd-escape
rm $out/bin/systemd-id128
rm $out/bin/systemd-machine-id-setup
rm $out/bin/systemd-path
rm $out/bin/systemd-run
rm $out/bin/systemd-socket-activate
rm $out/bin/systemd-stdio-bridge
rm $out/bin/systemd-sysext
rm $out/bin/systemd-tty-ask-password-agent
rm $out/bin/systemd-vpick
'';
});
ubootQemuAarch64 = final.buildUBoot { ubootQemuAarch64 = final.buildUBoot {
defconfig = "qemu_arm64_defconfig"; defconfig = "qemu_arm64_defconfig";