summarylogtreecommitdiffstats
path: root/initcpio-install-systemd
diff options
context:
space:
mode:
authorYurii Kolesnykov2016-12-29 18:04:50 +0200
committerYurii Kolesnykov2016-12-29 18:07:01 +0200
commita0e20679cac7ccf17a988c595e7be3a5966c38c7 (patch)
tree51350ca0658d75b722a76ec92a02efb54111fd17 /initcpio-install-systemd
parentc5951cc0b7fb3517cb437c818164f24bb4372c0e (diff)
downloadaur-a0e20679cac7ccf17a988c595e7be3a5966c38c7.tar.gz
fix error, port from systemd
Diffstat (limited to 'initcpio-install-systemd')
-rw-r--r--initcpio-install-systemd34
1 files changed, 30 insertions, 4 deletions
diff --git a/initcpio-install-systemd b/initcpio-install-systemd
index d8d30aa3d719..f6d0afdb8285 100644
--- a/initcpio-install-systemd
+++ b/initcpio-install-systemd
@@ -93,6 +93,13 @@ add_systemd_unit() {
fi
}
+add_systemd_drop_in() {
+ local unit=$1 dropin_name=$2
+
+ mkdir -p "$BUILDROOT/etc/systemd/system/$unit.d"
+ cat >"$BUILDROOT/etc/systemd/system/$unit.d/$2.conf"
+}
+
build() {
local rules unit
@@ -100,6 +107,7 @@ build() {
add_binary /bin/mount
add_binary /usr/bin/kmod /usr/bin/modprobe
add_binary /usr/lib/systemd/systemd /init
+ add_binary /usr/bin/sulogin
map add_binary \
/usr/bin/systemd-tmpfiles \
@@ -139,12 +147,15 @@ build() {
systemd-journald.service \
systemd-journald-audit.socket \
systemd-journald-dev-log.socket \
+ systemd-modules-load.service \
systemd-tmpfiles-setup-dev.service \
systemd-udev-trigger.service \
systemd-udevd-control.socket \
systemd-udevd-kernel.socket \
systemd-udevd.service \
- timers.target
+ timers.target \
+ rescue.target \
+ emergency.target
add_symlink "/usr/lib/systemd/system/default.target" "initrd.target"
add_symlink "/usr/lib/systemd/system/ctrl-alt-del.target" "reboot.target"
@@ -152,14 +163,29 @@ build() {
# udev wants /etc/group since it doesn't launch with --resolve-names=never
add_file "/etc/nsswitch.conf"
add_binary "$(readlink -f /usr/lib/libnss_files.so)"
- add_file "/etc/passwd"
- add_file "/etc/group"
+
+ echo "root:x:0:0:root:/:/bin/sh" >"$BUILDROOT/etc/passwd"
+ echo "root:x:0:root" >"$BUILDROOT/etc/group"
+ echo "root::::::::" >"$BUILDROOT/etc/shadow"
+
+ add_systemd_drop_in systemd-udevd.service resolve-names <<EOF
+[Service]
+ExecStart=
+ExecStart=/usr/lib/systemd/systemd-udevd --resolve-names=never
+EOF
+
+ add_dir "/etc/modules-load.d"
+ (
+ . "$_f_config"
+ set -f
+ printf "%s\n" $MODULES >"$BUILDROOT/etc/modules-load.d/MODULES.conf"
+ )
}
help() {
cat <<HELPEOF
This will install a basic systemd setup in your initramfs, and is meant to
-replace the 'base', 'usr', 'udev' and 'timestamp' hooks. Other hooks with runtime
+replace the 'base', 'usr', 'udev' and 'resume' hooks. Other hooks with runtime
components will need to be ported, and will not work as intended. You also may
wish to still include the 'base' hook (before this hook) to ensure that a
rescue shell exists on your initramfs.