version 1.1.2.2, 2011/07/25 00:19:39
|
version 1.2.4.1, 2012/10/11 13:31:33
|
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 119 cleandev()
|
Line 119 cleandev()
|
mdconfig -d -u $1 |
mdconfig -d -u $1 |
} |
} |
|
|
|
gencksum() |
|
{ |
|
echo -n "+++ Generate check sums ... " |
|
md5 $1 >$2 |
|
sha1 $1 >$3 |
|
echo "OK" |
|
} |
|
|
### main() |
### main() |
|
|
if [ ! -r ${1:-"${REL}/${OS}"} ]; then | if [ ! -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 |
|
|
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 |
|
gencksum $IMG $MD5CHK $SHA1CHK |
|
|
|
|
|
mkdevice $IMG_LITE ${1:-"${IMG_SIZE}"} |
|
initdev $DEV |
|
mountdev $DEV |
|
install2 ${REL}/${OS_LITE} |
|
umountdev |
|
#enablejfs $DEV |
|
boot2dev $DEV |
cleandev $DEV |
cleandev $DEV |
|
gencksum $IMG_LITE $MD5CHK_LITE $SHA1CHK_LITE |
|
|
echo "ELWIX OS image complete." |
echo "ELWIX OS image complete." |