~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to lfs/udev

  • Committer: Michael Tremer
  • Author(s): Stefan Schantl
  • Date: 2023-10-30 09:53:48 UTC
  • Revision ID: git-v1:e174a9594bec95362a94d74e69530962d4e72a9e
udev: Switch to udev from systemd

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
include Config
26
26
 
27
 
VER        = 3.2.14
28
 
RULES_VER  = 20171102
 
27
VER        = 254
 
28
RULES_VER  = 20230818
29
29
 
30
 
THISAPP    = eudev-$(VER)
 
30
THISAPP    = systemd-$(VER)
31
31
DL_FILE    = $(THISAPP).tar.gz
32
32
DL_FROM    = $(URL_IPFIRE)
33
33
DIR_APP    = $(DIR_SRC)/$(THISAPP)
37
37
# Top-level Rules
38
38
###############################################################################
39
39
 
40
 
objects = $(DL_FILE) udev-lfs-$(RULES_VER).tar.bz2
 
40
objects = $(DL_FILE) udev-lfs-$(RULES_VER).tar.xz
41
41
 
42
42
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
43
 
udev-lfs-$(RULES_VER).tar.bz2 = $(DL_FROM)/udev-lfs-$(RULES_VER).tar.bz2
 
43
udev-lfs-$(RULES_VER).tar.xz = $(DL_FROM)/udev-lfs-$(RULES_VER).tar.xz
44
44
 
45
 
$(DL_FILE)_BLAKE2 = 7d68e77012288ecfac43be31f724224d371cb1084238fe045df248927eff854dbb391ad501e2a36d9b5ea4eb0a8cba3f9f21ea668908584a24c2a65df93ffdf8
46
 
udev-lfs-$(RULES_VER).tar.bz2_BLAKE2 = b5fb8177a87719e28adc976b83953024dbcfb8739b0c2e61da186cbc4df5e75e62c888da987d15c64db164002bb0a1e66ce0ff206b143dc953d7571b66d5d5c0
 
45
$(DL_FILE)_BLAKE2 = 4703ac102dd0003a2ef59dfd9b6fc6345b57cf1ff6397ebc71b3e9abb35ad5b891d114038a91eddba25b4ec81b8208a36691bc5490173b223ba35842cd1776d4
 
46
udev-lfs-$(RULES_VER).tar.xz_BLAKE2 = e8c20bdddb5191381bad11bf46b0d605ce952afb697e8bf3e80b216c64eacbb327d0d961c5a1f49291576c82452e8472bb62f31f8bacc81eb832aa746a5234d4
47
47
 
48
48
install : $(TARGET)
49
49
 
73
73
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
74
74
        @$(PREBUILD)
75
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.bz2
77
 
        cd $(DIR_APP) && ./configure \
 
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 \
78
88
                --prefix=/usr \
79
 
                --bindir=/bin \
80
 
                --sbindir=/sbin \
81
 
                --sysconfdir=/etc \
82
 
                --libdir=/usr/lib \
83
 
                --libexecdir=/lib \
84
 
                --with-rootprefix= \
85
 
                --with-rootlibdir=/lib \
86
 
                --enable-manpages \
87
 
                --disable-static
88
 
 
89
 
        cd $(DIR_APP) && make $(MAKETUNING)
90
 
        cd $(DIR_APP) && make install
 
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
91
119
 
92
120
        # Generate hardware database
93
 
        udevadm hwdb --update
 
121
        udev-hwdb update
94
122
 
95
123
        # Install rules
96
124
        cd $(DIR_APP) && make -f udev-lfs-$(RULES_VER)/Makefile.lfs install