2001-05-22 20:10:07 +04:00
|
|
|
#!/bin/sh
|
|
|
|
BOCHS=/usr/local/bin/bochs
|
2001-11-10 02:56:29 +03:00
|
|
|
DLXINST=/usr/local/bochs/dlxlinux
|
2001-11-10 03:05:52 +03:00
|
|
|
GZIP=gzip
|
2001-11-10 02:56:29 +03:00
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
DLXPATH=$1
|
|
|
|
else
|
|
|
|
DLXPATH=$HOME/.bochs
|
|
|
|
fi
|
|
|
|
CONFFILE=$HOME/.bochs/bochsconf
|
|
|
|
|
|
|
|
makedlxdir() {
|
|
|
|
echo DEBUG: Creating $HOME/.bochs/bochsrc
|
|
|
|
echo DLXPATH=$DLXPATH > $CONFFILE
|
|
|
|
. $CONFFILE
|
2001-11-10 04:05:23 +03:00
|
|
|
for file in bochsrc.txt README testform.txt; do
|
|
|
|
if [ ! -f $DLXPATH/$file ]; then
|
|
|
|
cp -av $DLXINST/$file $DLXPATH/.
|
|
|
|
else
|
|
|
|
echo "ERROR: $file already exists in $DLXPATH. Remove it to replace."
|
|
|
|
fi;
|
|
|
|
done
|
2001-11-10 02:56:29 +03:00
|
|
|
if [ ! -f $DLXPATH/hd10meg.img ]; then
|
2001-11-10 03:05:52 +03:00
|
|
|
echo Uncompressing $DLXINST/hd10meg.img.gz '->' $DLXPATH/hd10meg.img
|
|
|
|
$GZIP -dc $DLXINST/hd10meg.img.gz > $DLXPATH/hd10meg.img
|
2001-11-10 02:56:29 +03:00
|
|
|
else
|
2001-11-10 04:05:23 +03:00
|
|
|
echo "ERROR: hd10meg.img already exists in $DLXPATH. Remove it to replace."
|
2001-11-10 02:56:29 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2001-05-22 20:10:07 +04:00
|
|
|
|
|
|
|
echo -n "Checking for bochs binary..."
|
|
|
|
if test ! -x $BOCHS; then
|
|
|
|
echo FAILED
|
|
|
|
echo ERROR: I could not find bochs in $BOCHS
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo ok
|
|
|
|
echo -n "Checking for DLX linux directory..."
|
2001-11-10 02:56:29 +03:00
|
|
|
if test ! -d $DLXINST; then
|
2001-05-22 20:10:07 +04:00
|
|
|
echo FAILED
|
|
|
|
echo ERROR: I could not find the DLX linux directory.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo ok
|
2001-11-10 03:05:52 +03:00
|
|
|
echo -n "Checking for $GZIP..."
|
|
|
|
$GZIP < /dev/null >& /dev/null
|
2001-11-10 02:56:29 +03:00
|
|
|
if test $? = 0; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo not found
|
2001-11-10 03:05:52 +03:00
|
|
|
echo ERROR: without $GZIP in your PATH, I cannot continue.
|
2001-11-10 02:56:29 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo -n "Checking for $HOME/.bochs directory..."
|
|
|
|
if test -d "$HOME/.bochs"; then
|
|
|
|
echo "ok"
|
|
|
|
if test -f "$CONFFILE"; then
|
|
|
|
. $CONFFILE
|
|
|
|
else
|
|
|
|
makedlxdir
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo DEBUG: Creating $HOME/.bochs
|
|
|
|
mkdir -p $HOME/.bochs
|
|
|
|
mkdir -p $DLXPATH
|
|
|
|
makedlxdir
|
|
|
|
fi
|
2001-05-22 20:10:07 +04:00
|
|
|
echo Entering $DLXPATH
|
|
|
|
cd $DLXPATH
|
2001-11-10 02:56:29 +03:00
|
|
|
|
|
|
|
# Now that we're in the DLXPATH, make sure that bochsrc.txt & hd10meg.img exist
|
|
|
|
if test ! -f bochsrc.txt; then
|
|
|
|
echo ERROR: bochsrc.txt not found
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if test ! -f hd10meg.img; then
|
|
|
|
echo ERROR: hd10meg.img not found
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2001-06-02 11:40:06 +04:00
|
|
|
echo Running bochs
|
2001-05-22 20:10:07 +04:00
|
|
|
|
|
|
|
# ok now try it
|
2001-11-10 04:05:23 +03:00
|
|
|
$BOCHS -nocontrolpanel
|