version 1.7.6.2, 2014/09/12 00:29:27
|
version 1.8.4.2, 2017/06/21 13:00:48
|
Line 52 initdev()
|
Line 52 initdev()
|
exit 3 |
exit 3 |
fi |
fi |
|
|
disklabel $1 2>&- | awk -vcfgsize=${CFG_NAND_SIZE:-65536} '($1 == "a:") { | if [ X"$2" != X"no" ]; then |
cfgsize /= 512; | disklabel $1 2>&- | awk -vcfgsize=${CFG_NAND_SIZE:-65536} '($1 == "a:") { |
for (i = 1; i <= NF; i++) { | cfgsize /= 512; |
if (i == 2) | bootoff = $3; |
printf("%s ", $i - cfgsize); | freesize = $2 - cfgsize; |
else if (i == 3) { | imgsize = freesize / 2; |
offset = $i; | |
printf("%s ", cfgsize + offset); | printf(" a: %d %d unused 0 0 0\n", imgsize, cfgsize + bootoff); |
} else | printf(" f: %d %d unused 0 0 0\n", imgsize, imgsize + cfgsize + bootoff); |
printf("%s ", $i); | printf(" g: %d %d cfg 0 0 0\n", cfgsize, bootoff); |
} | next; |
printf("\n"); | } |
printf("g: %d %d cfg 0 0 0\n", cfgsize, offset); | { printf("%s\n", $0); }' >/tmp/disklabel.tmp |
next; | else |
} | disklabel $1 2>&- | awk -vcfgsize=${CFG_NAND_SIZE:-65536} '($1 == "a:") { |
{ printf("%s\n", $0); }' >/tmp/disklabel.tmp | cfgsize /= 512; |
| bootoff = $3; |
| freesize = $2 - cfgsize; |
| imgsize = freesize; |
| |
| printf(" a: %d %d unused 0 0 0\n", imgsize, cfgsize + bootoff); |
| printf(" g: %d %d cfg 0 0 0\n", cfgsize, bootoff); |
| next; |
| } |
| { printf("%s\n", $0); }' >/tmp/disklabel.tmp |
| fi |
| |
if disklabel -R -m ${TARGET} $1 /tmp/disklabel.tmp; then |
if disklabel -R -m ${TARGET} $1 /tmp/disklabel.tmp; then |
rm -f /tmp/disklabel.tmp |
rm -f /tmp/disklabel.tmp |
echo "OK" |
echo "OK" |
Line 138 install2()
|
Line 149 install2()
|
fi |
fi |
} |
} |
|
|
|
mkbak2() |
|
{ |
|
if [ X"$2" != X"no" ]; then |
|
echo -n "+++ Syncing ELWIX OS image as backup OS image into ${1}f ..." |
|
if dd if=/dev/${1}a of=/dev/${1}f; then |
|
echo "OK" |
|
else |
|
echo "Failed!" |
|
exit 8 |
|
fi |
|
fi |
|
|
|
echo "+++ Make ELWIX OS system image partion for upgrade into ${REL}/sys4up_${IMGNAME}.bin ..." |
|
if dd if=/dev/${1}a of=${REL}/sys4up_${IMGNAME}.bin; then |
|
echo "OK" |
|
else |
|
echo "Failed!" |
|
exit 9 |
|
fi |
|
} |
|
|
cleandev() |
cleandev() |
{ |
{ |
mdconfig -d -u $1 |
mdconfig -d -u $1 |
Line 156 gencksum()
|
Line 188 gencksum()
|
if [ -z "$1" -o ! -r "$1" ]; then |
if [ -z "$1" -o ! -r "$1" ]; then |
echo |
echo |
echo "Error:: ELWIX OS tar file '$1' not found!" |
echo "Error:: ELWIX OS tar file '$1' not found!" |
|
echo "Syntax:: ./install2img.sh <ELWIX.tar.gz> [CF size] [yes == make secondary backup image]" |
echo |
echo |
exit 2 |
exit 2 |
else |
else |
Line 166 else
|
Line 199 else
|
fi |
fi |
|
|
mkdevice $IMG ${2:-"${IMG_SIZE}"} |
mkdevice $IMG ${2:-"${IMG_SIZE}"} |
initdev $DEV | initdev $DEV ${3:-"no"} |
mountdev $DEV |
mountdev $DEV |
install2 $1 |
install2 $1 |
umountdev |
umountdev |
#enablejfs $DEV |
#enablejfs $DEV |
boot2dev $DEV |
boot2dev $DEV |
|
mkbak2 $DEV ${3:-"no"} |
cleandev $DEV |
cleandev $DEV |
gencksum $IMG $MD5CHK $SHA1CHK |
gencksum $IMG $MD5CHK $SHA1CHK |
|
gencksum ${REL}/sys4up_${IMGNAME}.bin ${REL}/sys4up_${IMGNAME}.md5 ${REL}/sys4up_${IMGNAME}.sha1 |
|
|
echo "ELWIX OS image $IMGNAME complete." |
echo "ELWIX OS image $IMGNAME complete." |