version 1.2, 2011/10/18 09:02:05
|
version 1.6.2.1, 2013/07/29 21:04:03
|
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}"} ]; then | if [ ! -r ${REL}/${OS} ]; 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 |
|
|
mkdevice | mkdevice $IMG ${1:-"${IMG_SIZE}"} |
| |
initdev $DEV |
initdev $DEV |
|
|
mountdev $DEV |
mountdev $DEV |
install2 ${1:-"$REL/$OS"} | install2 ${REL}/${OS} |
umountdev |
umountdev |
|
|
#enablejfs $DEV |
#enablejfs $DEV |
boot2dev $DEV |
boot2dev $DEV |
|
|
cleandev $DEV |
cleandev $DEV |
|
gencksum $IMG $MD5CHK $SHA1CHK |
|
|
gencksum |
|
echo "ELWIX OS image complete." |
echo "ELWIX OS image complete." |