summaryrefslogtreecommitdiff
path: root/mkimage.sh
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-06 12:48:19 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-06 12:48:19 +0000
commitbba506c0b28d3e2e3c9b5524452df0442c5a54c0 (patch)
tree2358aa2f840c013de2cb29be80e9ba297bc708b1 /mkimage.sh
parent3c797616da7f0b236ec22b72e917294e56f0d3e5 (diff)
downloadmorph-bba506c0b28d3e2e3c9b5524452df0442c5a54c0.tar.gz
Install mbr.bin from one of many places
Diffstat (limited to 'mkimage.sh')
-rwxr-xr-xmkimage.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/mkimage.sh b/mkimage.sh
index 61ea49d9..be56d455 100755
--- a/mkimage.sh
+++ b/mkimage.sh
@@ -79,7 +79,16 @@ sfdisk "$img" <<EOF
EOF
# Install the master boot record boot loader. We use the one from extlinux.
-dd if=/usr/lib/extlinux/mbr.bin of="$img" conv=notrunc
+# Depending on where we run this script (Debian vs Baserock), it might
+# be installed in a different place, so we try all known ones.
+for x in /usr/lib/extlinux/mbr.bin /usr/share/syslinux/mbr.bin
+do
+ if [ -e "$x" ]
+ then
+ dd if="$x" of="$img" conv=notrunc
+ break
+ fi
+done
# Access the partition inside the raw disk image file.
part=$(dummy_kpartx_add "$img")