--- elwix/install2img.sh 2017/06/21 13:00:48 1.8.4.2 +++ elwix/install2img.sh 2017/06/21 14:42:31 1.8.4.3 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: install2img.sh,v 1.8.4.2 2017/06/21 13:00:48 misho Exp $ +# $Id: install2img.sh,v 1.8.4.3 2017/06/21 14:42:31 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -159,14 +159,24 @@ mkbak2() echo "Failed!" exit 8 fi + else + 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 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 + if [ ! -f ${REL}/sys4up_${IMGNAME}.bin ]; then + 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 fi } @@ -193,9 +203,9 @@ if [ -z "$1" -o ! -r "$1" ]; then exit 2 else IMGNAME=$(basename $1 | sed -e "s/.tar.gz//") - MD5CHK="${REL}/${IMGNAME}.md5" - SHA1CHK="${REL}/${IMGNAME}.sha1" - IMG="${REL}/${IMGNAME}.img" + MD5CHK="${REL}/${IMGNAME}${3:+"_2nd"}.md5" + SHA1CHK="${REL}/${IMGNAME}${3:+"_2nd"}.sha1" + IMG="${REL}/${IMGNAME}${3:+"_2nd"}.img" fi mkdevice $IMG ${2:-"${IMG_SIZE}"} @@ -210,4 +220,4 @@ cleandev $DEV 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}${3:+"_2nd"} complete."