summarylogtreecommitdiffstats
path: root/initcpio-install-systemd
diff options
context:
space:
mode:
Diffstat (limited to 'initcpio-install-systemd')
-rw-r--r--initcpio-install-systemd35
1 files changed, 9 insertions, 26 deletions
diff --git a/initcpio-install-systemd b/initcpio-install-systemd
index c5b82b17d00b..05ccb904fa90 100644
--- a/initcpio-install-systemd
+++ b/initcpio-install-systemd
@@ -1,27 +1,21 @@
#!/bin/bash
-strip_quotes() {
- local len=${#1} quotes=$'[\'"]' str=${!1}
-
- if [[ ${str:0:1} = ${str: -1} && ${str:0:1} = $quotes ]]; then
- printf -v "$1" %s "${str:1:-1}"
- fi
-}
-
add_udev_rule() {
# Add an udev rules file to the initcpio image. Dependencies on binaries
# will be discovered and added.
# $1: path to rules file (or name of rules file)
- local rules= rule= key= value= binary=
+ local rules="$1" rule= key= value= binary=
- rules=$(PATH=/usr/lib/udev/rules.d:/lib/udev/rules.d type -P "$1")
+ if [[ ${rules:0:1} != '/' ]]; then
+ rules=$(PATH=/usr/lib/udev/rules.d:/lib/udev/rules.d type -P "$1")
+ fi
if [[ -z $rules ]]; then
# complain about not found rules
return 1
fi
- add_file "$rules"
+ add_file "$rules" /usr/lib/udev/rules.d/"${rules##*/}"
while IFS=, read -ra rule; do
# skip empty lines, comments
@@ -31,9 +25,10 @@ add_udev_rule() {
IFS=' =' read -r key value <<< "$pair"
case $key in
RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD})
- strip_quotes 'value'
+ # strip quotes
+ binary=${value//[\"\']/}
# just take the first word as the binary name
- binary=${value%% *}
+ binary=${binary%% *}
[[ ${binary:0:1} == '$' ]] && continue
if [[ ${binary:0:1} != '/' ]]; then
binary=$(PATH=/usr/lib/udev:/lib/udev type -P "$binary")
@@ -125,7 +120,6 @@ build() {
# udev rules and systemd units
map add_udev_rule "$rules" \
50-udev-default.rules \
- 60-fido-id.rules \
60-persistent-storage.rules \
64-btrfs.rules \
80-drivers.rules \
@@ -164,17 +158,6 @@ build() {
rescue.target \
emergency.target
- # add libraries dlopen()ed by systemd and its tools
- for LIB in fido2 tss2-{{esys,rc,mu},tcti-'*'}; do
- for FILE in $(find /usr/lib/ -maxdepth 1 -name "lib${LIB}.so*"); do
- if [[ -L "${FILE}" ]]; then
- add_symlink "${FILE}"
- else
- add_binary "${FILE}"
- fi
- done
- done
-
add_symlink "/usr/lib/systemd/system/default.target" "initrd.target"
add_symlink "/usr/lib/systemd/system/ctrl-alt-del.target" "reboot.target"
@@ -186,7 +169,7 @@ build() {
echo "root:x:0:0:root:/root:/bin/sh" >"$BUILDROOT/etc/passwd"
echo 'root:*:::::::' >"$BUILDROOT/etc/shadow"
- getent group root audio disk input kmem kvm lp optical render storage tty uucp video | awk -F: ' { print $1 ":x:" $3 ":" }' >"$BUILDROOT/etc/group"
+ getent group root audio disk input kmem kvm lp optical render sgx storage tty uucp video | awk -F: ' { print $1 ":x:" $3 ":" }' >"$BUILDROOT/etc/group"
add_dir "/etc/modules-load.d"
(