Diff for /elwix/install2img.sh between versions 1.2 and 1.5

version 1.2, 2011/10/18 09:02:05 version 1.5, 2013/01/28 10:42:47
Line 29  DEV="" Line 29  DEV=""
 mkdevice()  mkdevice()
 {  {
         echo "+++ Make prepare file image ... "          echo "+++ Make prepare file image ... "
        rm -f $IMG        rm -f $1
        dd if=/dev/zero of=${IMG} bs=1024 count=${IMG_SIZE}        dd if=/dev/zero of=$1 bs=1024 count=$2
   
        echo -n "+++ Assign memory device to image ... "        echo -n "+++ Assign memory device to image $1 ... "
        DEV=`mdconfig -a -tvnode -f ${IMG}`        DEV=`mdconfig -a -tvnode -f $1`
         echo $DEV          echo $DEV
   
         if [ -z "$DEV" ]; then          if [ -z "$DEV" ]; then
                rm -f $IMG                rm -f $1
                 exit 3                  exit 3
         fi          fi
 }  }
Line 95  enablejfs() Line 95  enablejfs()
 boot2dev()  boot2dev()
 {  {
         echo -n "+++ Installboot to device $1 ... "          echo -n "+++ Installboot to device $1 ... "
        if disklabel -B -b ${WORLD}/boot/boot -m ${TARGET} ${1}; then        if disklabel -B -b ${WORLD}/boot/boot -m ${TARGET} $1; then
                 echo "OK"                  echo "OK"
         else          else
                 echo "Failed!"                  echo "Failed!"
Line 122  cleandev() Line 122  cleandev()
 gencksum()  gencksum()
 {  {
         echo -n "+++ Generate check sums ... "          echo -n "+++ Generate check sums ... "
        md5 ${IMG} >${MD5CHK}        md5 $1 >$2
        sha1 ${IMG} >${SHA1CHK}        sha1 $1 >$3
         echo "OK"          echo "OK"
 }  }
   
 ### main()  ### main()
   
if [ ! -r ${1:-"${REL}/${OS}"} ]; thenif [ ! -r ${REL}/${OS} -a -r ${REL}/${OS_LITE} ]; then
         echo          echo
         echo "Error:: ELWIX OS file not found!"          echo "Error:: ELWIX OS file not found!"
         echo          echo
         exit 2          exit 2
 fi  fi
   
mkdevicemkdevice $IMG ${1:-"${IMG_SIZE}"}
 
 initdev $DEV  initdev $DEV
   
 mountdev $DEV  mountdev $DEV
install2 ${1:-"$REL/$OS"}install2 ${REL}/${OS}
 umountdev  umountdev
   #enablejfs $DEV
   boot2dev $DEV
   cleandev $DEV
   gencksum $IMG $MD5CHK $SHA1CHK
   
   
   mkdevice $IMG_LITE ${1:-"${IMG_SIZE}"}
   initdev $DEV
   mountdev $DEV
   install2 ${REL}/${OS_LITE}
   umountdev
 #enablejfs $DEV  #enablejfs $DEV
 boot2dev $DEV  boot2dev $DEV
   cleandev $DEV
   gencksum $IMG_LITE $MD5CHK_LITE $SHA1CHK_LITE
   
   mkdevice $IMG_LITE128 ${1:-"${IMG_SIZE128}"}
   initdev $DEV
   mountdev $DEV
   install2 ${REL}/${OS_LITE128}
   umountdev
   #enablejfs $DEV
   boot2dev $DEV
 cleandev $DEV  cleandev $DEV
   gencksum $IMG_LITE128 $MD5CHK_LITE128 $SHA1CHK_LITE128
   
 gencksum  
 echo "ELWIX OS image complete."  echo "ELWIX OS image complete."

Removed from v.1.2  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>