From: nbd Date: Thu, 24 Dec 2009 10:34:37 +0000 (+0000) Subject: scripts/combined-image.sh: remove the use of mktemp to make it more portable X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=commitdiff_plain;h=f3b0c7130cf8fb46266b5658564a19d2a6589235 scripts/combined-image.sh: remove the use of mktemp to make it more portable git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18920 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/scripts/combined-image.sh b/scripts/combined-image.sh index 30373e756..5472b2cfd 100644 --- a/scripts/combined-image.sh +++ b/scripts/combined-image.sh @@ -7,9 +7,11 @@ BLKSZ=65536 exit 1 } +IMAGE=${3:-openwrt-combined.img} + # Make sure provided images are 64k aligned. -kern=$(mktemp) -root=$(mktemp) +kern="${IMAGE}.kernel" +root="${IMAGE}.rootfs" dd if="$1" of="$kern" bs=$BLKSZ conv=sync 2>/dev/null dd if="$2" of="$root" bs=$BLKSZ conv=sync 2>/dev/null @@ -26,7 +28,7 @@ md5=$(cat "$kern" "$root" | md5sum -) $(stat -c "%s" "$kern") $(stat -c "%s" "$root") "${md5%% *}" | \ dd bs=$BLKSZ conv=sync; cat "$kern" "$root" -) > ${3:-openwrt-combined.img} 2>/dev/null +) > ${IMAGE} 2>/dev/null # Clean up. rm -f "$kern" "$root"