Commit f91793b4 authored by Daniel Reurich's avatar Daniel Reurich

refreshed patches

parent 0f3aafae
......@@ -8,10 +8,10 @@ Based on debian/patches/udev_conf_comments from the old udev package.
src/udev/udev.conf | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/udev/udev.conf b/src/udev/udev.conf
index 47d1433..b7a42ab 100644
--- a/src/udev/udev.conf
+++ b/src/udev/udev.conf
Index: eudev/src/udev/udev.conf
===================================================================
--- eudev.orig/src/udev/udev.conf
+++ eudev/src/udev/udev.conf
@@ -1,3 +1,6 @@
# see udev.conf(5) for details
+#
......
......@@ -11,13 +11,13 @@ rootlibexecdir).
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 480d22a..725e54b 100644
--- a/configure.ac
+++ b/configure.ac
Index: eudev/configure.ac
===================================================================
--- eudev.orig/configure.ac
+++ eudev/configure.ac
@@ -168,7 +168,7 @@ AS_IF(
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_SUBST([rootprefix], [${with_rootprefix}])
AC_SUBST([rootlibdir], [${with_rootlibdir}])
AC_SUBST([rootlibexecdir], [${with_rootlibexecdir}])
-AC_SUBST([udevlibexecdir], [${rootlibexecdir}])
+AC_SUBST([udevlibexecdir], [${rootprefix}/lib/udev])
......
......@@ -12,11 +12,11 @@ Anto:This patch is based on the following (adds in eudev-only rule):
rules/80-drivers.rules | 1 +
1 file changed, 1 insertion(+)
diff --git a/rules/80-drivers.rules b/rules/80-drivers.rules
index 8551f47..f764075 100644
--- a/rules/80-drivers.rules
+++ b/rules/80-drivers.rules
@@ -9,5 +9,6 @@ SUBSYSTEM=="memstick", RUN{builtin}+="kmod load ms_block mspro_block"
Index: eudev/rules/80-drivers.rules
===================================================================
--- eudev.orig/rules/80-drivers.rules
+++ eudev/rules/80-drivers.rules
@@ -9,5 +9,6 @@ SUBSYSTEM=="memstick", RUN{builtin}+="km
SUBSYSTEM=="i2o", RUN{builtin}+="kmod load i2o_block"
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev"
KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl"
......
......@@ -15,10 +15,10 @@ but applied to rules/60-block.rules
rules/60-block.rules | 1 +
1 file changed, 1 insertion(+)
diff --git a/rules/60-block.rules b/rules/60-block.rules
index 5e38e12..bf94dcb 100644
--- a/rules/60-block.rules
+++ b/rules/60-block.rules
Index: eudev/rules/60-block.rules
===================================================================
--- eudev.orig/rules/60-block.rules
+++ eudev/rules/60-block.rules
@@ -3,6 +3,7 @@
# enable in-kernel media-presence polling
ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", \
......
......@@ -12,10 +12,10 @@ Index: eudev/rules/50-udev-default.rules
===================================================================
--- eudev.orig/rules/50-udev-default.rules
+++ eudev/rules/50-udev-default.rules
@@ -24,8 +24,11 @@ SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*
@@ -23,8 +23,11 @@ SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*
SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
+KERNEL=="mISDNtimer", GROUP="dialout"
+KERNEL=="mwave", GROUP="dialout"
......@@ -24,7 +24,7 @@ Index: eudev/rules/50-udev-default.rules
SUBSYSTEM=="input", GROUP="input"
SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"
@@ -59,7 +62,7 @@ SUBSYSTEM=="block", KERNEL=="sr[0-9]*",
@@ -61,7 +64,7 @@ SUBSYSTEM=="block", KERNEL=="sr[0-9]*",
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
KERNEL=="sch[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
......@@ -33,9 +33,9 @@ Index: eudev/rules/50-udev-default.rules
SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
@@ -76,4 +79,13 @@ KERNEL=="tun", MODE="0666", OPTIONS+="st
@@ -83,4 +86,13 @@ KERNEL=="kvm", GROUP="kvm", MODE="0666",
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm"
+# not the ideal group, but backwards compatibility with previous Debian versions
+KERNEL=="lirc[0-9]*", GROUP="video"
......
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sat, 26 Apr 2014 16:11:09 +0200
Subject: Updates to default device permissions
Taken from the previous Debian specific rules, this is the remaining difference
over the upstream 50-udev-default.rules.
---
rules/50-udev-default.rules | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
index e9eeb85..295d58c 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules
@@ -24,8 +24,11 @@ SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
+KERNEL=="mISDNtimer", GROUP="dialout"
+KERNEL=="mwave", GROUP="dialout"
SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
+KERNEL=="nvram", GROUP="kmem", MODE="0640"
SUBSYSTEM=="input", GROUP="input"
SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"
@@ -57,7 +60,7 @@ SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
KERNEL=="sch[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
-KERNEL=="pktcdvd", GROUP="cdrom"
+KERNEL=="pktcdvd", GROUP="cdrom", MODE="0644"
SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
@@ -74,4 +77,13 @@ KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
+# not the ideal group, but backwards compatibility with previous Debian versions
+KERNEL=="lirc[0-9]*", GROUP="video"
+
+KERNEL=="legousbtower*", MODE="0666"
+KERNEL=="sonypi", MODE="0666"
+KERNEL=="mmtimer", MODE="0644"
+KERNEL=="sgi_*", MODE="0666"
+KERNEL=="z90crypt", MODE="0666"
+
LABEL="default_end"
......@@ -9,10 +9,10 @@ Subject: Add support for generation of hwdb(7) in man/* from hwdb.xml
3 files changed, 88 insertions(+)
create mode 100644 man/hwdb.xml
diff --git a/man/Makefile.am b/man/Makefile.am
index 4d7b45f..cfeeb47 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
Index: eudev/man/Makefile.am
===================================================================
--- eudev.orig/man/Makefile.am
+++ eudev/man/Makefile.am
@@ -1,6 +1,7 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
......@@ -29,11 +29,10 @@ index 4d7b45f..cfeeb47 100644
udev.7 \
udev.conf.5 \
udevd.8 \
diff --git a/man/hwdb.xml b/man/hwdb.xml
new file mode 100644
index 0000000..2b1e60f
Index: eudev/man/hwdb.xml
===================================================================
--- /dev/null
+++ b/man/hwdb.xml
+++ eudev/man/hwdb.xml
@@ -0,0 +1,85 @@
+<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
......@@ -120,10 +119,10 @@ index 0000000..2b1e60f
+ </para>
+ </refsect1>
+</refentry>
diff --git a/man/make.sh b/man/make.sh
index ca98f60..bb4363a 100755
--- a/man/make.sh
+++ b/man/make.sh
Index: eudev/man/make.sh
===================================================================
--- eudev.orig/man/make.sh
+++ eudev/man/make.sh
@@ -15,6 +15,7 @@ xslt_proc() {
}
......
From: Marco d'Itri <md@linux.it>
Date: Sat, 26 Apr 2014 19:30:41 +0200
Subject: more cd aliases
Add more aliases for CD/DVD devices.
---
rules/60-cdrom_id.rules | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/rules/60-cdrom_id.rules b/rules/60-cdrom_id.rules
index 61ab013..2ad86e4 100644
--- a/rules/60-cdrom_id.rules
+++ b/rules/60-cdrom_id.rules
@@ -15,6 +15,12 @@ ENV{DISK_EJECT_REQUEST}=="?*", RUN+="/usr/bin/eject $devnode", GOTO="cdrom_end"
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $devnode"
-KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
+# These rules will create symlinks for the CD/DVD reader, to help old
+# programs which are unable to automatically discover the devices.
+# The results are undefined for system with multiple CD/DVD devices.
+ENV{ID_CDROM}=="?*", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
+ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw", OPTIONS+="link_priority=-100"
+ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd", OPTIONS+="link_priority=-100"
+ENV{ID_CDROM_DVD_RW}=="?*", SYMLINK+="dvdrw", OPTIONS+="link_priority=-100"
LABEL="cdrom_end"
From: Anto <aryanto@chello.at>
Date: Tue, 30 May 2017 22:56:19 +0200
Subject: remove-cdrom_id.rules-commit
Notes - Added for eudev-3.0 - Anto
Remove commit https://github.com/gentoo/eudev/commit/681b0e3876ba6ed10efbc139c0d4346446500e07
---
rules/60-cdrom_id.rules | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/rules/60-cdrom_id.rules b/rules/60-cdrom_id.rules
index 5c3b52e..61ab013 100644
--- a/rules/60-cdrom_id.rules
+++ b/rules/60-cdrom_id.rules
@@ -9,17 +9,12 @@ ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
# media eject button pressed
-ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"
+ENV{DISK_EJECT_REQUEST}=="?*", RUN+="/usr/bin/eject $devnode", GOTO="cdrom_end"
# import device and media properties and lock tray to
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $devnode"
-# ejecting a CD does not remove the device node, so mark the systemd device
-# unit as inactive while there is no medium; this automatically cleans up of
-# stale mounts after ejecting
-ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0"
-
KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
LABEL="cdrom_end"
From: Ivan J. <parazyd@dyne.org>
Date: Sun, 20 Aug 2017 14:50:00 +0200
Subject: Reverse net-ifnames logic
Reverse the logic of 80-net-name-slot.rules to give back the consistent
eth0, wlan0 naming rather than the new enp0s3, wl... naming, making it
opt-in.
---
rules/80-net-name-slot.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rules/80-net-name-slot.rules b/rules/80-net-name-slot.rules
index c5f1b3885..4738e533f 100644
--- a/rules/80-net-name-slot.rules
+++ b/rules/80-net-name-slot.rules
@@ -5,7 +5,7 @@ SUBSYSTEM!="net", GOTO="net_name_slot_end"
NAME!="", GOTO="net_name_slot_end"
IMPORT{cmdline}="net.ifnames"
-ENV{net.ifnames}=="0", GOTO="net_name_slot_end"
+ENV{net.ifnames}!="1", GOTO="net_name_slot_end"
NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Fri, 17 Oct 2014 15:01:01 +0200
Subject: udev hwdb: Support shipping pre-compiled database in system images
In some cases it is preferable to ship system images with a pre-generated
binary hwdb database, to avoid having to build it at runtime, avoid shipping
the source hwdb files, or avoid storing large binary files in /etc.
So if hwdb.bin does not exist in /etc/udev/, fall back to looking for it in
UDEVLIBEXECDIR. This keeps the possibility to add files to /etc/udev/hwdb.d/
and re-generating the database which trumps the one in /usr/lib.
Add a new --usr flag to "udevadm hwdb --update" which puts the database
into UDEVLIBEXECDIR.
Adjust systemd-udev-hwdb-update.service to not generate the file in /etc if we
already have it in /usr.
Anto:
---
man/udev.xml | 4 +++-
man/udevadm.xml | 9 +++++++++
src/libudev/Makefile.am | 1 +
src/libudev/libudev-hwdb.c | 42 ++++++++++++++++++++++++++++++++++++------
src/udev/udevadm-hwdb.c | 13 ++++++++++++-
5 files changed, 61 insertions(+), 8 deletions(-)
diff --git a/man/udev.xml b/man/udev.xml
index d1ade24..fd62adc 100644
--- a/man/udev.xml
+++ b/man/udev.xml
@@ -763,7 +763,9 @@
<para>The content of all hwdb files is read by
<citerefentry><refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- and compiled to a binary database located at <filename>/etc/udev/hwdb.bin</filename>.
+ and compiled to a binary database located at <filename>/etc/udev/hwdb.bin</filename>,
+ or alternatively <filename>/lib/udev/hwdb.bin</filename> if you want ship the compiled
+ database in an immutable image.
During runtime only the binary database is used.</para>
</refsect1>
diff --git a/man/udevadm.xml b/man/udevadm.xml
index 649d808..efd0111 100644
--- a/man/udevadm.xml
+++ b/man/udevadm.xml
@@ -529,6 +529,15 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--usr</option></term>
+ <listitem>
+ <para>Put the compiled database into <filename>/usr/lib/udev/hwdb.bin</filename> instead.
+ Use this if you want to ship a pre-compiled database in immutable system images, or
+ don't use <filename>/etc/udev/hwdb.d</filename> and want to avoid large binary files in
+ <filename>/etc</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-t</option></term>
<term><option>--test=<replaceable>string</replaceable></option></term>
<listitem>
diff --git a/src/libudev/Makefile.am b/src/libudev/Makefile.am
index 0edb873..dd88445 100644
--- a/src/libudev/Makefile.am
+++ b/src/libudev/Makefile.am
@@ -20,6 +20,7 @@ AM_CPPFLAGS = \
-DUDEV_CONF_FILE=\"$(udevconffile)\" \
-DUDEV_HWDB_BIN=\"$(udevhwdbbin)\" \
-DUDEV_VERSION=$(UDEV_VERSION) \
+ -DUDEV_LIBEXEC_DIR=\"$(udevlibexecdir)\" \
-I $(top_srcdir)/src/shared
lib_LTLIBRARIES = \
diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c
index 951205c..7691045 100644
--- a/src/libudev/libudev-hwdb.c
+++ b/src/libudev/libudev-hwdb.c
@@ -256,6 +256,11 @@ static int trie_search_f(struct udev_hwdb *hwdb, const char *search) {
return 0;
}
+static const char hwdb_bin_paths[] =
+ "/etc/udev/hwdb.bin\0"
+ UDEV_LIBEXEC_DIR "/hwdb.bin\0";
+
+
/**
* udev_hwdb_new:
* @udev: udev library context
@@ -266,6 +271,7 @@ static int trie_search_f(struct udev_hwdb *hwdb, const char *search) {
**/
_public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) {
struct udev_hwdb *hwdb;
+ const char *hwdb_bin_path;
const char sig[] = HWDB_SIG;
hwdb = new0(struct udev_hwdb, 1);
@@ -275,30 +281,43 @@ _public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) {
hwdb->refcount = 1;
udev_list_init(udev, &hwdb->properties_list, true);
- hwdb->f = fopen(UDEV_HWDB_BIN, "re");
+ /* find hwdb.bin in hwdb_bin_paths */
+ NULSTR_FOREACH(hwdb_bin_path, hwdb_bin_paths) {
+ hwdb->f = fopen(hwdb_bin_path, "re");
+ if (hwdb->f)
+ break;
+ else if (errno == ENOENT)
+ continue;
+ else {
+ log_debug("error reading %s", hwdb_bin_path);
+ udev_hwdb_unref(hwdb);
+ return NULL;
+ }
+ }
+
if (!hwdb->f) {
- log_debug(UDEV_HWDB_BIN " does not exist, please run udevadm hwdb --update");
+ log_debug("%s does not exist, please run udevadm hwdb --update", hwdb_bin_path);
udev_hwdb_unref(hwdb);
return NULL;
}
if (fstat(fileno(hwdb->f), &hwdb->st) < 0 ||
(size_t)hwdb->st.st_size < offsetof(struct trie_header_f, strings_len) + 8) {
- log_debug_errno(errno, "error reading " UDEV_HWDB_BIN ": %m");
+ log_debug_errno(errno, "error reading %s: %m", hwdb_bin_path);
udev_hwdb_unref(hwdb);
return NULL;
}
hwdb->map = mmap(0, hwdb->st.st_size, PROT_READ, MAP_SHARED, fileno(hwdb->f), 0);
if (hwdb->map == MAP_FAILED) {
- log_debug_errno(errno, "error mapping " UDEV_HWDB_BIN ": %m");
+ log_debug_errno(errno, "error mapping %s: %m", hwdb_bin_path);
udev_hwdb_unref(hwdb);
return NULL;
}
if (memcmp(hwdb->map, sig, sizeof(hwdb->head->signature)) != 0 ||
(size_t)hwdb->st.st_size != le64toh(hwdb->head->file_size)) {
- log_debug("error recognizing the format of " UDEV_HWDB_BIN);
+ log_debug("error recognizing the format of %s", hwdb_bin_path);
udev_hwdb_unref(hwdb);
return NULL;
}
@@ -352,13 +371,24 @@ _public_ struct udev_hwdb *udev_hwdb_unref(struct udev_hwdb *hwdb) {
}
bool udev_hwdb_validate(struct udev_hwdb *hwdb) {
+ bool found = false;
+ const char* p;
struct stat st;
if (!hwdb)
return false;
if (!hwdb->f)
return false;
- if (stat("/etc/udev/hwdb.bin", &st) < 0)
+
+ /* if hwdb.bin doesn't exist anywhere, we need to update */
+ NULSTR_FOREACH(p, hwdb_bin_paths) {
+ if (stat(p, &st) >= 0) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
return true;
if (timespec_load(&hwdb->st.st_mtim) != timespec_load(&st.st_mtim))
diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
index 9df0438..1455988 100644
--- a/src/udev/udevadm-hwdb.c
+++ b/src/udev/udevadm-hwdb.c
@@ -547,14 +547,20 @@ static int import_file(struct udev *udev, struct trie *trie, const char *filenam
static void help(void) {
printf("Usage: udevadm hwdb OPTIONS\n"
" -u,--update update the hardware database\n"
+ " --usr generate in " UDEV_LIBEXEC_DIR " instead of /etc/udev\n"
" -t,--test=MODALIAS query database and print result\n"
" -r,--root=PATH alternative root path in the filesystem\n"
" -h,--help\n\n");
}
static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
+ enum {
+ ARG_USR = 0x100,
+ };
+
static const struct option options[] = {
{ "update", no_argument, NULL, 'u' },
+ { "usr", no_argument, NULL, ARG_USR },
{ "test", required_argument, NULL, 't' },
{ "root", required_argument, NULL, 'r' },
{ "help", no_argument, NULL, 'h' },
@@ -562,6 +568,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
};
const char *test = NULL;
const char *root = "";
+ const char *hwdb_bin_dir = "/etc/udev";
bool update = false;
struct trie *trie = NULL;
int err, c;
@@ -572,6 +579,9 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
case 'u':
update = true;
break;
+ case ARG_USR:
+ hwdb_bin_dir = UDEV_LIBEXEC_DIR;
+ break;
case 't':
test = optarg;
break;
@@ -645,7 +655,8 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
log_debug("strings dedup'ed: %8zu bytes (%8zu)",
trie->strings->dedup_len, trie->strings->dedup_count);
- if (asprintf(&hwdb_bin, "%s/%s", root, hwdb_bin) < 0) {
+ hwdb_bin = strjoin(root, "/", hwdb_bin_dir, "/hwdb.bin", NULL);
+ if (!hwdb_bin) {
rc = EXIT_FAILURE;
goto out;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment