From 4e6a20efa9dc7bbb516fa56b560289a307d2ca40 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Mar 2024 13:02:51 +0000 Subject: util-linux: Add fcntl-lock Add a version of flock that uses the fnctl based lockf locking instead of flock based locks. This allows us to take the same lock that opkg would use from a shell script. The two different locking mechanisms operate independently of each other. Inserting this C file into the util-linux build seems like the easiest/best place to insert the code. At this point it hasn't been discussed with upstream. (From OE-Core rev: d2b784110e2c3df8a0a41e4819cf2de9003f9fa3) Signed-off-by: Richard Purdie --- meta/recipes-core/util-linux/util-linux_2.39.3.bb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'meta/recipes-core/util-linux/util-linux_2.39.3.bb') diff --git a/meta/recipes-core/util-linux/util-linux_2.39.3.bb b/meta/recipes-core/util-linux/util-linux_2.39.3.bb index 3e87dcc2c2..83b3f4e05b 100644 --- a/meta/recipes-core/util-linux/util-linux_2.39.3.bb +++ b/meta/recipes-core/util-linux/util-linux_2.39.3.bb @@ -147,6 +147,11 @@ SYSTEMD_AUTO_ENABLE:${PN}-uuidd = "disable" SYSTEMD_SERVICE:${PN}-fstrim = "fstrim.timer fstrim.service" SYSTEMD_AUTO_ENABLE:${PN}-fstrim = "disable" +do_compile:append () { + cp ${WORKDIR}/fcntl-lock.c ${S}/fcntl-lock.c + ${CC} ${CFLAGS} ${LDFLAGS} ${S}/fcntl-lock.c -o ${B}/fcntl-lock +} + do_install () { # with ccache the timestamps on compiled files may # end up earlier than on their inputs, this allows @@ -182,6 +187,8 @@ do_install () { echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall rm -f ${D}${bindir}/chkdupexe + + install -m 0755 ${B}/fcntl-lock ${D}${bindir} } do_install:append:class-target () { -- cgit v1.2.3-54-g00ecf