Skip to contentSkip to conversation

debian: Only run udevadm if the binary is available

PATCH In review Benjamin Drung 3 participants 7 messages Dec 27, 2017 – Jan 9, 2018 5 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debian: Only run udevadm if the binary is available

When udevadm is not available (e.g. in a minimal chroot environment), the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

To silence these warnings, only run udevadm if this binary is available.

---
 debian/rdma-core.postinst | 8 +++++---
 debian/srptools.postinst  | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)
debian/rdma-core.postinst +5 -3
index 6486f62e..26aec6d1 100644
@@ -6,7 +6,9 @@ set -e
 if [ "$1" = "configure" ]; then
     # we ship udev rules, so trigger an update. This has to be done after
     # DEBHELPER restarts systemd to get our new service files loaded.
-    udevadm trigger --subsystem-match=infiniband --action=change || true
-    udevadm trigger --subsystem-match=net --action=change || true
-    udevadm trigger --subsystem-match=infiniband_mad --action=change || true
+    if which udevadm >/dev/null 2>&1; then
+        udevadm trigger --subsystem-match=infiniband --action=change
+        udevadm trigger --subsystem-match=net --action=change
+        udevadm trigger --subsystem-match=infiniband_mad --action=change
+    fi
 fi
debian/srptools.postinst +3 -1
index 398534db..9cdce914 100644
@@ -6,5 +6,7 @@ set -e
 if [ "$1" = "configure" ]; then
     # we ship udev rules, so trigger an update. This has to be done after
     # DEBHELPER restarts systemd to get our new service files loaded.
-    udevadm trigger --subsystem-match=infiniband_mad --action=change || true
+    if which udevadm >/dev/null 2>&1; then
+        udevadm trigger --subsystem-match=infiniband_mad --action=change
+    fi
 fi
Signature · 6 lines
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive
Quoted 10 lines · Benjamin Drung

When udevadm is not available (e.g. in a minimal chroot environment), the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

Quoted 6 lines

To silence these warnings, only run udevadm if this binary is available.

 debian/rdma-core.postinst | 8 +++++---
 debian/srptools.postinst  | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)

Hurm. Some packages have this which test, others do not..

I'm confused how we get to a state where rdma-core can be installed without udev? Virtually the entire purpose of that package revolves around udev and systemd ... So are we missing a dependency?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to a message not in the archive

Am Mittwoch, den 27.12.2017, 13:26 -0700 schrieb Jason Gunthorpe:

Quoted 20 lines · Benjamin Drung
Quoted 11 lines

When udevadm is not available (e.g. in a minimal chroot environment),
the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

Quoted 7 lines

To silence these warnings, only run udevadm if this binary is available.

 debian/rdma-core.postinst | 8 +++++---
 debian/srptools.postinst  | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)
Quoted 5 lines

Hurm. Some packages have this which test, others do not..

I'm confused how we get to a state where rdma-core can be installed without udev? Virtually the entire purpose of that package revolves around udev and systemd ... So are we missing a dependency?

Adding a dependency on udev is a solution too and is probably the better solution.

Signature · 18 lines
Benjamin Drung
System Developer
Debian & Ubuntu Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Email: [email protected]
URL: https://www.profitbricks.de

Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss, Matthias Steinberg
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw
In reply to a message not in the archive
Quoted 21 lines · Benjamin Drung

Am Mittwoch, den 27.12.2017, 13:26 -0700 schrieb Jason Gunthorpe:

Quoted 20 lines · Benjamin Drung
Quoted 18 lines

When udevadm is not available (e.g. in a minimal chroot environment),
the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

To silence these warnings, only run udevadm if this binary is available.

 debian/rdma-core.postinst | 8 +++++---
 debian/srptools.postinst  | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)
Quoted 8 lines
Quoted 5 lines

Hurm. Some packages have this which test, others do not..

I'm confused how we get to a state where rdma-core can be installed without udev? Virtually the entire purpose of that package revolves around udev and systemd ... So are we missing a dependency?

Adding a dependency on udev is a solution too and is probably the better solution.

Okay, can you send that?

Thanks,
Jason

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

PATCH v2 1/1 debian: Add udev dependency to rdma-core and srptools

In reply to a message not in the archive

When udevadm is not available (e.g. in a minimal chroot environment), the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

Add udev dependency to rdma-core and srptools (which provides udevadm), because these packages rely on udev to load the kernel modules.

---
 debian/control            | 2 ++
 debian/rdma-core.postinst | 6 +++---
 debian/srptools.postinst  | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
debian/control +2 -0
index 451b379f..27d23791 100644
@@ -24,6 +24,7 @@ Homepage: https://github.com/linux-rdma/rdma-core
 Package: rdma-core
 Architecture: linux-any
 Depends: lsb-base (>= 3.2-14~),
+         udev,
          ${misc:Depends},
          ${perl:Depends},
          ${shlibs:Depends}
@@ -342,6 +343,7 @@ Package: srptools
 Architecture: linux-any
 Depends: lsb-base (>= 3.2-14~),
          rdma-core (>= 15),
+         udev,
          ${misc:Depends},
          ${shlibs:Depends}
 Description: Tools for Infiniband attached storage (SRP)
debian/rdma-core.postinst +3 -3
index 6486f62e..a76368a4 100644
@@ -6,7 +6,7 @@ set -e
 if [ "$1" = "configure" ]; then
     # we ship udev rules, so trigger an update. This has to be done after
     # DEBHELPER restarts systemd to get our new service files loaded.
-    udevadm trigger --subsystem-match=infiniband --action=change || true
-    udevadm trigger --subsystem-match=net --action=change || true
-    udevadm trigger --subsystem-match=infiniband_mad --action=change || true
+    udevadm trigger --subsystem-match=infiniband --action=change
+    udevadm trigger --subsystem-match=net --action=change
+    udevadm trigger --subsystem-match=infiniband_mad --action=change
 fi
debian/srptools.postinst +1 -1
index 398534db..c69a3ad1 100644
@@ -6,5 +6,5 @@ set -e
 if [ "$1" = "configure" ]; then
     # we ship udev rules, so trigger an update. This has to be done after
     # DEBHELPER restarts systemd to get our new service files loaded.
-    udevadm trigger --subsystem-match=infiniband_mad --action=change || true
+    udevadm trigger --subsystem-match=infiniband_mad --action=change
 fi
Signature · 6 lines
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by
#10 lore raw

Re: [PATCH rdma-core v2] debian: Add udev dependency to rdma-core and srptools

In reply to a message not in the archive
Quoted 10 lines · Benjamin Drung

When udevadm is not available (e.g. in a minimal chroot environment), the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

Quoted 8 lines

Add udev dependency to rdma-core and srptools (which provides udevadm), because these packages rely on udev to load the kernel modules.

 debian/control            | 2 ++
 debian/rdma-core.postinst | 6 +++---
 debian/srptools.postinst  | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

Makes sense to me

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

Re: [PATCH rdma-core v2] debian: Add udev dependency to rdma-core and srptools

In reply to a message not in the archive
Quoted 13 lines · Benjamin Drung

When udevadm is not available (e.g. in a minimal chroot environment), the rdma-core package installation will print these warnings:

/var/lib/dpkg/info/rdma-core.postinst: 33:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 34:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found /var/lib/dpkg/info/rdma-core.postinst: 35:
/var/lib/dpkg/info/rdma-core.postinst: udevadm: not found

Add udev dependency to rdma-core and srptools (which provides udevadm), because these packages rely on udev to load the kernel modules.

Quoted 7 lines
---
 debian/control            | 2 ++
 debian/rdma-core.postinst | 6 +++---
 debian/srptools.postinst  | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

Thanks, applied.