mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-23 22:05:20 +02:00
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
This commit is contained in:
parent
c50e168bc6
commit
f3b0c7130c
@ -7,9 +7,11 @@ BLKSZ=65536
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IMAGE=${3:-openwrt-combined.img}
|
||||||
|
|
||||||
# Make sure provided images are 64k aligned.
|
# Make sure provided images are 64k aligned.
|
||||||
kern=$(mktemp)
|
kern="${IMAGE}.kernel"
|
||||||
root=$(mktemp)
|
root="${IMAGE}.rootfs"
|
||||||
dd if="$1" of="$kern" bs=$BLKSZ conv=sync 2>/dev/null
|
dd if="$1" of="$kern" bs=$BLKSZ conv=sync 2>/dev/null
|
||||||
dd if="$2" of="$root" 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%% *}" | \
|
$(stat -c "%s" "$kern") $(stat -c "%s" "$root") "${md5%% *}" | \
|
||||||
dd bs=$BLKSZ conv=sync;
|
dd bs=$BLKSZ conv=sync;
|
||||||
cat "$kern" "$root"
|
cat "$kern" "$root"
|
||||||
) > ${3:-openwrt-combined.img} 2>/dev/null
|
) > ${IMAGE} 2>/dev/null
|
||||||
|
|
||||||
# Clean up.
|
# Clean up.
|
||||||
rm -f "$kern" "$root"
|
rm -f "$kern" "$root"
|
||||||
|
Loading…
Reference in New Issue
Block a user