From patchwork Sun Oct 29 18:19:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7299 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4SJPnf0rzfz3wvq for ; Sun, 29 Oct 2023 18:19:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4SJPnX2YzFz2xh; Sun, 29 Oct 2023 18:19:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4SJPnW4tZFz33gD; Sun, 29 Oct 2023 18:19:43 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4SJPnT75B3z2ypf for ; Sun, 29 Oct 2023 18:19:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4SJPnT1Zw3zyq; Sun, 29 Oct 2023 18:19:41 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1698603581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sYZtmlq7PndrktmOJAW7Kol6QmUcZb9Me12mVo/hSWw=; b=Dj+33BL70sF3DL3lGFGTeQ4OnDtzaC7ZDfEtj+AaoxTNT3rvDtVZMbkZnirsyT0+LqK4zZ HjxuR7F4TVDTKWCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1698603581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sYZtmlq7PndrktmOJAW7Kol6QmUcZb9Me12mVo/hSWw=; b=kFvCn6DDpjtavssE8BPZePuHiNlPit+zBi41KbRY7MK6XMOwj8eZb7SeLs59jbHzONx50L Mtfe/0JHcprrcwq2iEpbouZHKS+4+vH+C1111eoSQsvZWeuxNIEyTALRJw+aYQoK8VXpMW m6MueJOvtOsBH1McHUPMeDIYdltCfp8HsV5XMKZGCa6/yESRyFX8mxqfx/2Q0xCVPeSp3r Ev/62vp9Q0bp/kb7OOmQJtuQD9P+X2Y7IiiUqlgnqgOjdxfVLOyXSpV56I9pZ8vVXInWx1 aRcqhu8oNbFVidedjiNeP/k4tbsRXLAmJO+km3Ptt54PORLF10pvcFw398ORAw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCHv2 3/4] udev: Switch to udev from systemd Date: Sun, 29 Oct 2023 19:19:29 +0100 Message-Id: <20231029181930.3147-3-stefan.schantl@ipfire.org> In-Reply-To: <20231029181930.3147-1-stefan.schantl@ipfire.org> References: <20231029181930.3147-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: A6CLBSB7RBUKLCCWO2V2JVI7TOWJTHP5 X-Message-ID-Hash: A6CLBSB7RBUKLCCWO2V2JVI7TOWJTHP5 X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Stefan Schantl --- config/rootfiles/common/udev | 47 +++++++++++++---------- lfs/udev | 72 +++++++++++++++++++++++++----------- 2 files changed, 77 insertions(+), 42 deletions(-) diff --git a/config/rootfiles/common/udev b/config/rootfiles/common/udev index 876ae0c5a..3eea43718 100644 --- a/config/rootfiles/common/udev +++ b/config/rootfiles/common/udev @@ -15,6 +15,7 @@ etc/udev/hwdb.d/20-sdio-vendor-model.hwdb etc/udev/hwdb.d/20-usb-classes.hwdb etc/udev/hwdb.d/20-usb-vendor-model.hwdb etc/udev/hwdb.d/20-vmbus-class.hwdb +etc/udev/hwdb.d/60-autosuspend-chromiumos.hwdb etc/udev/hwdb.d/60-autosuspend-fingerprint-reader.hwdb etc/udev/hwdb.d/60-autosuspend.hwdb etc/udev/hwdb.d/60-evdev.hwdb @@ -29,38 +30,40 @@ etc/udev/hwdb.d/70-joystick.hwdb etc/udev/hwdb.d/70-mouse.hwdb etc/udev/hwdb.d/70-pda.hwdb etc/udev/hwdb.d/70-pointingstick.hwdb +etc/udev/hwdb.d/70-sound-card.hwdb etc/udev/hwdb.d/70-touchpad.hwdb etc/udev/hwdb.d/80-ieee1394-unit-function.hwdb +#etc/udev/hwdb.d/README #etc/udev/rules.d etc/udev/rules.d/55-lfs.rules -etc/udev/rules.d/81-cdrom.rules -etc/udev/rules.d/83-cdrom-symlinks.rules etc/udev/udev.conf +#lib/libudev.so lib/libudev.so.1 -lib/libudev.so.1.6.3 +lib/libudev.so.1.7.7 lib/udev lib/udev/ata_id lib/udev/cdrom_id -lib/udev/collect lib/udev/dmi_memory_id lib/udev/fido_id -lib/udev/init-net-rules.sh +lib/udev/hwdb.d +lib/udev/iocost lib/udev/mtd_probe lib/udev/network-aqm lib/udev/network-hotplug-bridges lib/udev/network-hotplug-rename lib/udev/network-hotplug-vlan lib/udev/network-offloading -lib/udev/rule_generator.functions #lib/udev/rules.d lib/udev/rules.d/25-alsa.rules lib/udev/rules.d/50-udev-default.rules lib/udev/rules.d/60-autosuspend.rules lib/udev/rules.d/60-block.rules lib/udev/rules.d/60-cdrom_id.rules +lib/udev/rules.d/60-dmi-id.rules lib/udev/rules.d/60-drm.rules lib/udev/rules.d/60-evdev.rules lib/udev/rules.d/60-fido-id.rules +lib/udev/rules.d/60-infiniband.rules lib/udev/rules.d/60-input-id.rules lib/udev/rules.d/60-net.rules lib/udev/rules.d/60-persistent-alsa.rules @@ -76,33 +79,37 @@ lib/udev/rules.d/70-camera.rules lib/udev/rules.d/70-joystick.rules lib/udev/rules.d/70-memory.rules lib/udev/rules.d/70-mouse.rules +lib/udev/rules.d/70-power-switch.rules lib/udev/rules.d/70-touchpad.rules +lib/udev/rules.d/70-uaccess.rules +lib/udev/rules.d/71-seat.rules +lib/udev/rules.d/73-seat-late.rules lib/udev/rules.d/75-net-description.rules lib/udev/rules.d/75-probe_mtd.rules lib/udev/rules.d/78-sound-card.rules lib/udev/rules.d/80-drivers.rules +lib/udev/rules.d/80-net-setup-link.rules lib/udev/rules.d/81-net-dhcp.rules +lib/udev/rules.d/90-iocost.rules lib/udev/rules.d/99-aqm.rules lib/udev/rules.d/99-offloading.rules +lib/udev/rules.d/99-systemd.rules +#lib/udev/rules.d/README lib/udev/scsi_id lib/udev/v4l_id -lib/udev/write_cd_rules -lib/udev/write_net_rules sbin/udevadm sbin/udevd +usr/bin/udev-hwdb #usr/include/libudev.h -#usr/include/udev.h -#usr/lib/libudev.la -#usr/lib/libudev.so #usr/lib/pkgconfig/libudev.pc -#usr/share/doc/udev-20171102 -#usr/share/doc/udev-20171102/lfs -#usr/share/doc/udev-20171102/lfs/55-lfs.txt -#usr/share/doc/udev-20171102/lfs/README -#usr/share/man/man5/udev.conf.5 -#usr/share/man/man7/hwdb.7 -#usr/share/man/man7/udev.7 -#usr/share/man/man8/udevadm.8 -#usr/share/man/man8/udevd.8 +usr/lib/udev +usr/lib/udev/init-net-rules.sh +usr/lib/udev/rule_generator.functions +usr/lib/udev/rules.d +usr/lib/udev/write_net_rules +#usr/share/doc/udev-20230818 +#usr/share/doc/udev-20230818/lfs +#usr/share/doc/udev-20230818/lfs/55-lfs.txt +#usr/share/doc/udev-20230818/lfs/README #usr/share/pkgconfig #usr/share/pkgconfig/udev.pc diff --git a/lfs/udev b/lfs/udev index 3a9c416b5..dba2aa05b 100644 --- a/lfs/udev +++ b/lfs/udev @@ -24,10 +24,10 @@ include Config -VER = 3.2.14 -RULES_VER = 20171102 +VER = 254 +RULES_VER = 20230818 -THISAPP = eudev-$(VER) +THISAPP = systemd-$(VER) DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) @@ -37,13 +37,13 @@ TARGET = $(DIR_INFO)/$(THISAPP) # Top-level Rules ############################################################################### -objects = $(DL_FILE) udev-lfs-$(RULES_VER).tar.bz2 +objects = $(DL_FILE) udev-lfs-$(RULES_VER).tar.xz $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -udev-lfs-$(RULES_VER).tar.bz2 = $(DL_FROM)/udev-lfs-$(RULES_VER).tar.bz2 +udev-lfs-$(RULES_VER).tar.xz = $(DL_FROM)/udev-lfs-$(RULES_VER).tar.xz -$(DL_FILE)_BLAKE2 = 7d68e77012288ecfac43be31f724224d371cb1084238fe045df248927eff854dbb391ad501e2a36d9b5ea4eb0a8cba3f9f21ea668908584a24c2a65df93ffdf8 -udev-lfs-$(RULES_VER).tar.bz2_BLAKE2 = b5fb8177a87719e28adc976b83953024dbcfb8739b0c2e61da186cbc4df5e75e62c888da987d15c64db164002bb0a1e66ce0ff206b143dc953d7571b66d5d5c0 +$(DL_FILE)_BLAKE2 = 4703ac102dd0003a2ef59dfd9b6fc6345b57cf1ff6397ebc71b3e9abb35ad5b891d114038a91eddba25b4ec81b8208a36691bc5490173b223ba35842cd1776d4 +udev-lfs-$(RULES_VER).tar.xz_BLAKE2 = e8c20bdddb5191381bad11bf46b0d605ce952afb697e8bf3e80b216c64eacbb327d0d961c5a1f49291576c82452e8472bb62f31f8bacc81eb832aa746a5234d4 install : $(TARGET) @@ -73,24 +73,52 @@ $(subst %,%_BLAKE2,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && tar axf $(DIR_DL)/udev-lfs-$(RULES_VER).tar.bz2 - cd $(DIR_APP) && ./configure \ + cd $(DIR_APP) && tar axf $(DIR_DL)/udev-lfs-$(RULES_VER).tar.xz + + # Remove two unneeded groups (render and sgx) from the default udev rules + cd $(DIR_APP) && sed -i -e 's/GROUP="render"/GROUP="video"/' \ + -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in + + # Remve udev rule which requires a full systemd installation + cd $(DIR_APP) && sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in + + # Prepare udev for build. + cd $(DIR_APP) && mkdir -pv build + cd $(DIR_APP)/build && meson setup \ --prefix=/usr \ - --bindir=/bin \ - --sbindir=/sbin \ - --sysconfdir=/etc \ - --libdir=/usr/lib \ - --libexecdir=/lib \ - --with-rootprefix= \ - --with-rootlibdir=/lib \ - --enable-manpages \ - --disable-static - - cd $(DIR_APP) && make $(MAKETUNING) - cd $(DIR_APP) && make install + --buildtype=release \ + -Dmode=release \ + -Ddev-kvm-mode=0660 \ + -Dlink-udev-shared=false \ + .. + + # Only build udev and required components + cd $(DIR_APP)/build && ninja udevadm systemd-hwdb \ + $$(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \ + build.ninja | awk '{ print $$2 }') \ + $$(realpath libudev.so --relative-to .) + + # Drop udev rules which requires a full systemd installation + cd $(DIR_APP)/build && rm -vf rules.d/90-vconsole.rules + + # Install udev + cd $(DIR_APP)/build && install -vm755 -d {/lib,/etc}/udev/{hwdb,rules}.d + cd $(DIR_APP)/build && install -vm755 -d /usr/{lib,share}/pkgconfig + cd $(DIR_APP)/build && install -vm755 udevadm /bin/ + cd $(DIR_APP)/build && install -vm755 systemd-hwdb /usr/bin/udev-hwdb + cd $(DIR_APP)/build && ln -svfn ../bin/udevadm /sbin/udevd + cd $(DIR_APP)/build && ln -svfn ../bin/udevadm /sbin/udevadm + cd $(DIR_APP)/build && cp -av libudev.so{,*[0-9]} /lib/ + cd $(DIR_APP)/build && install -vm644 ../src/libudev/libudev.h /usr/include/ + cd $(DIR_APP)/build && install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/ + cd $(DIR_APP)/build && install -vm644 src/udev/*.pc /usr/share/pkgconfig/ + cd $(DIR_APP)/build && install -vm644 ../src/udev/udev.conf /etc/udev/ + cd $(DIR_APP)/build && install -vm644 rules.d/* ../rules.d/{*.rules,README} /lib/udev/rules.d/ + cd $(DIR_APP)/build && install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /etc/udev/hwdb.d/ + cd $(DIR_APP)/build && install -vm755 $$(find src/udev -type f | grep -F -v ".") /lib/udev # Generate hardware database - udevadm hwdb --update + udev-hwdb update # Install rules cd $(DIR_APP) && make -f udev-lfs-$(RULES_VER)/Makefile.lfs install