X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=scripts%2Fcombined-image.sh;h=5472b2cfd24621e78df1f11ddc440023b44932b8;hb=0d74b4546764201d9a87549dbe089248ff8171d9;hp=eecd3d7f20d7f225ada6be88725965c5453764df;hpb=f20af3832204ca2c35a9f1da208a34d2a509996c;p=oweals%2Fopenwrt.git diff --git a/scripts/combined-image.sh b/scripts/combined-image.sh index eecd3d7f20..5472b2cfd2 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=$(tempfile) -root=$(tempfile) +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"