From 05710de110ba32ed161cefe7bd3f4d91a4bcf058 Mon Sep 17 00:00:00 2001 From: eworm Date: Mon, 25 Oct 2021 19:45:06 +0000 Subject: [PATCH] upgpkg: systemd 249.5-3: update mkinitcpio udev hook git-svn-id: file:///srv/repos/svn-packages/svn@426540 eb2447ed-0c53-47e4-bac8-5bc4a241df78 --- trunk/PKGBUILD | 6 ++-- trunk/initcpio-install-systemd | 3 ++ trunk/initcpio-install-udev | 65 +++++++++++++++++++++++++++++----- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 78a6add16308..cae4b36a817e 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -7,7 +7,7 @@ pkgname=('systemd' 'systemd-libs' 'systemd-resolvconf' 'systemd-sysvcompat') _tag='f1d37a5c491d85255e9996960dc2889a15022b78' # git rev-parse v${_tag_name} _tag_name=249.5 pkgver="${_tag_name/-/}" -pkgrel=2 +pkgrel=3 arch=('x86_64') url='https://www.github.com/systemd/systemd' makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf' @@ -46,8 +46,8 @@ sha512sums=('SKIP' '10f3b477527ec263cc6465c84d94416e356435930edc9e26844a0fd4f71e87a27fa0f91ce24b43a22cacdd2ead5e760e9d607369bc537a8da8d34021302a89a1' '34541f1967536524329867f9f341f8d9250d9d771c60dc3e6a22ccb82fc01f103cfd3f9903329777591ccbecd2446622a5d6b3804fa0411482b85c70593ee8ad' 'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73' - 'f599e1a35cba2c4e83e37c2299fac23ae128d8f68081283e71e1729384975dee1c4b677787f31a17890aeb98c8d2fc90405a202644290708ef9c027315022b17' - 'a25b28af2e8c516c3a2eec4e64b8c7f70c21f974af4a955a4a9d45fd3e3ff0d2a98b4419fe425d47152d5acae77d64e69d8d014a7209524b75a81b0edb10bf3a' + '77582416df858e34bc05a9928ddacbe506d24946576cb7c08c7131cf2a9e059d8ff80b226684fc942bca2edf0c6d2584fa3e22939284b102b30395450784c4d3' + '8af5d7b1553be0cc193440dbb94683c2d2d777634dac4369716d75a1b2c2564551c836f3aee8220edfa5ef59122dea737bfe60c588637249bf67e15dba0534d0' '61032d29241b74a0f28446f8cf1be0e8ec46d0847a61dadb2a4f096e8686d5f57fe5c72bcf386003f6520bc4b5856c32d63bf3efe7eb0bc0deefc9f68159e648' 'c416e2121df83067376bcaacb58c05b01990f4614ad9de657d74b6da3efa441af251d13bf21e3f0f71ddcb4c9ea658b81da3d915667dc5c309c87ec32a1cb5a5' '5a1d78b5170da5abe3d18fdf9f2c3a4d78f15ba7d1ee9ec2708c4c9c2e28973469bc19386f70b3cf32ffafbe4fcc4303e5ebbd6d5187a1df3314ae0965b25e75' diff --git a/trunk/initcpio-install-systemd b/trunk/initcpio-install-systemd index 05ccb904fa90..f53ffb639e2d 100644 --- a/trunk/initcpio-install-systemd +++ b/trunk/initcpio-install-systemd @@ -1,5 +1,8 @@ #!/bin/bash +# This is in 'udev' and 'systemd' hook... Let's hope we have +# it in mkinitcpio soon. +# https://github.com/archlinux/mkinitcpio/pull/54 add_udev_rule() { # Add an udev rules file to the initcpio image. Dependencies on binaries # will be discovered and added. diff --git a/trunk/initcpio-install-udev b/trunk/initcpio-install-udev index 31d9827129e7..713fbf4cc7ea 100644 --- a/trunk/initcpio-install-udev +++ b/trunk/initcpio-install-udev @@ -1,18 +1,65 @@ #!/bin/bash +# This is in 'udev' and 'systemd' hook... Let's hope we have +# it in mkinitcpio soon. +# https://github.com/archlinux/mkinitcpio/pull/54 +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="$1" rule= key= value= binary= + + 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" /usr/lib/udev/rules.d/"${rules##*/}" + + while IFS=, read -ra rule; do + # skip empty lines, comments + [[ -z $rule || $rule = @(+([[:space:]])|#*) ]] && continue + + for pair in "${rule[@]}"; do + IFS=' =' read -r key value <<< "$pair" + case $key in + RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD}) + # strip quotes + binary=${value//[\"\']/} + # just take the first word as the binary name + binary=${binary%% *} + [[ ${binary:0:1} == '$' ]] && continue + if [[ ${binary:0:1} != '/' ]]; then + binary=$(PATH=/usr/lib/udev:/lib/udev type -P "$binary") + fi + add_binary "$binary" + ;; + esac + done + done <"$rules" +} + build() { local rules tool - add_binary /usr/lib/systemd/systemd-udevd - add_binary /usr/bin/udevadm - add_binary /usr/bin/systemd-tmpfiles + map add_binary \ + '/usr/lib/systemd/systemd-udevd' \ + '/usr/bin/udevadm' \ + '/usr/bin/systemd-tmpfiles' - for rules in 50-udev-default.rules 60-persistent-storage.rules 64-btrfs.rules 80-drivers.rules; do - add_file "/usr/lib/udev/rules.d/$rules" - done - for tool in ata_id scsi_id; do - add_file "/usr/lib/udev/$tool" - done + map add_udev_rule \ + '50-udev-default.rules' \ + '60-persistent-storage.rules' \ + '64-btrfs.rules' \ + '80-drivers.rules' + + map add_file \ + '/usr/lib/udev/ata_id' \ + '/usr/lib/udev/scsi_id' add_runscript }