--- elwix/install2img.sh 2013/07/29 21:04:03 1.6.2.1 +++ elwix/install2img.sh 2013/08/05 13:10:16 1.7 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: install2img.sh,v 1.6.2.1 2013/07/29 21:04:03 misho Exp $ +# $Id: install2img.sh,v 1.7 2013/08/05 13:10:16 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -129,21 +129,26 @@ gencksum() ### main() -if [ ! -r ${REL}/${OS} ]; then +if [ -z "$1" -o ! -r "$1" ]; then echo - echo "Error:: ELWIX OS file not found!" + echo "Error:: ELWIX OS tar file '$1' not found!" echo exit 2 +else + IMGNAME=$(basename $1 | sed -e "s/.tar.gz//") + MD5CHK="${REL}/${IMGNAME}.md5" + SHA1CHK="${REL}/${IMGNAME}.sha1" + IMG="${REL}/${IMGNAME}.img" fi -mkdevice $IMG ${1:-"${IMG_SIZE}"} +mkdevice $IMG ${2:-"${IMG_SIZE}"} initdev $DEV mountdev $DEV -install2 ${REL}/${OS} +install2 $1 umountdev #enablejfs $DEV boot2dev $DEV cleandev $DEV gencksum $IMG $MD5CHK $SHA1CHK -echo "ELWIX OS image complete." +echo "ELWIX OS image $IMGNAME complete."