# HG changeset patch # User John Tsiombikas # Date 1323241085 0 # Node ID 5fb7ad5967a8459167d18685eeabb9f9c437c222 # Parent 4dd35ccceba1ef1908e568a9eb3b377d4c1c91e7 changed mkdiskimg to make partitioning work on freebsd diff -r 4dd35ccceba1 -r 5fb7ad5967a8 mkdiskimg --- a/mkdiskimg Wed Dec 07 04:26:18 2011 +0000 +++ b/mkdiskimg Wed Dec 07 06:58:05 2011 +0000 @@ -1,5 +1,10 @@ #!/bin/sh +SUDO=${SUDO:-sudo} +if [ `id -u` = 0 ]; then + unset SUDO +fi + # mkdiskimg - prepare a disk image for the kernel # usage: mkdiskimg [size in mb, default: 40] @@ -28,19 +33,25 @@ mkpart_fbsd() { - fdisk -f - $imgfile <&2 + exit 1 + fi + + $SUDO fdisk -q -f - /dev/$devfile <