]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame_incremental - lfs/udev
wget: Update to version 1.24.5
[people/pmueller/ipfire-2.x.git] / lfs / udev
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
27VER = 254
28RULES_VER = 20230818
29
30THISAPP = systemd-$(VER)
31DL_FILE = $(THISAPP).tar.gz
32DL_FROM = $(URL_IPFIRE)
33DIR_APP = $(DIR_SRC)/$(THISAPP)
34TARGET = $(DIR_INFO)/$(THISAPP)
35
36###############################################################################
37# Top-level Rules
38###############################################################################
39
40objects = $(DL_FILE) udev-lfs-$(RULES_VER).tar.xz
41
42$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
43udev-lfs-$(RULES_VER).tar.xz = $(DL_FROM)/udev-lfs-$(RULES_VER).tar.xz
44
45$(DL_FILE)_BLAKE2 = 4703ac102dd0003a2ef59dfd9b6fc6345b57cf1ff6397ebc71b3e9abb35ad5b891d114038a91eddba25b4ec81b8208a36691bc5490173b223ba35842cd1776d4
46udev-lfs-$(RULES_VER).tar.xz_BLAKE2 = e8c20bdddb5191381bad11bf46b0d605ce952afb697e8bf3e80b216c64eacbb327d0d961c5a1f49291576c82452e8472bb62f31f8bacc81eb832aa746a5234d4
47
48install : $(TARGET)
49
50check : $(patsubst %,$(DIR_CHK)/%,$(objects))
51
52download :$(patsubst %,$(DIR_DL)/%,$(objects))
53
54b2 : $(subst %,%_BLAKE2,$(objects))
55
56###############################################################################
57# Downloading, checking, b2sum
58###############################################################################
59
60$(patsubst %,$(DIR_CHK)/%,$(objects)) :
61 @$(CHECK)
62
63$(patsubst %,$(DIR_DL)/%,$(objects)) :
64 @$(LOAD)
65
66$(subst %,%_BLAKE2,$(objects)) :
67 @$(B2SUM)
68
69###############################################################################
70# Installation Details
71###############################################################################
72
73$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
74 @$(PREBUILD)
75 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
76 cd $(DIR_APP) && tar axf $(DIR_DL)/udev-lfs-$(RULES_VER).tar.xz
77
78 # Remove two unneeded groups (render and sgx) from the default udev rules
79 cd $(DIR_APP) && sed -i -e 's/GROUP="render"/GROUP="video"/' \
80 -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in
81
82 # Remve udev rule which requires a full systemd installation
83 cd $(DIR_APP) && sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in
84
85 # Prepare udev for build.
86 cd $(DIR_APP) && mkdir -pv build
87 cd $(DIR_APP)/build && meson setup \
88 --prefix=/usr \
89 --buildtype=release \
90 -Dmode=release \
91 -Ddev-kvm-mode=0660 \
92 -Dlink-udev-shared=false \
93 ..
94
95 # Only build udev and required components
96 cd $(DIR_APP)/build && ninja udevadm systemd-hwdb \
97 $$(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \
98 build.ninja | awk '{ print $$2 }') \
99 $$(realpath libudev.so --relative-to .)
100
101 # Drop udev rules which requires a full systemd installation
102 cd $(DIR_APP)/build && rm -vf rules.d/90-vconsole.rules
103
104 # Install udev
105 cd $(DIR_APP)/build && install -vm755 -d {/lib,/etc}/udev/{hwdb,rules}.d
106 cd $(DIR_APP)/build && install -vm755 -d /usr/{lib,share}/pkgconfig
107 cd $(DIR_APP)/build && install -vm755 udevadm /bin/
108 cd $(DIR_APP)/build && install -vm755 systemd-hwdb /usr/bin/udev-hwdb
109 cd $(DIR_APP)/build && ln -svfn ../bin/udevadm /sbin/udevd
110 cd $(DIR_APP)/build && ln -svfn ../bin/udevadm /sbin/udevadm
111 cd $(DIR_APP)/build && cp -av libudev.so{,*[0-9]} /lib/
112 cd $(DIR_APP)/build && install -vm644 ../src/libudev/libudev.h /usr/include/
113 cd $(DIR_APP)/build && install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
114 cd $(DIR_APP)/build && install -vm644 src/udev/*.pc /usr/share/pkgconfig/
115 cd $(DIR_APP)/build && install -vm644 ../src/udev/udev.conf /etc/udev/
116 cd $(DIR_APP)/build && install -vm644 rules.d/* ../rules.d/{*.rules,README} /lib/udev/rules.d/
117 cd $(DIR_APP)/build && install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /etc/udev/hwdb.d/
118 cd $(DIR_APP)/build && install -vm755 $$(find src/udev -type f | grep -F -v ".") /lib/udev
119
120 # Generate hardware database
121 udev-hwdb update
122
123 # Install rules
124 cd $(DIR_APP) && make -f udev-lfs-$(RULES_VER)/Makefile.lfs install
125
126 # Disable net generator rule. This does not work with the setup.
127 rm -f /lib/udev/rules.d/75-persistent-net-generator.rules
128 rm -f /lib/udev/rules.d/80-net-name-slot.rules
129
130 # Blacklist some modules
131 cp -vf $(DIR_SRC)/config/udev/blacklist.conf \
132 /etc/modprobe.d/blacklist.conf
133
134 # Install config file
135 install -v -m 644 $(DIR_SRC)/config/udev/udev.conf \
136 /etc/udev/
137
138 # Install alsa rules.
139 install -v -m 644 $(DIR_SRC)/config/udev/25-alsa.rules \
140 /lib/udev/rules.d
141
142 # Install network rules.
143 install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-rename \
144 /lib/udev/network-hotplug-rename
145 install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-vlan \
146 /lib/udev/network-hotplug-vlan
147 install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-bridges \
148 /lib/udev/network-hotplug-bridges
149 install -v -m 644 $(DIR_SRC)/config/udev/60-net.rules \
150 /lib/udev/rules.d
151
152 # Install ExtraHD rules
153 install -v -m 644 $(DIR_SRC)/config/udev/61-extrahd.rules \
154 /lib/udev/rules.d
155
156 # Install AQM rules
157 install -v -m 644 $(DIR_SRC)/config/udev/99-aqm.rules \
158 /lib/udev/rules.d
159 install -m 755 $(DIR_SRC)/config/udev/network-aqm \
160 /lib/udev/network-aqm
161
162 # Install offloading rules
163 install -v -m 644 $(DIR_SRC)/config/udev/99-offloading.rules \
164 /lib/udev/rules.d
165 install -m 755 $(DIR_SRC)/config/udev/network-offloading \
166 /lib/udev/network-offloading
167
168 @rm -rf $(DIR_APP)
169 @$(POSTBUILD)