run-postinsts: use 'flock --fcntl' instead of separate fcntl-lock binary

Since v2.41, util-linux flock has understood the --fcntl option,
making it use fcntl(F_OFD_SETLK[W]) instead of flock().

(From OE-Core rev: f03393db6bb8509e88ee0ad7a8300186d8231c58)

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Rasmus Villemoes
2025-09-15 10:51:34 +02:00
committed by Richard Purdie
parent a5ba9fba0d
commit 38a902b1e5
2 changed files with 2 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ remove_rcsd_link=1
if $pm_installed; then
case $pm in
"ipk")
if ! `fcntl-lock --wait 30 /run/opkg.lock true`; then
if ! `flock --fcntl --wait 30 /run/opkg.lock true`; then
eval echo "Unable to obtain the opkg lock, deadlock?" $append_log
fi
if ! eval "opkg configure $append_log"; then

View File

@@ -12,7 +12,7 @@ S = "${UNPACKDIR}"
inherit allarch systemd update-rc.d
RDEPENDS:${PN} = "util-linux-fcntl-lock"
RDEPENDS:${PN} = "util-linux-flock"
INITSCRIPT_NAME = "run-postinsts"
INITSCRIPT_PARAMS = "start 99 S ."