summaryrefslogtreecommitdiff
path: root/functions/losetup.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2011-08-27 20:50:19 +0200
committerDaniel Baumann <daniel@debian.org>2011-08-27 20:50:19 +0200
commitdfde086f354116443abf94d350073989aef19dcf (patch)
tree3de3b5126abe8dd191fdab76fc901d04df2f1e91 /functions/losetup.sh
parent76a6831e0f4a8d4e7a16c72da1dae77cca4e6ad8 (diff)
downloadvyos-live-build-dfde086f354116443abf94d350073989aef19dcf.tar.gz
vyos-live-build-dfde086f354116443abf94d350073989aef19dcf.zip
Only calling udevadm in losetup function when udev is installed on the host system.
Diffstat (limited to 'functions/losetup.sh')
-rwxr-xr-xfunctions/losetup.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/functions/losetup.sh b/functions/losetup.sh
index 039ff3ec1..6089e099a 100755
--- a/functions/losetup.sh
+++ b/functions/losetup.sh
@@ -21,7 +21,10 @@ Lodetach ()
# Changes to block devices result in uevents which trigger rules which in
# turn access the loop device (ex. udisks-part-id, blkid) which can cause
# a race condition. We call 'udevadm settle' to help avoid this.
- ${LB_ROOT_COMMAND} udevadm settle
+ if [ -x "$(which udevadm 2>/dev/null)" ]
+ then
+ ${LB_ROOT_COMMAND} udevadm settle
+ fi
# Loop back devices aren't the most reliable when it comes to writes.
# We sleep and sync for good measure - better than build failure.