Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: systemd 249.5-3: update mkinitcpio udev hook
Browse files Browse the repository at this point in the history
git-svn-id: file:///srv/repos/svn-packages/svn@426540 eb2447ed-0c53-47e4-bac8-5bc4a241df78
  • Loading branch information
eworm authored and svntogit committed Oct 25, 2021
1 parent 188ae69 commit 05710de
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 12 deletions.
6 changes: 3 additions & 3 deletions trunk/PKGBUILD
Expand Up @@ -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'
Expand Down Expand Up @@ -46,8 +46,8 @@ sha512sums=('SKIP'
'10f3b477527ec263cc6465c84d94416e356435930edc9e26844a0fd4f71e87a27fa0f91ce24b43a22cacdd2ead5e760e9d607369bc537a8da8d34021302a89a1'
'34541f1967536524329867f9f341f8d9250d9d771c60dc3e6a22ccb82fc01f103cfd3f9903329777591ccbecd2446622a5d6b3804fa0411482b85c70593ee8ad'
'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73'
'f599e1a35cba2c4e83e37c2299fac23ae128d8f68081283e71e1729384975dee1c4b677787f31a17890aeb98c8d2fc90405a202644290708ef9c027315022b17'
'a25b28af2e8c516c3a2eec4e64b8c7f70c21f974af4a955a4a9d45fd3e3ff0d2a98b4419fe425d47152d5acae77d64e69d8d014a7209524b75a81b0edb10bf3a'
'77582416df858e34bc05a9928ddacbe506d24946576cb7c08c7131cf2a9e059d8ff80b226684fc942bca2edf0c6d2584fa3e22939284b102b30395450784c4d3'
'8af5d7b1553be0cc193440dbb94683c2d2d777634dac4369716d75a1b2c2564551c836f3aee8220edfa5ef59122dea737bfe60c588637249bf67e15dba0534d0'
'61032d29241b74a0f28446f8cf1be0e8ec46d0847a61dadb2a4f096e8686d5f57fe5c72bcf386003f6520bc4b5856c32d63bf3efe7eb0bc0deefc9f68159e648'
'c416e2121df83067376bcaacb58c05b01990f4614ad9de657d74b6da3efa441af251d13bf21e3f0f71ddcb4c9ea658b81da3d915667dc5c309c87ec32a1cb5a5'
'5a1d78b5170da5abe3d18fdf9f2c3a4d78f15ba7d1ee9ec2708c4c9c2e28973469bc19386f70b3cf32ffafbe4fcc4303e5ebbd6d5187a1df3314ae0965b25e75'
Expand Down
3 changes: 3 additions & 0 deletions 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.
Expand Down
65 changes: 56 additions & 9 deletions 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
}
Expand Down

0 comments on commit 05710de

Please sign in to comment.