mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
commit d19b71301d08db94341eae1d62500a928a8f6712 Author: Arne Fitzenreiter <arne_f@ipfire.org> Date: Thu Dec 26 10:19:20 2024 +0100 udev: patch to handle pidfs and bcachefs this is needed to build udev with kernel 6.12 headers Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org> fix: https://github.com/vincentmli/BPFire/issues/89 Reported-by: Harvey Li <lhw365@gmail.com> Signd-off-by: Vincent Li <vincent.mc.li@gmail.com>
171 lines
7.0 KiB
Plaintext
171 lines
7.0 KiB
Plaintext
###############################################################################
|
|
# #
|
|
# IPFire.org - A linux based firewall #
|
|
# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
|
|
# #
|
|
# This program is free software: you can redistribute it and/or modify #
|
|
# it under the terms of the GNU General Public License as published by #
|
|
# the Free Software Foundation, either version 3 of the License, or #
|
|
# (at your option) any later version. #
|
|
# #
|
|
# This program is distributed in the hope that it will be useful, #
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
|
# GNU General Public License for more details. #
|
|
# #
|
|
# You should have received a copy of the GNU General Public License #
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
|
# #
|
|
###############################################################################
|
|
|
|
###############################################################################
|
|
# Definitions
|
|
###############################################################################
|
|
|
|
include Config
|
|
|
|
VER = 254
|
|
RULES_VER = 20230818
|
|
|
|
THISAPP = systemd-$(VER)
|
|
DL_FILE = $(THISAPP).tar.gz
|
|
DL_FROM = $(URL_IPFIRE)
|
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
|
|
|
###############################################################################
|
|
# Top-level Rules
|
|
###############################################################################
|
|
|
|
objects = $(DL_FILE) udev-lfs-$(RULES_VER).tar.xz
|
|
|
|
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
|
udev-lfs-$(RULES_VER).tar.xz = $(DL_FROM)/udev-lfs-$(RULES_VER).tar.xz
|
|
|
|
$(DL_FILE)_BLAKE2 = 4703ac102dd0003a2ef59dfd9b6fc6345b57cf1ff6397ebc71b3e9abb35ad5b891d114038a91eddba25b4ec81b8208a36691bc5490173b223ba35842cd1776d4
|
|
udev-lfs-$(RULES_VER).tar.xz_BLAKE2 = e8c20bdddb5191381bad11bf46b0d605ce952afb697e8bf3e80b216c64eacbb327d0d961c5a1f49291576c82452e8472bb62f31f8bacc81eb832aa746a5234d4
|
|
|
|
install : $(TARGET)
|
|
|
|
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
|
|
|
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
|
|
|
b2 : $(subst %,%_BLAKE2,$(objects))
|
|
|
|
###############################################################################
|
|
# Downloading, checking, b2sum
|
|
###############################################################################
|
|
|
|
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
|
@$(CHECK)
|
|
|
|
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
|
@$(LOAD)
|
|
|
|
$(subst %,%_BLAKE2,$(objects)) :
|
|
@$(B2SUM)
|
|
|
|
###############################################################################
|
|
# Installation Details
|
|
###############################################################################
|
|
|
|
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|
@$(PREBUILD)
|
|
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/systemd-254-linux-6.12-fs.patch
|
|
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 \
|
|
--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
|
|
udev-hwdb update
|
|
|
|
# Install rules
|
|
cd $(DIR_APP) && make -f udev-lfs-$(RULES_VER)/Makefile.lfs install
|
|
|
|
# Disable net generator rule. This does not work with the setup.
|
|
rm -f /lib/udev/rules.d/75-persistent-net-generator.rules
|
|
rm -f /lib/udev/rules.d/80-net-name-slot.rules
|
|
|
|
# Blacklist some modules
|
|
cp -vf $(DIR_SRC)/config/udev/blacklist.conf \
|
|
/etc/modprobe.d/blacklist.conf
|
|
|
|
# Install config file
|
|
install -v -m 644 $(DIR_SRC)/config/udev/udev.conf \
|
|
/etc/udev/
|
|
|
|
# Install alsa rules.
|
|
install -v -m 644 $(DIR_SRC)/config/udev/25-alsa.rules \
|
|
/lib/udev/rules.d
|
|
|
|
# Install network rules.
|
|
install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-rename \
|
|
/lib/udev/network-hotplug-rename
|
|
install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-vlan \
|
|
/lib/udev/network-hotplug-vlan
|
|
install -v -m 755 $(DIR_SRC)/config/udev/network-hotplug-bridges \
|
|
/lib/udev/network-hotplug-bridges
|
|
install -v -m 644 $(DIR_SRC)/config/udev/60-net.rules \
|
|
/lib/udev/rules.d
|
|
|
|
# Install ExtraHD rules
|
|
install -v -m 644 $(DIR_SRC)/config/udev/61-extrahd.rules \
|
|
/lib/udev/rules.d
|
|
|
|
# Install AQM rules
|
|
install -v -m 644 $(DIR_SRC)/config/udev/99-aqm.rules \
|
|
/lib/udev/rules.d
|
|
install -m 755 $(DIR_SRC)/config/udev/network-aqm \
|
|
/lib/udev/network-aqm
|
|
|
|
# Install offloading rules
|
|
install -v -m 644 $(DIR_SRC)/config/udev/99-offloading.rules \
|
|
/lib/udev/rules.d
|
|
install -m 755 $(DIR_SRC)/config/udev/network-offloading \
|
|
/lib/udev/network-offloading
|
|
|
|
@rm -rf $(DIR_APP)
|
|
@$(POSTBUILD)
|