path: root/community/cloud-utils/03-growpart-flock.patch
blob: fe84424e75c51585bb49146f5425b0aa88349a07 (plain) (tree)

From: Dermot Bradley <dermot_bradley@yahoo.com>
Date: Thu, 12 Nov 2020 14:05 +0000
Subject: [PATCH] cloud-utils: Make growpart call to flock work with Busybox

Change growpart's to call the flock command using the short option "-x"
rather than the long option "--exclusive" as the short option works with
both util-linux's flock as well as Busybox's flock. This means that the
cloud-utils-growpart package can have the util-linux dependency removed.


diff -aur a/bin/growpart b/bin/growpart
--- a/bin/growpart
+++ b/bin/growpart
@@ -162,7 +162,7 @@
 	# Do not use --nonblock or --timeout as udev may be already processing
 	# the disk and we must wait until it has released the disk to
 	# proceed.  Failure to obtain exclusive lock is fatal to growpart.
-	rq flock flock --exclusive $FLOCK_DISK_FD ||
+	rq flock flock -x $FLOCK_DISK_FD ||
 		fail "Error while obtaining exclusive lock on $DISK"
 	debug 1 "FLOCK: $disk: obtained exclusive lock"