Parts of the install script have been annoying me for some time, in particular the failure to check what the real names of the devices and mounts points are for the floppy and cdrom. Attached sorts that out as far as is possible. Changelog Add capability to install script to check for floppy drive and cdrom devices and mount points and amend config file accordingly as part of setup. Index: tools/wineinstall =================================================================== RCS file: /home/wine/wine/tools/wineinstall,v retrieving revision 1.38 diff -u -u -r1.38 wineinstall --- tools/wineinstall 2 Jun 2002 21:23:21 -0000 1.38 +++ tools/wineinstall 10 Jul 2002 18:36:53 -0000 @@ -83,6 +83,10 @@ # windows partition name in [Drive C] section # it should now almost always find the windows partition and real-windows # registry (if not, let me know) +# July 10 2002 - Keith Matthews +# Added tests for existing cdrom and floppy drives in fstab, also prompts +# to user for confirmation and amendment of default config script for +# those two devices #--- defaults (change these if you are a packager) CONFARGS="--enable-opengl" # configure args, e.g. --prefix=/usr --sysconfdir=/etc @@ -580,11 +584,80 @@ configure_wine_applications } fi + # test for cdrom and floppy usage + + CDDEV=`cat /etc/fstab|grep cdrom|cut -f1` + CDMOUNT=`cat /etc/fstab|grep cdrom|cut -f2` + FDDEV=`cat /etc/fstab|grep fd|cut -f1` + FDMOUNT=`cat /etc/fstab|grep fd|cut -f2` + if [ -z $FDDEV ]; then + FDDEV=`cat /etc/fstab|grep floppy|cut -f1` + FDMOUNT=`cat /etc/fstab|grep floppy|cut -f2` + fi + echo "" + if [ -n $CDDEV ] + then { + echo "Your CDROM drive appears to be $CDDEV - is this correct ?" + conf_yesno_answer "(yes/no) " + if [ "$ANSWER" = 'no' ]; then + conf_question high cd_dev "Then what is it ?" + conf_string_answer + CDDEV="$ANSWER" + fi + echo "" + echo "Your CDROM appears to be mounted as $CDMOUNT - Is this correct ?" + conf_yesno_answer "(yes/no) " + if [ "$ANSWER" = 'no' ]; then + conf_question high cd_mount "Then what is it ?" + conf_string_answer + CDMOUNT="$ANSWER" + fi + } + else + { + echo "You do not appear to have a CD drive catalogued in /etc/fstab" + echo "Please supply the device name (e.g. /dev/cdrom)" + conf_string_answer + CDDEV="$ANSWER" + echo "and now the point where it is to be mounted" + conf_string_answer + CDMOUNT="$ANSWER" + } + fi + echo "" + if [ $FDDEV ] # there other ways to test this but they always gave the wrong result + then { + echo "Your floppy drive appears to be $FDDEV - is this correct ?" + conf_yesno_answer "(yes/no) " + if [ "$ANSWER" = 'no' ]; then + conf_question high floppy_dev "Then what is it ?" + conf_string_answer + FDDEV="$ANSWER" + fi + echo "" + echo "Your floppy appears to be mounted as $FDMOUNT - Is this correct ?" + conf_yesno_answer "(yes/no) " + if [ "$ANSWER" = 'no' ]; then + conf_question high floppy_mount "Then what is it ?" + conf_string_answer + FDMOUNT="$ANSWER" + fi + } + else { + echo "You do not appear to have a floppy drive catalogued in /etc/fstab" + echo "Please supply the device name (e.g. /dev/fd0h144)" + conf_string_answer + FDDEV="$ANSWER" + echo "and now the point where it is to be mounted" + conf_string_answer + FDMOUNT="$ANSWER" + } + fi # create $LCONF using the default config file $WINEINI if [ "$DOLOCALCONF" = 'yes' ] && [ "$CONVCONF" = 'no' ] then { - sed "s|\"Path\" = \"/c\"\$|\"Path\" = \"${CROOT}\"|" $WINEINI > $TMPCONF + sed "s|\"Path\" = \"/c\"\$|\"Path\" = \"${CROOT}\"|;s|\"Path\" = \"/cdrom\"|\"Path\" = \"${CDMOUNT}\"|;s|\"Device\" = \"/dev/cdrom\"|\"Device\" = \"${CDDEV}\"|;s|\"Path\" = \"/mnt/fd0\"|\"Path\" = \"${FDMOUNT}\"|;s|\"Device\" = \"/dev/fd0\"|\"Device\" = \"${FDDEV}\"|" $WINEINI > $TMPCONF conf_reset_question default_config conf_question low default_config \ "Created $LCONF using default Wine configuration." \