From c82474fa5d0b0cae52806fa54f1df3a067d2c389 Mon Sep 17 00:00:00 2001 From: eichehome Date: Thu, 18 Jan 2024 00:00:52 +0100 Subject: [PATCH] =?UTF-8?q?Anf=C3=A4nge=20der=20Erstellung=20eines=20Initr?= =?UTF-8?q?amfs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manual-build/create-initramfs.sh | 429 ++++++++++++++++++++++++++++++- 1 file changed, 424 insertions(+), 5 deletions(-) diff --git a/manual-build/create-initramfs.sh b/manual-build/create-initramfs.sh index e3a6720..1c494ab 100755 --- a/manual-build/create-initramfs.sh +++ b/manual-build/create-initramfs.sh @@ -1,8 +1,333 @@ #!/bin/bash -buildroot=".new_initramfs" -cache=".cache" -extract="extract" +buildroot=".initramfs" +cachedir=".cache" +workdir=".workdir" + +# Create Directories + +echo "Create Directories..." + +mkdir -p "${buildroot}"/usr/{bin,lib/systemd/{system,system-generators}} + +# Copy Targets + +echo "Copy Targets..." + +search_path="/usr/lib/systemd/system" +targetdir="${buildroot}/usr/lib/systemd/system/" + +cp "${search_path}"/initrd.target "${targetdir}" +cp "${search_path}"/initrd-switch-root.target "${targetdir}" +cp "${search_path}"/initrd-root-fs.target "${targetdir}" +cp "${search_path}"/initrd-root-device.target "${targetdir}" +cp "${search_path}"/initrd-fs.target "${targetdir}" +cp "${search_path}"/initrd-usr-fs.target "${targetdir}" +cp "${search_path}"/emergency.target "${targetdir}" +cp "${search_path}"/rescue.target "${targetdir}" + +cp "${search_path}"/basic.target "${targetdir}" +cp "${search_path}"/sockets.target "${targetdir}" +cp "${search_path}"/timers.target "${targetdir}" +cp "${search_path}"/paths.target "${targetdir}" +cp "${search_path}"/swap.target "${targetdir}" +cp "${search_path}"/sysinit.target "${targetdir}" + +cp "${search_path}"/local-fs-pre.target "${targetdir}" +cp "${search_path}"/local-fs.target "${targetdir}" +cp "${search_path}"/cryptsetup-pre.target "${targetdir}" +cp "${search_path}"/cryptsetup.target "${targetdir}" +cp "${search_path}"/veritysetup-pre.target "${targetdir}" +cp "${search_path}"/veritysetup.target "${targetdir}" +cp "${search_path}"/integritysetup-pre.target "${targetdir}" +cp "${search_path}"/integritysetup.target "${targetdir}" +cp "${search_path}"/getty-pre.target "${targetdir}" +cp "${search_path}"/getty.target "${targetdir}" +cp "${search_path}"/remote-cryptsetup.target "${targetdir}" +cp "${search_path}"/remote-veritysetup.target "${targetdir}" +cp "${search_path}"/remote-fs-pre.target "${targetdir}" +cp "${search_path}"/remote-fs.target "${targetdir}" +cp "${search_path}"/blockdev@.target "${targetdir}" + +cp "${search_path}"/exit.target "${targetdir}" +cp "${search_path}"/final.target "${targetdir}" +cp "${search_path}"/halt.target "${targetdir}" +cp "${search_path}"/hibernate.target "${targetdir}" +cp "${search_path}"/hybrid-sleep.target "${targetdir}" +cp "${search_path}"/kexec.target "${targetdir}" +cp "${search_path}"/poweroff.target "${targetdir}" +cp "${search_path}"/reboot.target "${targetdir}" +cp "${search_path}"/shutdown.target "${targetdir}" +cp "${search_path}"/sleep.target "${targetdir}" # ? +cp "${search_path}"/soft-reboot.target "${targetdir}" +cp "${search_path}"/suspend-then-hibernate.target "${targetdir}" +cp "${search_path}"/suspend.target "${targetdir}" +cp "${search_path}"/umount.target "${targetdir}" + +cp "${search_path}"/slices.target "${targetdir}" +cp "${search_path}"/smartcard.target "${targetdir}" +cp "${search_path}"/time-set.target "${targetdir}" # ? +cp "${search_path}"/time-sync.target "${targetdir}" # ? + +cp "${search_path}"/network-online.target "${targetdir}" +cp "${search_path}"/network-pre.target "${targetdir}" +cp "${search_path}"/network.target "${targetdir}" + +# nss-lookup.target? +# nss-user-lookup.target? + +cp "${search_path}"/first-boot-complete.target "${targetdir}" +cp "${search_path}"/boot-complete.target "${targetdir}" +cp "${search_path}"/factory-reset.target "${targetdir}" + +# bluetooth.target +# printer.target +# rpcbind.target +# sigpwr.target +# sound.target +# storage-target-mode.target +# system-update-pre.target +# system-update.target +# usb-gadget.target + +# Link Targets + +echo "Link Targets..." + +targetdir="${buildroot}/usr/lib/systemd/system/sysinit.target.wants" +mkdir -p "${targetdir}" + +ln -s ../cryptsetup.target "${targetdir}"/cryptsetup.target +ln -s ../integritysetup.target "${targetdir}"/integritysetup.target +ln -s ../veritysetup.target "${targetdir}"/veritysetup.target + +targetdir="${buildroot}/usr/lib/systemd/system/initrd-root-device.target.wants" +mkdir -p "${targetdir}" + +ln -s ../remote-cryptsetup.target "${targetdir}"/remote-cryptsetup.target +ln -s ../remote-veritysetup.target "${targetdir}"/remote-veritysetup.target + +# Copy Services + +echo "Copy Services..." + +targetdir="${buildroot}/usr/lib/systemd/system/" + +cp "${search_path}"/console-getty.service "${targetdir}" +cp "${search_path}"/container-getty@.service "${targetdir}" +cp "${search_path}"/dbus.service "${targetdir}" +cp "${search_path}"/debug-shell.service "${targetdir}" +cp "${search_path}"/dm-event.service "${targetdir}" +cp "${search_path}"/emergency.service "${targetdir}" +cp "${search_path}"/getty@.service "${targetdir}" +cp "${search_path}"/initrd-cleanup.service "${targetdir}" +cp "${search_path}"/initrd-parse-etc.service "${targetdir}" +cp "${search_path}"/initrd-switch-root.service "${targetdir}" +cp "${search_path}"/initrd-udevadm-cleanup-db.service "${targetdir}" +cp "${search_path}"/kmod-static-nodes.service "${targetdir}" +cp "${search_path}"/ldconfig.service "${targetdir}" +cp "${search_path}"/modprobe@.service "${targetdir}" +cp "${search_path}"/rescue.service "${targetdir}" +cp "${search_path}"/serial-getty@.service "${targetdir}" +cp "${search_path}"/system-update-cleanup.service "${targetdir}" # ? +cp "${search_path}"/systemd-ask-password-console.service "${targetdir}" +cp "${search_path}"/systemd-ask-password-wall.service "${targetdir}" +cp "${search_path}"/systemd-battery-check.service "${targetdir}" +cp "${search_path}"/systemd-binfmt.service "${targetdir}" +cp "${search_path}"/systemd-bless-boot.service "${targetdir}" +cp "${search_path}"/systemd-boot-check-no-failures.service "${targetdir}" # ? +cp "${search_path}"/systemd-boot-random-seed.service "${targetdir}" +cp "${search_path}"/systemd-boot-update.service "${targetdir}" # ? +cp "${search_path}"/systemd-bsod.service "${targetdir}" +cp "${search_path}"/systemd-coredump@.service "${targetdir}" +cp "${search_path}"/systemd-exit.service "${targetdir}" +cp "${search_path}"/systemd-firstboot.service "${targetdir}" +cp "${search_path}"/systemd-fsck-root.service "${targetdir}" +cp "${search_path}"/systemd-fsck@.service "${targetdir}" +cp "${search_path}"/systemd-growfs-root.service "${targetdir}" +cp "${search_path}"/systemd-growfs@.service "${targetdir}" +cp "${search_path}"/systemd-halt.service "${targetdir}" +cp "${search_path}"/systemd-hibernate-resume.service "${targetdir}" +cp "${search_path}"/systemd-hibernate.service "${targetdir}" +cp "${search_path}"/systemd-hwdb-update.service "${targetdir}" +cp "${search_path}"/systemd-hybrid-sleep.service "${targetdir}" +cp "${search_path}"/systemd-journal-catalog-update.service "${targetdir}" +cp "${search_path}"/systemd-journal-flush.service "${targetdir}" +cp "${search_path}"/systemd-journal-gatewayd.service "${targetdir}" +cp "${search_path}"/systemd-journal-remote.service "${targetdir}" +cp "${search_path}"/systemd-journal-upload.service "${targetdir}" +cp "${search_path}"/systemd-journald.service "${targetdir}" +cp "${search_path}"/systemd-journald@.service "${targetdir}" +cp "${search_path}"/systemd-kexec.service "${targetdir}" +cp "${search_path}"/systemd-machine-id-commit.service "${targetdir}" +cp "${search_path}"/systemd-modules-load.service "${targetdir}" +cp "${search_path}"/systemd-network-generator.service "${targetdir}" +cp "${search_path}"/systemd-networkd-wait-online.service "${targetdir}" +cp "${search_path}"/systemd-networkd-wait-online@.service "${targetdir}" +cp "${search_path}"/systemd-networkd.service "${targetdir}" +cp "${search_path}"/systemd-pcrextend@.service "${targetdir}" +cp "${search_path}"/systemd-pcrfs-root.service "${targetdir}" +cp "${search_path}"/systemd-pcrfs@.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-file-system.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-firmware-code.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-firmware-config.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-machine-id.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-make-policy.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-secureboot-authority.service "${targetdir}" +cp "${search_path}"/systemd-pcrlock-secureboot-policy.service "${targetdir}" +cp "${search_path}"/systemd-pcrmachine.service "${targetdir}" +cp "${search_path}"/systemd-pcrphase-initrd.service "${targetdir}" +cp "${search_path}"/systemd-pcrphase-sysinit.service "${targetdir}" +cp "${search_path}"/systemd-pcrphase.service "${targetdir}" +cp "${search_path}"/systemd-poweroff.service "${targetdir}" +cp "${search_path}"/systemd-pstore.service "${targetdir}" # ? +cp "${search_path}"/systemd-random-seed.service "${targetdir}" # ? +cp "${search_path}"/systemd-rebbot.service "${targetdir}" +cp "${search_path}"/systemd-remount-fs.service "${targetdir}" +cp "${search_path}"/systemd-repart.service "${targetdir}" +cp "${search_path}"/systemd-resolved.service "${targetdir}" # ? +cp "${search_path}"/systemd-rfkill.service "${targetdir}" +cp "${search_path}"/systemd-soft-reboot.service "${targetdir}" +cp "${search_path}"/systemd-suspend-then-hibernate.service "${targetdir}" +cp "${search_path}"/systemd-suspend.service "${targetdir}" +cp "${search_path}"/systemd-sysctl.service "${targetdir}" +cp "${search_path}"/systemd-sysext.service "${targetdir}" # ? +cp "${search_path}"/systemd-sysext@.service "${targetdir}" # ? +cp "${search_path}"/systemd-sysusers.service "${targetdir}" +cp "${search_path}"/systemd-time-wait-sync.service "${targetdir}" +cp "${search_path}"/systemd-timedated.service "${targetdir}" # ? +cp "${search_path}"/systemd-tmpfiles-clean.service "${targetdir}" +cp "${search_path}"/systemd-tmpfiles-setup-dev-early.service "${targetdir}" +cp "${search_path}"/systemd-tmpfiles-setup-dev.service "${targetdir}" +cp "${search_path}"/systemd-tmpfiles-setup.service "${targetdir}" +cp "${search_path}"/systemd-tpm2-setup-early.service "${targetdir}" +cp "${search_path}"/systemd-tpm2-setup.service "${targetdir}" +cp "${search_path}"/systemd-udev-settle.service "${targetdir}" +cp "${search_path}"/systemd-udev-trigger.service "${targetdir}" +cp "${search_path}"/systemd-udevd.service "${targetdir}" +cp "${search_path}"/systemd-user-sessions.service "${targetdir}" +cp "${search_path}"/systemd-update-done.service "${targetdir}" +cp "${search_path}"/systemd-update-utmp.service "${targetdir}" +cp "${search_path}"/systemd-vconsole-setup.service "${targetdir}" +cp "${search_path}"/systemd-volatile-root.service "${targetdir}" + +# systemd-backlight@.service +# systemd-confext.service +# systemd-homed-activate.service +# systemd-homed.service +# systemd-hostnamed.service +# systemd-importd.service +# systemd-localed.service +# systemd-logind.service +# systemd-machined.service +# systemd-nspawn@.service +# systemd-oomd.service +# systemd-portabled.service +# systemd-quotacheck.service +# systemd-storagetm.service +# systemd-sysupdate-reboot.service +# systemd-sysupdate.service +# systemd-userdbd.service + +# Link Services + +echo "Link Services..." + +targetdir="${buildroot}/usr/lib/systemd/system" + +ln -s getty@.service "${targetdir}"/autovt@.service + +targetdir="${buildroot}/usr/lib/systemd/system/initrd-root-fs.target.wants" +mkdir -p "${targetdir}" + +ln -s ../systemd-repart.service "${targetdir}"/systemd-repart.service + +targetdir="${buildroot}/usr/lib/systemd/system/initrd.target.wants" +mkdir -p "${targetdir}" + +ln -s ../systemd-battery-check.service "${targetdir}"/systemd-battery-check.service +ln -s ../systemd-bsod.service "${targetdir}"/systemd-bsod.service +ln -s ../systemd-pcrphase-initrd.service "${targetdir}"/systemd-pcrphase-initrd.service + +# Copy Mounts + +echo "Copy Mounts..." + +targetdir="${buildroot}/usr/lib/systemd/system/" + +cp "${search_path}"/tmp.mount "${targetdir}" +cp "${search_path}"/var-lib-machines.mount "${targetdir}" + +# Link Mounts + +echo "Link Mounts..." + +targetdir="${buildroot}/usr/lib/systemd/system/local-fs.target.wants" +mkdir -p "${targetdir}" + +ln -s ../tmp.mount "${targetdir}"/tmp.mount + +targetdir="${buildroot}/usr/lib/systemd/system/local-fs.target.wants" +mkdir -p "${targetdir}" + +ln -s ../var-lib-machines.mount "${targetdir}"/var-lib-machines.mount + +# Copy Sockets + +echo "Copy Sockets..." + +targetdir="${buildroot}/usr/lib/systemd/system/" + +cp "${search_path}"/dbus.socket "${targetdir}" +cp "${search_path}"/dm-event.socket "${targetdir}" +cp "${search_path}"/systemd-coredump.socket "${targetdir}" +cp "${search_path}"/systemd-journald-dev-log.socket "${targetdir}" +cp "${search_path}"/systemd-journald.socket "${targetdir}" +cp "${search_path}"/systemd-pcrextend.socket "${targetdir}" +cp "${search_path}"/systemd-sysext.socket "${targetdir}" +cp "${search_path}"/systemd-udevd-control.socket "${targetdir}" +cp "${search_path}"/systemd-udevd-kernel.socket "${targetdir}" + +# Link Sockets + +echo "Link Sockets..." + +targetdir="${buildroot}/usr/lib/systemd/system/sockets.target.wants" +mkdir -p "${targetdir}" + +ln -s ../dbus.socket "${targetdir}"/dbus.socket +ln -s ../dm-event.socket "${targetdir}"/dm-event.socket +ln -s ../systemd-coredump.socket "${targetdir}"/systemd-coredump.socket +ln -s ../systemd-journald-dev-log.socket "${targetdir}"/systemd-journald-dev-log.socket + +# Copy Generators + +echo "Copy Generators..." + + +exit 0 + +CONTROL_BINARIES=(bootctl busctl coredumpctl homectl hostnamectl journalctl kernel-install localectl loginctl machinectl networkctl oomctl portablectl resolvectl systemctl timedatectl udevadm userdbctl varlinkctl) + +LIB_BINARIES=(systemd-ac-power systemd-analyze systemd-ask-password systemd-cat systemd-cgls systemd-cgtop systemd-creds systemd-cryptenroll systemd-cryptsetup systemd-delta systemd-detect-virt systemd-dissect systemd-escape systemd-firstboot systemd-hwdb systemd-id128 systemd-inhibit systemd-machine-id-setup systemd-mount systemd-notify systemd-nspawn systemd-path systemd-repart systemd-run systemd-socket-activate systemd-stdio-bridge systemd-sysext systemd-sysusers systemd-tty-ask-password-agent systemd-vmspawn) + +PAM=(pam_systemd_home.so pam_systemd_loadkey.so pam_systemd.so) + +LIB=(/usr/lib/systemd/libsystemd-core-255-2.so /usr/lib/systemd/libsystemd-shared-255-2.so) + +declare -A LINKS="" +BINARIES_LINK=( + [mount.ddi]="systemd-dissect" + [systemd-confext]="systemd-sysext" + [systemd-resolve]="resolvectl" + [systemd-umount]="systemd-mount" +) + +SYSUSERS=(basic.conf README systemd-coredump.conf systemd-journal.conf systemd-network.conf systemd-oom.conf systemd-remote.conf systemd-resolve.conf systemd-timesync.conf) + +TMPFILES=(credstore.conf etc.conf home.conf journal-nocow.conf legacy.conf portables.conf provision.conf README static-nodes-permissions.conf systemd.conf system-network.conf systemd-nologin.conf systemd-nspawn.conf systemd-pstore.conf systemd-resolve.conf systemd-tmp.conf tmp.conf var.conf x11.conf) + + PACKAGES=( "systemd" @@ -81,7 +406,101 @@ PACKAGES=( mkdir -p "${cache}" pacman -Syw --cachedir "${cache}" "${PACKAGES[@]}" mkdir -p "${extract}" -find "${cache}" -name '*.zst' -exec tar -xvpf "${cache}"'{}' --exclude .PKGINFO --exclude .INSTALL --exclude .MTREE --exclude .BUILDINFO -C "${extract}" \; -mkdir -p "${buildroot}" +find "${cache}" -name '*.zst' -exec tar -xvpf '{}' --exclude .PKGINFO --exclude .INSTALL --exclude .MTREE --exclude .BUILDINFO -C "${extract}" \; +mkdir -p "${buildroot}"/usr/lib/systemd/system +# Copy Systemd-Units and create links +find ${extract}/usr/lib/systemd/system/ -maxdepth 1 -type f -exec cp '{}' "${buildroot}"/usr/lib/systemd/system/ \; +ln -s getty@.service "${buildroot}"/usr/lib/systemd/system/autovt@.service +ln -s reboot.target "${buildroot}"/usr/lib/systemd/system/ctrl-alt-del.target +ln -s systemd-hostnamed.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.hostname1.service +ln -s systemd-importd.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.import1.service +ln -s systemd-localed.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.locale1.service +ln -s systemd-logind.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.login1.service +ln -s systemd-machined.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service +ln -s systemd-portabled.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.portable1.service +ln -s systemd-timedated.service "${buildroot}"/usr/lib/systemd/system/dbus-org.freedesktop.timedate1.service + +mkdir -p "${buildroot}"/usr/lib/systemd/system/{initrd-root-device.target,initrd-root-fs.target,initrd.target,local-fs.target,machines.target,multi-user.target,remote-fs.target,sockets.target,sysinit.target,timers.target,user-.slice.d,user@.service.d,user@0.service.d}.wants + +ln -s ../remote-cryptsetup.target "${buildroot}"/usr/lib/systemd/system/initrd-root-device.target.wants/ +ln -s ../remote-veritysetup.target "${buildroot}"/usr/lib/systemd/system/initrd-root-device.target.wants/ + +ln -s ../systemd-repart.service "${buildroot}"/usr/lib/systemd/system/initrd-root-fs.target.wants/ + +ln -s ../systemd-battery-check.service "${buildroot}"/usr/lib/systemd/system/initrd.target.wants/ +ln -s ../systemd-bsod.service "${buildroot}"/usr/lib/systemd/system/initrd.target.wants/ +ln -s ../systemd-pcrphase-initrd.service "${buildroot}"/usr/lib/systemd/system/initrd.target.wants/ + +ln -s ../tmp.mount "${buildroot}"/usr/lib/systemd/system/local-fs.target.wants/ + +ln -s ../var-lib-machines.mount "${buildroot}"/usr/lib/systemd/system/machines.target.wants/ + +ln -s ../dbus.service "${buildroot}"/usr/lib/systemd/system/multi-user.target.wants/ +ln -s ../getty.target "${buildroot}"/usr/lib/systemd/system/multi-user.target.wants/ +ln -s ../systemd-ask-password-wall.path "${buildroot}"/usr/lib/systemd/system/multi-user.target.wants/ +ln -s ../systemd-logind.service "${buildroot}"/usr/lib/systemd/system/multi-user.target.wants/ +ln -s ../systemd-user-sessions.service "${buildroot}"/usr/lib/systemd/system/multi-user.target.wants/ + +ln -s ../var-lib-machines.mount "${buildroot}"/usr/lib/systemd/system/remote-fs.target.wants/ + +ln -s ../dbus.socket "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-coredump.sockets "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-journald-dev-log.socket "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-journald.socket "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-pcrextend.socket "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-sysext.socket "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-udevd-control.socket "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ +ln -s ../systemd-udevd-kernel "${buildroot}"/usr/lib/systemd/system/sockets.target.wants/ + +ln -s ../cryptsetup.target "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../dev-hugepages.mount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../dev-mqueue.mount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../integritysetup.target "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../kmod-static-nodes.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../ldconfig.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../proc-sys-fs-binfmt_misc.automount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../sys-fs-fuse-connections.mount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../sys-kernel-config.mount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../sys-kernel-debug.mount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../sys-kernel-tracing.mount "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-ask-password-console.path "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-binfmt.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-boot-random-seed.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-firstboot.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-hwdb-update.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-journal-catalog-update.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-journal-flush.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-pcrphase.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-random-seed.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-repart.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-sysctl.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-sysusers.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-tmpfiles-setup-dev-early.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-tmpfiles-setup-dev.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-tmpfiles-setup.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-tpm2-setup-early.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-tpm2-setup.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-udev-trigger.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-udevd.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-update-done.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../systemd-update-utmp.service "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ +ln -s ../veritysetup.target "${buildroot}"/usr/lib/systemd/system/sysinit.target.wants/ + +ln -s ../shadow.timer "${buildroot}"/usr/lib/systemd/system/timers.target.wants/ +ln -s ../systemd-tmpfiles-clean.timer "${buildroot}"/usr/lib/systemd/system/timers.target.wants/ + +cp "${extract}"/usr/lib/systemd/system/user-.slice.d/10-defaults.conf "${buildroot}"/usr/lib/systemd/system/user-.slice.d/ +cp "${extract}"/usr/lib/systemd/system/user@.service.d/10-login-barrier.conf "${buildroot}"/usr/lib/systemd/system/user@.service.d/ +cp "${extract}"/usr/lib/systemd/system/user@0.service.d/10-login-barrier.conf "${buildroot}"/usr/lib/systemd/system/user@0.service.d/ + +# Copy Binaries +cp "${extract}"/usr/bin/pwck "${buildroot}"/usr/bin/ #shadow.service +cp "${extract}"/usr/bin/grpck "${buildroot}"/usr/bin/ #shadow.service +cp "${extract}"/sbin/agetty "${buildroot}"/usr/bin/ #getty@.service + +/usr/lib/systemd/systemd + +cp "${extract}"/usr/lib/systemd/systemd-hostnamed "${buildroot}"/usr/lib/systemd/ +cp "${extract}"/usr/lib/systemd/systemd-hostnamed "${buildroot}"/usr/lib/systemd/ #mkdir -p ${buildroot}/usr/{bin,lib/{binfmt.d,credstore,cryptsetup,environment.d,initcpio/{hooks,install},kernel/install.d,modprobe.d,modules-load.d,pam.d,pcrlock.d,security,sysctl.d,systemd/{boot/efi,catalog,network,ntp-units.d,portable/profile/,repart/definitions,system-{generators,preset,shutdown,sleep},system,user{,-preset,-{,environment-}generators}},sysusers.d,tmpfiles.d,udev/{hwdb.d,rules.d}},share/{bash-completion/completions,dbus-1/{interfaces,{system-,}services,system.d},doc/systemd/LICENSES,factory/etc/pam.d,libalpm/{hooks,scripts},locale,man/{man1,man5,man7,man8},pkgconfig,polkit-1/{actions,rules.d},systemd/{bootctl,gatewayd},zsh/site-functions}}