X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/5cd5287c63bd0be72b4ae00fc1af508a2b42e541..a53693f2f5dc5fea6eac79a71d7c7fb9002f49b7:/target/image/x86/gen_image.sh diff --git a/target/image/x86/gen_image.sh b/target/image/x86/gen_image.sh index 3edce1e40..21deeee6a 100755 --- a/target/image/x86/gen_image.sh +++ b/target/image/x86/gen_image.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash # Copyright (C) 2006 OpenWrt.org [ $# == 5 ] || { - echo "SYNTAX: $0 " - exit 1 + echo "SYNTAX: $0 " + exit 1 } file="$1" @@ -22,20 +22,20 @@ n p 1 -+${part1s}M ++$(($part1s * 1024))K n p 2 -+${part2s}M + w q EOF block() { - echo -e 'p\nq' | fdisk -u -C $cyl -H $head -S $sect "$file" | awk -v file="$file$1" -v n="$(($2 + 2))" ' + echo -e 'p\nq' | fdisk -u -C $cyl -H $head -S $sect "$file" | awk -v file="$file$1" -v n="$(($2 + 2))" ' $1 == file { - print $n * 512 + print $n * 512 }' }