]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lsof: add update-alternatives logic
authorAlex Stewart <alex.stewart@ni.com>
Fri, 2 Dec 2022 20:59:10 +0000 (14:59 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Dec 2022 23:04:58 +0000 (23:04 +0000)
Some distributions (NI LinuxRT) provide both busybox-lsof and
full-featured lsof implementations. When users install the full-featured
lsof package, the full-binary fails to replace the bbox-binary in PATH,
because `lsof` contains no update-alternatives logic.

Inherit the update-alternatives bbclass and assert that the
full-featured lsof package has higher priority than the busybox
implementation.

Co-Authored-By: Kyle Roeschley <kyle.roeschley@ni.com>
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit e2893fa692a6e91eee09fc04c8c03fe27c718a58)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-extended/lsof/lsof_4.95.0.bb

index f380de0b6b0da1da4ed2c47a727491b25ad2a01d..80128369ec7b7bf863776529888e227300540410 100644 (file)
@@ -19,6 +19,15 @@ SRCREV = "67d8c828e7bdc01ba93f8ff79765dd424da0c9d7"
 
 S = "${WORKDIR}/git"
 
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "lsof"
+ALTERNATIVE_LINK_NAME[lsof] = "${sbindir}/lsof"
+# Make our priority higher than busybox
+ALTERNATIVE_PRIORITY = "100"
+
+
 export LSOF_INCLUDE = "${STAGING_INCDIR}"
 
 do_configure () {