diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index a05821cfbf..8b4778555e 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -110,104 +110,135 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_malloc_0_nonnull=yes \ post_makeinstall_target() { # remove unneeded stuff - rm -rf $INSTALL/etc/systemd/system - rm -rf $INSTALL/usr/share/zsh - rm -rf $INSTALL/usr/lib/kernel/install.d - rm -rf $INSTALL/usr/lib/rpm - rm -f $INSTALL/usr/bin/kernel-install - rm -rf $INSTALL/etc/xdg - rm -rf $INSTALL/usr/share/factory + rm -rf $INSTALL/etc/systemd/system + rm -rf $INSTALL/etc/xdg + rm -f $INSTALL/usr/bin/kernel-install + rm -rf $INSTALL/usr/lib/kernel/install.d + rm -rf $INSTALL/usr/lib/rpm + rm -rf $INSTALL/usr/lib/systemd/user + rm -rf $INSTALL/usr/lib/tmpfiles.d/etc.conf + rm -rf $INSTALL/usr/lib/tmpfiles.d/systemd-remote.conf + rm -rf $INSTALL/usr/share/factory + rm -rf $INSTALL/usr/share/zsh - rm -f $INSTALL/usr/lib/udev/hwdb.d/20-OUI.hwdb - rm -f $INSTALL/usr/lib/udev/hwdb.d/20-acpi-vendor.hwdb - rm -f $INSTALL/usr/lib/udev/hwdb.d/20-bluetooth-vendor-product.hwdb - rm -f $INSTALL/usr/lib/udev/hwdb.d/20-net-ifname.hwdb - rm -f $INSTALL/usr/lib/udev/hwdb.d/20-sdio-classes.hwdb - rm -f $INSTALL/usr/lib/udev/hwdb.d/20-sdio-vendor-model.hwdb - - # tune journald.conf - sed -e "s,^.*Compress=.*$,Compress=no,g" -i $INSTALL/etc/systemd/journald.conf - sed -e "s,^.*SplitMode=.*$,SplitMode=none,g" -i $INSTALL/etc/systemd/journald.conf - sed -e "s,^.*MaxRetentionSec=.*$,MaxRetentionSec=1day,g" -i $INSTALL/etc/systemd/journald.conf - sed -e "s,^.*RuntimeMaxUse=.*$,RuntimeMaxUse=2M,g" -i $INSTALL/etc/systemd/journald.conf - sed -e "s,^.*RuntimeMaxFileSize=.*$,RuntimeMaxFileSize=128K,g" -i $INSTALL/etc/systemd/journald.conf - sed -e "s,^.*SystemMaxUse=.*$,SystemMaxUse=10M,g" -i $INSTALL/etc/systemd/journald.conf - - # tune logind.conf - sed -e "s,^.*HandleLidSwitch=.*$,HandleLidSwitch=ignore,g" -i $INSTALL/etc/systemd/logind.conf - - # replace systemd-machine-id-setup with ours - mkdir -p $INSTALL/usr/bin - rm -rf $INSTALL/usr/lib/systemd/systemd-machine-id-commit - rm -rf $INSTALL/usr/lib/systemd/system/systemd-machine-id-commit.service - rm -rf $INSTALL/usr/bin/systemd-machine-id-setup - cp $PKG_DIR/scripts/systemd-machine-id-setup $INSTALL/usr/bin - - # provide 'halt', 'shutdown', 'reboot' & co. - mkdir -p $INSTALL/usr/sbin - ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/halt - ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/poweroff - ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/reboot - ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/runlevel - ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/shutdown - ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/telinit + # clean up hwdb + rm -f $INSTALL/usr/lib/udev/hwdb.d/20-OUI.hwdb + rm -f $INSTALL/usr/lib/udev/hwdb.d/20-acpi-vendor.hwdb + rm -f $INSTALL/usr/lib/udev/hwdb.d/20-bluetooth-vendor-product.hwdb + rm -f $INSTALL/usr/lib/udev/hwdb.d/20-net-ifname.hwdb + rm -f $INSTALL/usr/lib/udev/hwdb.d/20-sdio-classes.hwdb + rm -f $INSTALL/usr/lib/udev/hwdb.d/20-sdio-vendor-model.hwdb # remove Network adaper renaming rule, this is confusing - rm -rf $INSTALL/usr/lib/udev/rules.d/80-net-setup-link.rules + rm -rf $INSTALL/usr/lib/udev/rules.d/80-net-setup-link.rules # remove debug-shell.service, we install our own - rm -rf $INSTALL/usr/lib/systemd/system/debug-shell.service + rm -rf $INSTALL/usr/lib/systemd/system/debug-shell.service - # remove systemd-ask-password. pointless - rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-wall.service - rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-wall.path - rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-console.path - rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-console.service - rm -rf $INSTALL/usr/bin/systemd-ask-password - rm -rf $INSTALL/usr/bin/systemd-tty-ask-password-agent - rm -rf $INSTALL/usr/lib/systemd/system/sysinit.target.wants/systemd-ask-password-console.path - rm -rf $INSTALL/usr/lib/systemd/system/multi-user.target.wants/systemd-ask-password-wall.path - - # remove some generators we never use - rm -rf $INSTALL/usr/lib/systemd/system-generators/systemd-fstab-generator + # remove systemd-ask-password + rm -rf $INSTALL/usr/bin/systemd-ask-password + rm -rf $INSTALL/usr/bin/systemd-tty-ask-password-agent + rm -rf $INSTALL/usr/lib/systemd/systemd-reply-password + rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-console.path + rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-console.service + rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-wall.path + rm -rf $INSTALL/usr/lib/systemd/system/systemd-ask-password-wall.service + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/systemd-ask-password-console.path + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/systemd-ask-password-wall.path # remove getty units, we dont want a console - rm -rf $INSTALL/usr/lib/systemd/system/autovt@.service - rm -rf $INSTALL/usr/lib/systemd/system/console-getty.service - rm -rf $INSTALL/usr/lib/systemd/system/console-shell.service - rm -rf $INSTALL/usr/lib/systemd/system/getty@.service - rm -rf $INSTALL/usr/lib/systemd/system/container-getty@.service - rm -rf $INSTALL/usr/lib/systemd/system/serial-getty@.service - rm -rf $INSTALL/usr/lib/systemd/system/getty.target - rm -rf $INSTALL/usr/lib/systemd/system/multi-user.target.wants/getty.target + rm -rf $INSTALL/usr/lib/systemd/system/autovt@.service + rm -rf $INSTALL/usr/lib/systemd/system/console-getty.service + rm -rf $INSTALL/usr/lib/systemd/system/console-shell.service + rm -rf $INSTALL/usr/lib/systemd/system/container-getty@.service + rm -rf $INSTALL/usr/lib/systemd/system/getty.target + rm -rf $INSTALL/usr/lib/systemd/system/getty@.service + rm -rf $INSTALL/usr/lib/systemd/system/serial-getty@.service + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/getty.target # remove other notused or nonsense stuff (our /etc is ro) - rm -rf $INSTALL/usr/lib/systemd/system/systemd-update-done.service - rm -rf $INSTALL/usr/lib/systemd/system/sysinit.target.wants/systemd-update-done.service - rm -rf $INSTALL/usr/lib/systemd/system/systemd-udev-hwdb-update.service - rm -rf $INSTALL/usr/lib/systemd/system/sysinit.target.wants/systemd-udev-hwdb-update.service - rm -rf $INSTALL/usr/lib/tmpfiles.d/etc.conf + rm -rf $INSTALL/usr/lib/systemd/systemd-update-done + rm -rf $INSTALL/usr/lib/systemd/system/systemd-update-done.service + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/systemd-update-done.service - # systemd-journal-remote is optional - rm -rf $INSTALL/usr/lib/tmpfiles.d/systemd-remote.conf + # remove systemd-udev-hwdb-update. we have own hwdb.service + rm -rf $INSTALL/usr/lib/systemd/system/systemd-udev-hwdb-update.service + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/systemd-udev-hwdb-update.service # remove rootfs fsck - rm -rf $INSTALL/usr/lib/systemd/system/systemd-fsck-root.service - rm -rf $INSTALL/usr/lib/systemd/system/local-fs.target.wants/systemd-fsck-root.service + rm -rf $INSTALL/usr/lib/systemd/system/systemd-fsck-root.service + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/systemd-fsck-root.service + + # remove fsck + rm -rf $INSTALL/usr/lib/systemd/systemd-fsck + rm -rf $INSTALL/usr/lib/systemd/system/systemd-fsck@.service + + # remove remount fs + rm -rf $INSTALL/usr/lib/systemd/systemd-remount-fs + rm -rf $INSTALL/usr/lib/systemd/system/systemd-remount-fs.service + rm -rf $INSTALL/usr/lib/systemd/system/*.target.wants/systemd-remount-fs.service + + # remove initrd services + rm -rf $INSTALL/usr/lib/systemd/system/initrd-*.service + rm -rf $INSTALL/usr/lib/systemd/system/initrd-*.target + + # remove nspawn + rm -rf $INSTALL/usr/bin/systemd-nspawn + rm -rf $INSTALL/usr/lib/systemd/system/systemd-nspawn@.service + + # remove genetators/catalog + rm -rf $INSTALL/usr/lib/systemd/system-generators + rm -rf $INSTALL/usr/lib/systemd/catalog + + # meh presets + rm -rf $INSTALL/usr/lib/systemd/system-preset + + # remove networkd + rm -rf $INSTALL/usr/lib/systemd/network + + # remove systemd-journal-remote.conf + rm -rf $INSTALL/usr/lib/tmpfiles.d/systemd-remote.conf + + # tune journald.conf + sed -e "s,^.*Compress=.*$,Compress=no,g" -i $INSTALL/etc/systemd/journald.conf + sed -e "s,^.*SplitMode=.*$,SplitMode=none,g" -i $INSTALL/etc/systemd/journald.conf + sed -e "s,^.*MaxRetentionSec=.*$,MaxRetentionSec=1day,g" -i $INSTALL/etc/systemd/journald.conf + sed -e "s,^.*RuntimeMaxUse=.*$,RuntimeMaxUse=2M,g" -i $INSTALL/etc/systemd/journald.conf + sed -e "s,^.*RuntimeMaxFileSize=.*$,RuntimeMaxFileSize=128K,g" -i $INSTALL/etc/systemd/journald.conf + sed -e "s,^.*SystemMaxUse=.*$,SystemMaxUse=10M,g" -i $INSTALL/etc/systemd/journald.conf + + # tune logind.conf + sed -e "s,^.*HandleLidSwitch=.*$,HandleLidSwitch=ignore,g" -i $INSTALL/etc/systemd/logind.conf + + # replace systemd-machine-id-setup with ours + rm -rf $INSTALL/usr/lib/systemd/systemd-machine-id-commit + rm -rf $INSTALL/usr/lib/systemd/system/systemd-machine-id-commit.service + rm -rf $INSTALL/usr/bin/systemd-machine-id-setup + mkdir -p $INSTALL/usr/bin + cp $PKG_DIR/scripts/systemd-machine-id-setup $INSTALL/usr/bin + + # provide 'halt', 'shutdown', 'reboot' & co. + mkdir -p $INSTALL/usr/sbin + ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/halt + ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/poweroff + ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/reboot + ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/runlevel + ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/shutdown + ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/telinit mkdir -p $INSTALL/usr/config - cp -PR $PKG_DIR/config/* $INSTALL/usr/config + cp -PR $PKG_DIR/config/* $INSTALL/usr/config - rm -rf $INSTALL/etc/modules-load.d - ln -sf /storage/.config/modules-load.d $INSTALL/etc/modules-load.d - rm -rf $INSTALL/etc/sysctl.d - ln -sf /storage/.config/sysctl.d $INSTALL/etc/sysctl.d - rm -rf $INSTALL/etc/tmpfiles.d - ln -sf /storage/.config/tmpfiles.d $INSTALL/etc/tmpfiles.d - rm -rf $INSTALL/etc/udev/hwdb.d - ln -sf /storage/.config/hwdb.d $INSTALL/etc/udev/hwdb.d - rm -rf $INSTALL/etc/udev/rules.d - ln -sf /storage/.config/udev.rules.d $INSTALL/etc/udev/rules.d + rm -rf $INSTALL/etc/modules-load.d + ln -sf /storage/.config/modules-load.d $INSTALL/etc/modules-load.d + rm -rf $INSTALL/etc/sysctl.d + ln -sf /storage/.config/sysctl.d $INSTALL/etc/sysctl.d + rm -rf $INSTALL/etc/tmpfiles.d + ln -sf /storage/.config/tmpfiles.d $INSTALL/etc/tmpfiles.d + rm -rf $INSTALL/etc/udev/hwdb.d + ln -sf /storage/.config/hwdb.d $INSTALL/etc/udev/hwdb.d + rm -rf $INSTALL/etc/udev/rules.d + ln -sf /storage/.config/udev.rules.d $INSTALL/etc/udev/rules.d } post_install() {