Skip to content

Commit

Permalink
feat: replace eudev with systemd-udevd
Browse files Browse the repository at this point in the history
Unlike eudev systemd-udevd is actively maintained. Also add support for hwdb

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
  • Loading branch information
dsseng committed Sep 30, 2024
1 parent 40fb82a commit 232a153
Show file tree
Hide file tree
Showing 30 changed files with 2,902 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
- containerd
- cryptsetup
- dosfstools
- eudev
- fhs
- flannel-cni
- grub
Expand All @@ -37,6 +36,7 @@ spec:
- sd-boot
- socat
- syslinux
- systemd-udevd
- util-linux
- xfsprogs
# - kernel & dependent packages (out of tree kernel modules)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ TARGETS += cni
TARGETS += containerd
TARGETS += cryptsetup
TARGETS += dosfstools
TARGETS += eudev
TARGETS += fhs
TARGETS += flannel-cni
TARGETS += grub
Expand Down Expand Up @@ -79,6 +78,7 @@ TARGETS += runc
TARGETS += sd-boot
TARGETS += socat
TARGETS += syslinux
TARGETS += systemd-udevd
TARGETS += util-linux
TARGETS += xfsprogs
TARGETS += kernel
Expand Down
8 changes: 4 additions & 4 deletions Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ vars:
drbd_sha256: 016127238d5e0585130ec9558d991347e5360fb3c075283c62ea67f661bcd66b
drbd_sha512: 437e50d588b37aece7583eed06236c82931a41ab69f6835853fbeaf05125e4d5e0d1a81f501971e6773f86703d71d604ee3e1f0634faa9a03c3379d8297ed1cc

# renovate: datasource=github-releases depName=eudev-project/eudev
eudev_version: v3.2.14
eudev_sha256: c340e6c51dfc5531ac0c0fa84a34b72162acf525f9023eb9cf4931b782c8f177
eudev_sha512: b2d5e0d13e30c83cd15a12ada868242354691bb51eda365ace14b1b1a3942c2d0c9db7ba4ed89a3d4c87572f1f29d10d887fe45a8d257a88cba88270e75b3baf
# renovate: datasource=github-releases extractVersion=^v(?<version>.*)$ depName=systemd/systemd
systemd_version: 256.6
systemd_sha256: c085f162dec001407dd32f00abbf20b7e6ed7043dcfaf8ed954787d86707f409
systemd_sha512: 99d0fad02cab3559e081dabc2797d1d66bbc21daf9aaec847aeb6bce289456ff9c8599a34563c9bfa3826db36ae9ab30836b09bae00bf1a410b54d0bad9bd4dc

# renovate: datasource=github-releases depName=flannel-io/cni-plugin
flannel_cni_version: v1.5.1-flannel2
Expand Down
4 changes: 3 additions & 1 deletion cryptsetup/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
- stage: eudev # dependency for libdevmapper
- stage: systemd-udevd # dependency for libdevmapper
- stage: libcap # dependency for libudev
- stage: lvm2 # libdevmapper
- stage: util-linux # libuuid
- stage: libpopt
Expand All @@ -17,6 +18,7 @@ steps:
sha512: "{{ .cryptsetup_sha512 }}"
env:
PKG_CONFIG_PATH: /usr/lib/pkgconfig
LIBS: -lcap
prepare:
- |
tar -xzf cryptsetup.tar.gz --strip-components=1
Expand Down
56 changes: 0 additions & 56 deletions eudev/pkg.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion lvm2/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ shell: /toolchain/bin/bash
dependencies:
- stage: base
- stage: libaio
- stage: eudev
- stage: systemd-udevd
- stage: libcap # dependency for libudev
- stage: util-linux
steps:
- sources:
- url: https://mirrors.kernel.org/sourceware/lvm2/LVM2.{{ .lvm2_version | replace "_" "." }}.tgz
destination: lvm2.tar.gz
sha256: "{{ .lvm2_sha256 }}"
sha512: "{{ .lvm2_sha512 }}"
env:
LIBS: -lcap
prepare:
- |
tar -xzf lvm2.tar.gz --strip-components=1
Expand Down
2 changes: 1 addition & 1 deletion reproducibility/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- stage: containerd
- stage: cryptsetup
- stage: dosfstools
- stage: eudev
- stage: fhs
- stage: flannel-cni
- stage: grub
Expand All @@ -28,6 +27,7 @@ dependencies:
- stage: libselinux
- stage: libsepol
- stage: liburcu
- stage: systemd-udevd
# linux-firmware can be ignored from reproducibility test since it's a tarball downloaded and extracted (no build happens)
# - stage: linux-firmware
- stage: lvm2
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
From bc049f17be6eca828cc84861877d26092fea71a1 Mon Sep 17 00:00:00 2001
From: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
Date: Sat, 28 Sep 2024 19:09:54 +0200
Subject: [PATCH] chore: musl headers compatibility for udev

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
---
src/basic/linux/if.h | 2 +-
src/basic/linux/if_ether.h | 2 +-
src/basic/linux/libc-compat.h | 10 +++++++---
src/basic/linux/netdevice.h | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/basic/linux/if.h b/src/basic/linux/if.h
index e79f5c8ceb..7a885ea299 100644
--- a/src/basic/linux/if.h
+++ b/src/basic/linux/if.h
@@ -130,10 +130,10 @@ enum net_device_flags {
#define IFF_LOWER_UP IFF_LOWER_UP
#define IFF_DORMANT IFF_DORMANT
#define IFF_ECHO IFF_ECHO
-#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */

#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */

#define IF_GET_IFACE 0x0001 /* for querying only */
#define IF_GET_PROTO 0x0002
diff --git a/src/basic/linux/if_ether.h b/src/basic/linux/if_ether.h
index 69e0457eb2..4bf6341acf 100644
--- a/src/basic/linux/if_ether.h
+++ b/src/basic/linux/if_ether.h
@@ -166,7 +166,7 @@

/* allow libcs like musl to deactivate this, glibc does not implement this. */
#ifndef __UAPI_DEF_ETHHDR
-#define __UAPI_DEF_ETHHDR 1
+#define __UAPI_DEF_ETHHDR 0
#endif

#if __UAPI_DEF_ETHHDR
diff --git a/src/basic/linux/libc-compat.h b/src/basic/linux/libc-compat.h
index 8254c937c9..3e06d3eabb 100644
--- a/src/basic/linux/libc-compat.h
+++ b/src/basic/linux/libc-compat.h
@@ -172,18 +172,22 @@
* unsupported C libraries a way to opt out of any kernel definition. */
#else /* !defined(__GLIBC__) */

+#ifndef NI_IDN
+#define NI_IDN 0
+#endif
+
/* Definitions for if.h */
#ifndef __UAPI_DEF_IF_IFCONF
-#define __UAPI_DEF_IF_IFCONF 1
+#define __UAPI_DEF_IF_IFCONF 0
#endif
#ifndef __UAPI_DEF_IF_IFMAP
-#define __UAPI_DEF_IF_IFMAP 1
+#define __UAPI_DEF_IF_IFMAP 0
#endif
#ifndef __UAPI_DEF_IF_IFNAMSIZ
#define __UAPI_DEF_IF_IFNAMSIZ 1
#endif
#ifndef __UAPI_DEF_IF_IFREQ
-#define __UAPI_DEF_IF_IFREQ 1
+#define __UAPI_DEF_IF_IFREQ 0
#endif
/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
diff --git a/src/basic/linux/netdevice.h b/src/basic/linux/netdevice.h
index f3770c5b0f..6125206f33 100644
--- a/src/basic/linux/netdevice.h
+++ b/src/basic/linux/netdevice.h
@@ -31,7 +31,7 @@
#include <linux/if_packet.h>
#include <linux/if_link.h>

-
+#undef MAX_ADDR_LEN
#define MAX_ADDR_LEN 32 /* Largest hardware address length */

/* Initial net device group. All devices belong to group 0 by default. */
--
2.46.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
From 34b7e1ed3b9a896db6fad435fd141c385c7337d1 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 13:55:12 +0800
Subject: [PATCH 04/27] missing_type.h: add comparison_fn_t

Make it work with musl where comparison_fn_t and is not provided.

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
[Rebased for v244]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[Rebased for v242]
Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
[Rebased for v250, Drop __compare_fn_t]
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
---
src/basic/missing_type.h | 4 ++++
src/basic/sort-util.h | 1 +
src/libsystemd/sd-journal/catalog.c | 1 +
3 files changed, 6 insertions(+)

diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
index 1d17705c35..fc33b76ec1 100644
--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -10,3 +10,7 @@
#if !HAVE_CHAR16_T
# define char16_t uint16_t
#endif
+
+#ifndef __GLIBC__
+typedef int (*comparison_fn_t)(const void *, const void *);
+#endif
diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h
index 9c818bd747..ef10c8be2c 100644
--- a/src/basic/sort-util.h
+++ b/src/basic/sort-util.h
@@ -4,6 +4,7 @@
#include <stdlib.h>

#include "macro.h"
+#include "missing_type.h"

/* This is the same as glibc's internal __compar_d_fn_t type. glibc exports a public comparison_fn_t, for the
* external type __compar_fn_t, but doesn't do anything similar for __compar_d_fn_t. Let's hence do that
diff --git a/src/libsystemd/sd-journal/catalog.c b/src/libsystemd/sd-journal/catalog.c
index a0b673f65f..29dd2fee16 100644
--- a/src/libsystemd/sd-journal/catalog.c
+++ b/src/libsystemd/sd-journal/catalog.c
@@ -29,6 +29,7 @@
#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
+#include "missing_type.h"

const char * const catalog_file_dirs[] = {
"/usr/local/lib/systemd/catalog/",
--
2.45.1
Loading

0 comments on commit 232a153

Please sign in to comment.