diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-10-15 17:04:56 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-10-15 17:04:56 +0000 |
| commit | f215037ee65d8f831ccf7699b71b890f822bee2b (patch) | |
| tree | 721d115161ae20dd9ecfe399edaab2e76e6314aa /release | |
| parent | a6678ed23ea247e073b75e83ef09cb6c3c9fa060 (diff) | |
Notes
Diffstat (limited to 'release')
43 files changed, 1071 insertions, 850 deletions
diff --git a/release/Makefile b/release/Makefile index f1bedd638df4..f34247fecfe9 100644 --- a/release/Makefile +++ b/release/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.193.2.56 1996/07/09 17:01:49 jkh Exp $ +# $Id: Makefile,v 1.246 1996/10/14 13:29:40 jkh Exp $ # # How to roll a release: # @@ -79,17 +79,30 @@ rerelease release: cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} .if !defined(RELEASETAG) - cd ${CHROOTDIR}/usr && cvs co -P src + cd ${CHROOTDIR}/usr && rm -rf src && \ + cvs -d ${CVSROOT} co -P src +.if defined(INTCVSROOT) + cd ${CHROOTDIR}/usr && \ + cvs -d ${INTCVSROOT} co -P src/secure src/eBones +.endif .else - cd ${CHROOTDIR}/usr && cvs co -P -r ${RELEASETAG} src + cd ${CHROOTDIR}/usr && rm -rf src && \ + cvs co -d ${CVSROOT} -P -r ${RELEASETAG} src +.if defined(INTCVSROOT) + cd ${CHROOTDIR}/usr && \ + cvs -d ${INTCVSROOT} co -P -r ${RELEASETAG} src/secure src/eBones +.endif +.endif +.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) + cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES} .endif .endif .if make(rerelease) .if !defined(RELEASENOUPDATE) .if !defined(RELEASETAG) - cd ${CHROOTDIR}/usr && cvs -q update -P -d src + cd ${CHROOTDIR}/usr/src && cvs -q update -P -d .else - cd ${CHROOTDIR}/usr && cvs -q update -P -d -r ${RELEASETAG} src + cd ${CHROOTDIR}/usr/src && cvs -q update -P -d -r ${RELEASETAG} .endif .endif .endif @@ -98,7 +111,9 @@ rerelease release: sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh&& rm foo ) ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \ sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && \ - mv version.h.new version.h ) + mv version.h.new version.h && \ + echo XXXX ) + -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release echo "#!/bin/sh" > ${CHROOTDIR}/mk echo "set -ex" >> ${CHROOTDIR}/mk echo "CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk @@ -185,7 +200,7 @@ release.3: # You are not supposed to like this :-) release.4: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR - cd ${.CURDIR}/sysinstall && make obj && make depend && make all + cd ${.CURDIR}/sysinstall && make depend all rm -rf ${RD}/crunch mkdir -p ${RD}/crunch for j in ${WHICH_CRUNCH} ; do \ @@ -205,7 +220,7 @@ release.4: # release.5: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR - # Handle some grief caused by the ammunition braindeadness. + # Handle some grief caused by the munition braindeadness. for i in sbin/init bin/ed ; do \ ( cd ${.CURDIR}/../$$i; \ make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ @@ -213,43 +228,43 @@ release.5: # Move all the manpages out to their own dist if [ -d ${RD}/trees/bin/usr/share/man ] ; then \ - rm -rf ${RD}/trees/manpages/usr/share/man &&\ - mv ${RD}/trees/bin/usr/share/man \ - ${RD}/trees/manpages/usr/share/man ;\ + tar -cf - -C ${RD}/trees/bin/usr/share/man . | \ + tar xf - -C ${RD}/trees/manpages/usr/share/man && \ + rm -rf ${RD}/trees/bin/usr/share/man; \ fi # Move all the games out to their own dist if [ -d ${RD}/trees/bin/usr/games ] ; then \ - rm -rf ${RD}/trees/games/usr/games &&\ - mv ${RD}/trees/bin/usr/games \ - ${RD}/trees/games/usr/games ;\ + tar -cf - -C ${RD}/trees/bin/usr/games . | \ + tar -xf - -C ${RD}/trees/games/usr/games && \ + rm -rf ${RD}/trees/bin/usr/games; \ fi if [ -d ${RD}/trees/bin/usr/share/games ] ; then \ - rm -rf ${RD}/trees/games/usr/share/games &&\ - mv ${RD}/trees/bin/usr/share/games \ - ${RD}/trees/games/usr/share/games ;\ + tar -cf - -C ${RD}/trees/bin/usr/share/games . | \ + tar -xf - -C ${RD}/trees/games/usr/share/games && \ + rm -rf ${RD}/trees/bin/usr/share/games; \ fi if [ -d ${RD}/trees/bin/var/games ] ; then \ - rm -rf ${RD}/trees/games/var/games &&\ - mv ${RD}/trees/bin/var/games \ - ${RD}/trees/games/var/games ;\ + tar -cf - -C ${RD}/trees/bin/var/games . | \ + tar -xf - -C ${RD}/trees/games/var/games && \ + rm -rf ${RD}/trees/bin/var/games; \ fi # Move the dict out to their own dist if [ -d ${RD}/trees/bin/usr/share/dict ] ; then \ - rm -rf ${RD}/trees/dict/usr/share/dict &&\ - mv ${RD}/trees/bin/usr/share/dict \ - ${RD}/trees/dict/usr/share/dict ;\ + tar -cf - -C ${RD}/trees/bin/usr/share/dict . | \ + tar -xf - -C ${RD}/trees/dict/usr/share/dict && \ + rm -rf ${RD}/trees/bin/usr/share/dict; \ fi for i in airport birthtoken flowers na.phone zipcodes ; do \ if [ -f ${RD}/trees/bin/usr/share/misc/$$i ] ; then \ mv ${RD}/trees/bin/usr/share/misc/$$i \ - ${RD}/trees/dict/usr/share/misc ; \ + ${RD}/trees/dict/usr/share/misc; \ fi ; \ done # Move the info files out to their own dist if [ -d ${RD}/trees/bin/usr/share/info ] ; then \ - rm -rf ${RD}/trees/info/usr/share/info &&\ - mv ${RD}/trees/bin/usr/share/info \ - ${RD}/trees/info/usr/share ;\ + tar -cf - -C ${RD}/trees/bin/usr/share/info . | \ + tar -xf - -C ${RD}/trees/info/usr/share/info && \ + rm -rf ${RD}/trees/bin/usr/share/info; \ fi # Move the profiled libraries out to their own dist for i in ${RD}/trees/bin/usr/lib/*_p.a ; do \ @@ -341,7 +356,7 @@ release.7: # +-----------------------------------------+ # -release.8: write_mfs_in_kernel +release.8: write_mfs_in_kernel dumpnlist @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -rf ${RD}/mfsfd mkdir ${RD}/mfsfd @@ -361,6 +376,7 @@ release.8: write_mfs_in_kernel echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz + -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd # make the small bootfd @echo "Making the small 4MB boot floppy." sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \ @@ -421,7 +437,8 @@ ftp.1: # cdrom.1: mkdir -p ${CD}/filesys - cd ${RD} && find floppies dists -print | cpio -dumpl ${CD} + cd ${RD} && find floppies -print | cpio -dumpl ${CD} + cd ${RD}/dists && find . -print | cpio -dumpl ${CD} ln -f ${RD}/kernels/MFSKERNEL.std ${CD}/kernel ln -f ${RD}/trees/bin/usr/mdec/fbsdboot.exe ${CD} for i in ${DISTRIBUTIONS} ; \ @@ -487,6 +504,9 @@ fixit.flp: write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c +dumpnlist: ${.CURDIR}/dumpnlist.c + ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c + ckRELEASEDIR: .if !defined(RELEASEDIR) @echo "To make a release RELEASEDIR must be defined" && false @@ -532,33 +552,46 @@ doKERNEL: # doMFSKERN: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR - rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} - rm -f /sys/compile/BOOTMFS/mfs_vfsops.o - cd ${.CURDIR}/../sys/i386/conf && \ + @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} + @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o + @cd ${.CURDIR}/../sys/i386/conf && \ sed -e '/SYSV/d' \ -e '/pty/d' \ -e '/PROCFS/d' \ + -e '/KTRACE/d' \ -e 's/GENERIC/BOOTMFS/g' \ -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \ echo "options MFS" >> BOOTMFS && \ echo "options NFS_NOSERVER" >> BOOTMFS && \ - echo 'options "MAXCONS=4"' >> BOOTMFS - echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \ + echo 'options "MAXCONS=4"' >> BOOTMFS && \ + echo "options USERCONFIG_BOOT" >> BOOTMFS + @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \ ${.CURDIR}/../sys/i386/conf/BOOTMFS cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS - rm -rf ${RD}/boot.${FSIMAGE} - mkdir ${RD}/boot.${FSIMAGE} - mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} - cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel + @rm -rf ${RD}/boot.${FSIMAGE} + @mkdir ${RD}/boot.${FSIMAGE} + @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} + @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel + @vnconfig /dev/vn0 fs-image.${FSIMAGE} + @mkdir -p /tmp/mnt_xx + @mount /dev/vn0 /tmp/mnt_xx + ./dumpnlist ${RD}/boot.${FSIMAGE}/kernel > /tmp/mnt_xx/stand/symbols + @umount /tmp/mnt_xx + @vnconfig -u /dev/vn0 + @rmdir /tmp/mnt_xx ./write_mfs_in_kernel ${RD}/boot.${FSIMAGE}/kernel \ fs-image.${FSIMAGE} kzip -v ${RD}/boot.${FSIMAGE}/kernel - mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE} - mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel - ls -l ${RD}/boot.${FSIMAGE}/kernel - rm -f ${RD}/floppies/boot${FSIMAGE}.flp - sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/boot.${FSIMAGE} \ - 100000 ${FDLABEL} - mv fs-image ${RD}/floppies/boot${FSIMAGE}.flp + @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE} + @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel + @ls -l ${RD}/boot.${FSIMAGE}/kernel + @rm -f ${RD}/floppies/boot${FSIMAGE}.flp + cat /usr/mdec/rawboot ${RD}/boot.${FSIMAGE}/kernel | \ + dd conv=sync of=${RD}/floppies/boot${FSIMAGE}.flp + @echo 'USERCONFIG' > startup_foo + @echo 'intro' >> startup_foo + dd if=startup_foo of=${RD}/floppies/boot${FSIMAGE}.flp \ + seek=1 bs=512 count=1 conv=sync + @rm -f startup_foo .include <bsd.prog.mk> diff --git a/release/boot_crunch.conf b/release/boot_crunch.conf index d6b093d00873..e1e42c6d404b 100644 --- a/release/boot_crunch.conf +++ b/release/boot_crunch.conf @@ -1,4 +1,4 @@ -# $Id: boot_crunch.conf,v 1.20.2.3 1995/10/05 08:58:19 jkh Exp $ +# $Id: boot_crunch.conf,v 1.24 1996/10/07 04:16:36 jkh Exp $ srcdirs /usr/src/bin /usr/src/sbin /usr/src/release /usr/src/usr.bin srcdirs /usr/src/gnu/usr.bin /usr/src/usr.sbin /usr/src/sbin/i386 @@ -11,5 +11,5 @@ ln gzip gunzip ln gzip zcat ln sh -sh -libs -ll -ledit -lutil -lkvm -lmd -libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk +libs -ll -ledit -lutil -lkvm -lmd -lcrypt +libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx diff --git a/release/doFS.sh b/release/doFS.sh index 984120072cf8..d7315c770672 100644 --- a/release/doFS.sh +++ b/release/doFS.sh @@ -34,27 +34,15 @@ do vnconfig -s labels -c /dev/r${VNDEVICE} fs-image - sed '/^minimum:/,$d' /etc/disktab > /etc/disktab.tmp - cat /etc/disktab.tmp > /etc/disktab - rm -f /etc/disktab.tmp - ( - a=`expr ${FSSIZE} \* 2` - echo - echo "minimum:ty=mfs:se#512:nt#1:rm#300:\\" - echo " :ns#$a:nc#1:\\" - echo " :pa#$a:oa#0:ba#4096:fa#512:\\" - echo " :pc#$a:oc#0:bc#4096:fc#512:" - echo - ) >> /etc/disktab - - disklabel -w -r -B \ + dd if=${RD}/trees/bin/usr/mdec/boot1 of=fs-image conv=notrunc + disklabel /dev/r${VNDEVICE} | disklabel -R -B \ -b ${RD}/trees/bin/usr/mdec/fdboot \ -s ${RD}/trees/bin/usr/mdec/bootfd \ - /dev/r${VNDEVICE} minimum + /dev/r${VNDEVICE} /dev/stdin - newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T minimum -o space /dev/r${VNDEVICE}a + newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T minimum -o space /dev/r${VNDEVICE}c - mount /dev/${VNDEVICE}a ${MNT} + mount /dev/${VNDEVICE}c ${MNT} ( set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT} ) @@ -62,7 +50,7 @@ do umount ${MNT} - fsck -p /dev/r${VNDEVICE}a < /dev/null + fsck -p /dev/r${VNDEVICE}c < /dev/null vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true diff --git a/release/fixit_crunch.conf b/release/fixit_crunch.conf index d88848176467..b35e6d6aa90b 100644 --- a/release/fixit_crunch.conf +++ b/release/fixit_crunch.conf @@ -1,4 +1,4 @@ -# $Id: fixit_crunch.conf,v 1.3.4.6 1995/10/05 09:08:29 jkh Exp $ +# $Id: fixit_crunch.conf,v 1.8 1996/07/31 05:21:20 jkh Exp $ # first, we list the source dirs that our programs reside in. These are # searched in order listed to find the dir containing each program. @@ -27,6 +27,7 @@ progs mount_msdos mount_cd9660 mount_nfs ln dump rdump ln restore rrestore ln newfs mount_mfs +ln chown chgrp # /usr/bin stuff diff --git a/release/scripts/src-install.sh b/release/scripts/src-install.sh index 3c0c3d87c029..a7b593b13772 100755 --- a/release/scripts/src-install.sh +++ b/release/scripts/src-install.sh @@ -8,13 +8,20 @@ if [ $# -lt 1 ]; then echo "You must specify which components of src to extract" echo "possible subcomponents are:" echo - echo "base bin etc games gnu include lib libexec lkm release" - echo "sbin share smailcf sys ubin usbin" + echo "base bin contrib etc games gnu include lib libexec lkm" + echo "release sbin share smailcf sys ubin usbin" echo + echo "You may also specify all to extract all subcomponents." exit 1 fi -for i in $*; do +if [ "$1" = "all" ]; then + dists="base bin contrib etc games gnu include lib libexec lkm release sbin share smailcf sys ubin usbin" +else + dists="$*" +fi + +for i in $dists; do echo "Extracting source component: $i" cat s${i}.?? | tar --unlink -xpzf - -C /usr/src done diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile index 4974832d3706..a056620efbdd 100644 --- a/release/sysinstall/Makefile +++ b/release/sysinstall/Makefile @@ -1,6 +1,6 @@ PROG= sysinstall NOMAN= yes -CLEANFILES+= makedevs.c rtermcap +CLEANFILES+= makedevs.c rtermcap dumpnlist .PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum @@ -9,13 +9,19 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \ ftp_strat.c globals.c index.c install.c installUpgrade.c \ label.c lndir.c main.c makedevs.c media.c menus.c misc.c \ msg.c network.c nfs.c options.c package.c samba.c system.c \ - tape.c tcpip.c termcap.c ufs.c variable.c wizard.c + tape.c tcpip.c termcap.c ufs.c variable.c wizard.c \ + uc_eisa.c uc_isa.c uc_kmem.c uc_list.c uc_main.c uc_pci.c \ + uc_scsi.c -CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog +CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys +CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS -DSAVE_USERCONFIG + +#CFLAGS+= -DLOAD_CONFIG_FILE=\"install.cfg\" DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk + makedevs.c: Makefile rtermcap rm -f makedevs.tmp echo '#include <sys/types.h>' > makedevs.tmp diff --git a/release/sysinstall/attr.c b/release/sysinstall/attr.c index 875acc03218b..7c688dbf4415 100644 --- a/release/sysinstall/attr.c +++ b/release/sysinstall/attr.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: attr.c,v 1.3.2.12 1996/05/24 06:08:11 jkh Exp $ + * $Id: attr.c,v 1.8 1996/09/08 01:39:23 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -22,10 +22,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR THEIR PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) diff --git a/release/sysinstall/cdrom.c b/release/sysinstall/cdrom.c index aa17fdc87d19..89e90fdafb4d 100644 --- a/release/sysinstall/cdrom.c +++ b/release/sysinstall/cdrom.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: cdrom.c,v 1.7.2.25 1996/07/13 05:52:02 jkh Exp $ + * $Id: cdrom.c,v 1.26 1996/10/14 21:32:22 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -52,14 +52,12 @@ #undef CD9660 /* - * This isn't static, like the others, since it's often useful to know whether - * or not we have a CDROM available in some of the other installation screens. - * This also isn't a boolean like the others since we have 3 states for it: + * This isn't a boolean like the others since we have 3 states for it: * 0 = cdrom isn't mounted, 1 = cdrom is mounted and we mounted it, 2 = cdrom * was already mounted when we came in and we should leave it that way when * we leave. */ -int cdromMounted; +static int cdromMounted; Boolean mediaInitCDROM(Device *dev) @@ -83,13 +81,15 @@ mediaInitCDROM(Device *dev) if (!file_readable("/cdrom/cdrom.inf")) { Mkdir("/cdrom"); if (mount(MOUNT_CD9660, "/cdrom", MNT_RDONLY, (caddr_t) &args) == -1) { - msgConfirm("Error mounting %s on /cdrom: %s (%u)", dev->devname, strerror(errno), errno); - return FALSE; + if (errno != EBUSY) { + msgConfirm("Error mounting %s on /cdrom: %s (%u)", dev->devname, strerror(errno), errno); + return FALSE; + } } - else if (!file_readable("/cdrom/cdrom.inf")) { + if (!file_readable("/cdrom/cdrom.inf")) { if (msgYesNo("Warning: The CD currently in the drive is either not a FreeBSD\n" "CD or it is an older (pre 2.1.5) FreeBSD CD which does not\n" - "have a version number on it. Do you wish to use this CD anyway?")) { + "have a version number on it. Do you wish to use this CD anyway?") != 0) { unmount("/cdrom", MNT_FORCE); return FALSE; } @@ -109,8 +109,9 @@ mediaInitCDROM(Device *dev) "Please fix this problem (check the console logs on VTY2) and\n" "try again."); else - msgConfirm("Warning: The version of the FreeBSD CD currently in the drive (%s)\n" - "does not match the version of this boot floppy (%s).\n" + msgConfirm("Warning: The version of the FreeBSD CD currently in the drive\n" + "(%s) does not match the version of this boot floppy\n" + "(%s).\n\n" "If this is intentional, then please visit the Options editor\n" "to set the boot floppy version string to match that of the CD\n" "before selecting it as an installation media to avoid this warning", cp, variable_get(VAR_RELNAME)); @@ -124,7 +125,8 @@ mediaGetCDROM(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; - msgDebug("Request for %s from CDROM\n", file); + if (isDebug()) + msgDebug("Request for %s from CDROM\n", file); snprintf(buf, PATH_MAX, "/cdrom/%s", file); if (file_readable(buf)) return open(buf, O_RDONLY); diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index 47a7f82e0abc..75bd302164f4 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.16.2.58 1996/07/08 09:07:08 jkh Exp $ + * $Id: config.c,v 1.51 1996/10/14 21:32:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -48,8 +48,6 @@ static Chunk *chunk_list[MAX_CHUNKS]; static int nchunks; -extern int cdromMounted; - /* arg to sort */ static int chunk_compare(Chunk *c1, Chunk *c2) @@ -333,8 +331,8 @@ configSaverTimeout(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_REDRAW; } else - return variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") - ? DITEM_SUCCESS : DITEM_FAILURE; + return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") + ? DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE; } int @@ -349,7 +347,7 @@ configNTP(dialogMenuItem *self) snprintf(tmp, 255, "%s=%s", VAR_NTPDATE, variable_get(VAR_NTPDATE)); self->aux = (int)tmp; } - return status; + return status | DITEM_RESTORE; } int @@ -376,17 +374,19 @@ configResolv(void) if (!RunningAsInit && file_readable("/etc/resolv.conf")) return; - if (!variable_get(VAR_NAMESERVER)) { - if (mediaDevice && (mediaDevice->type == DEVICE_TYPE_NFS || mediaDevice->type == DEVICE_TYPE_FTP)) - msgConfirm("Warning: Missing name server value - network operations\n" - "may fail as a result!"); - goto skip; - } if (Mkdir("/etc")) { msgConfirm("Unable to create /etc directory. Network configuration\n" "files will therefore not be written!"); return; } + + cp = variable_get(VAR_NAMESERVER); + if (!cp || !*cp) { + msgConfirm("Warning: Missing name server value - be sure to refer\n" + "to other hosts in any network operation by IP address\n" + "rather than name (or go back and fill in a name server)."); + goto skip; + } fp = fopen("/etc/resolv.conf", "w"); if (!fp) { msgConfirm("Unable to open /etc/resolv.conf! You will need to do this manually."); @@ -394,40 +394,45 @@ configResolv(void) } if (variable_get(VAR_DOMAINNAME)) fprintf(fp, "domain\t%s\n", variable_get(VAR_DOMAINNAME)); - fprintf(fp, "nameserver\t%s\n", variable_get(VAR_NAMESERVER)); + fprintf(fp, "nameserver\t%s\n", cp); fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/resolv.conf\n"); skip: /* Tack ourselves into /etc/hosts */ - cp = variable_get(VAR_IPADDR); + fp = fopen("/etc/hosts", "w"); + + /* Add an entry for localhost */ dp = variable_get(VAR_DOMAINNAME); - if (cp && *cp != '0' && (hp = variable_get(VAR_HOSTNAME))) { + fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp ? dp : "my.domain"); + + /* Now the host entries, if applicable */ + cp = variable_get(VAR_IPADDR); + hp = variable_get(VAR_HOSTNAME); + if (cp && cp[0] != '0' && hp) { char cp2[255]; - fp = fopen("/etc/hosts", "w"); if (!index(hp, '.')) cp2[0] = '\0'; else { strcpy(cp2, hp); *(index(cp2, '.')) = '\0'; } - fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp ? dp : "my.domain"); fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2); fprintf(fp, "%s\t\t%s.\n", cp, hp); - fclose(fp); - if (isDebug()) - msgDebug("Wrote entry for %s to /etc/hosts\n", cp); } + fclose(fp); + if (isDebug()) + msgDebug("Wrote entry for %s to /etc/hosts\n", cp); } int configRoutedFlags(dialogMenuItem *self) { - return variable_get_value(VAR_ROUTEDFLAGS, + return (variable_get_value(VAR_ROUTEDFLAGS, "Specify the flags for routed; -q is the default, -s is\n" - "a good choice for gateway machines.") ? DITEM_SUCCESS : DITEM_FAILURE; + "a good choice for gateway machines.") ? DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE; } int @@ -448,7 +453,7 @@ configPackages(dialogMenuItem *self) msgNotify("Attempting to fetch packages/INDEX file from selected media."); fd = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE); if (fd < 0) { - dialog_clear(); + dialog_clear_norefresh(); msgConfirm("Unable to get packages/INDEX file from selected media.\n" "This may be because the packages collection is not available at\n" "on the distribution media you've chosen (most likely an FTP site\n" @@ -456,7 +461,7 @@ configPackages(dialogMenuItem *self) "(or path to media) and try again. If your local site does not\n" "carry the packages collection, then we recommend either a CD\n" "distribution or the master distribution on ftp.freebsd.org."); - return DITEM_FAILURE; + return DITEM_FAILURE | DITEM_RESTORE; } msgNotify("Got INDEX successfully, now building packages menu.."); index_init(&top, &plist); @@ -464,7 +469,7 @@ configPackages(dialogMenuItem *self) msgConfirm("I/O or format error on packages/INDEX file.\n" "Please verify media (or path to media) and try again."); mediaDevice->close(mediaDevice, fd); - return DITEM_FAILURE; + return DITEM_FAILURE | DITEM_RESTORE; } mediaDevice->close(mediaDevice, fd); index_sort(&top); @@ -489,7 +494,7 @@ configPackages(dialogMenuItem *self) } } else { - dialog_clear(); + dialog_clear_norefresh(); msgConfirm("No packages were selected for extraction."); break; } @@ -502,101 +507,7 @@ configPackages(dialogMenuItem *self) tmp = tmp2; } index_init(NULL, &plist); - return DITEM_SUCCESS; -} - -int -configPorts(dialogMenuItem *self) -{ - char *cp, *dist = NULL; /* Shut up compiler */ - int status = DITEM_SUCCESS, tries = 0; - - dialog_clear(); - if (!variable_get(VAR_PORTS_PATH)) - variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports"); - dialog_clear(); - while (!directory_exists(dist)) { - if (++tries > 2) { - msgConfirm("You appear to be having some problems with your CD drive\n" - "or perhaps cannot find the second CD. This step will now\n" - "therefore be skipped."); - status = DITEM_FAILURE; - goto fixup; - } - - /* Even if we're running multi-user, unmount it for this case */ - cdromMounted = CD_WE_MOUNTED_IT; - mediaDevice->shutdown(mediaDevice); - - msgConfirm("The ports collection is now on the second CDROM due to\n" - "space constraints. Please remove the first CD from the\n" - "drive at this time and insert the second CDROM. You will\n" - "also need to have the second CDROM in your drive any time\n" - "you wish to use the ports collection. When you're ready,\n" - "please press [ENTER]."); - if (!mediaDevice->init(mediaDevice)) { - msgConfirm("Mount failed - either the CDROM isn't in the drive or\n" - "you did not allow sufficient time for the drive to become\n" - "ready before pressing [ENTER]. Please try again."); - } - } - - cp = msgGetInput("/usr/ports", - "Where would you like to create the link tree?\n" - "(press [ENTER] for default location). The link tree should\n" - "reside in a directory with as much free space as possible,\n" - "as you'll need space to compile any ports."); - if (!cp || !*cp) { - status = DITEM_FAILURE; - goto fixup; - } - if (Mkdir(cp)) { - status = DITEM_FAILURE; - goto fixup; - } - if (strcmp(cp, "/usr/ports")) { - unlink("/usr/ports"); - if (symlink(cp, "/usr/ports") == -1) { - msgConfirm("Unable to create a symlink from /usr/ports to %s!\n" - "I can't continue, sorry!", cp); - status = DITEM_FAILURE; - goto fixup; - } - else { - msgConfirm("NOTE: This directory is also now symlinked to /usr/ports\n" - "which, for a variety of reasons, is the directory the ports\n" - "framework expects to find its files in. You should refer to\n" - "/usr/ports instead of %s directly when you're working in the\n" - "ports collection.", cp); - } - } - msgNotify("Making a link tree from %s to %s.", dist, cp); - if (DITEM_STATUS(lndir(dist, cp)) != DITEM_SUCCESS) { - msgConfirm("The lndir function returned an error status and may not have.\n" - "successfully generated the link tree. You may wish to inspect\n" - "the /usr/ports directory carefully for any missing link files."); - } - else { - msgConfirm("The /usr/ports directory is now ready to use. When the system comes\n" - "up fully, you can cd to this directory and type `make' in any sub-\n" - "directory for which you'd like to compile a port. You can also\n" - "cd to /usr/ports and type `make print-index' for a complete list of all\n" - "ports in the hierarchy."); - } -fixup: - tries = 0; - while (++tries < 3) { - mediaDevice->shutdown(mediaDevice); - msgConfirm("Done with the second CD. Please remove it and reinsert the first\n" - "CDROM now. It may be required for subsequence installation steps.\n\n" - "When you've done so, please press [ENTER]."); - if (!mediaDevice->init(mediaDevice)) { - msgConfirm("Mount failed - either the CDROM isn't in the drive or\n" - "you did not allow sufficient time for the drive to become\n" - "ready before pressing [ENTER]. Please try again."); - } - } - return status | DITEM_RESTORE; + return DITEM_SUCCESS | DITEM_RESTORE | DITEM_RECREATE; } /* Load gated package */ @@ -621,6 +532,10 @@ configNovell(dialogMenuItem *self) { int ret = DITEM_SUCCESS; + if (!RunningAsInit) { + msgConfirm("This package can only be installed in multi-user mode."); + return ret; + } if (variable_get(VAR_NOVELL)) variable_unset(VAR_NOVELL); else { @@ -628,7 +543,7 @@ configNovell(dialogMenuItem *self) if (DITEM_STATUS(ret) == DITEM_SUCCESS) variable_set2(VAR_NOVELL, "YES"); } - return ret; + return ret | DITEM_RESTORE; } /* Load pcnfsd package */ @@ -658,6 +573,7 @@ configNFSServer(dialogMenuItem *self) if (!file_readable("/etc/exports")) { WINDOW *w = savescr(); + dialog_clear_norefresh(); msgConfirm("Operating as an NFS server means that you must first configure\n" "an /etc/exports file to indicate which hosts are allowed certain\n" "kinds of access to your local file systems.\n" diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c index 19699b4e98e5..75a160a9fcb6 100644 --- a/release/sysinstall/devices.c +++ b/release/sysinstall/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.48 1996/07/13 05:09:29 jkh Exp $ + * $Id: devices.c,v 1.49 1996/10/05 11:56:47 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -219,9 +219,56 @@ deviceGetAll(void) free(names); } - /* - * Try to get all the types of devices it makes sense to get at the - * second stage of the installation. + /* Now go for the network interfaces. Stolen shamelessly from ifconfig! */ + ifc.ifc_len = sizeof(buffer); + ifc.ifc_buf = buffer; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) { + msgConfirm("ifconfig: socket"); + return; + } + if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) { + msgConfirm("ifconfig (SIOCGIFCONF)"); + return; + } + ifflags = ifc.ifc_req->ifr_flags; + end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); + for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) { + char *descr; + + /* If it's not a link entry, forget it */ + if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK) + continue; + /* Eliminate network devices that don't make sense */ + if (!strncmp(ifptr->ifr_name, "tun", 3) + || !strncmp(ifptr->ifr_name, "lo0", 3)) + continue; + descr = NULL; + for (i = 0; device_names[i].name; i++) { + int len = strlen(device_names[i].name); + + if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) { + descr = device_names[i].description; + break; + } + } + if (!descr) + descr = "<unknown network interface type>"; + deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE, + mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL); + msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name); + close(s); + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + msgConfirm("ifconfig: socket"); + continue; + } + if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */ + ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr)); + } + + /* Finally, try to find all the types of devices one might need + * during the second stage of the installation. */ for (i = 0; device_names[i].name; i++) { char try[FILENAME_MAX]; @@ -287,54 +334,6 @@ deviceGetAll(void) break; } } - - /* Now go for the (other) network interfaces dynamically. Stolen shamelessly from ifconfig! */ - ifc.ifc_len = sizeof(buffer); - ifc.ifc_buf = buffer; - - s = socket(AF_INET, SOCK_DGRAM, 0); - if (s < 0) { - msgConfirm("ifconfig: socket"); - return; - } - if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) { - msgConfirm("ifconfig (SIOCGIFCONF)"); - return; - } - ifflags = ifc.ifc_req->ifr_flags; - end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) { - char *descr; - - /* If it's not a link entry, forget it */ - if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK) - continue; - /* Eliminate network devices that don't make sense */ - if (!strncmp(ifptr->ifr_name, "tun", 3) - || !strncmp(ifptr->ifr_name, "lo0", 3)) - continue; - descr = NULL; - for (i = 0; device_names[i].name; i++) { - int len = strlen(device_names[i].name); - - if (!strncmp(ifptr->ifr_name, device_names[i].name, len)) { - descr = device_names[i].description; - break; - } - } - if (!descr) - descr = "<unknown network interface type>"; - deviceRegister(ifptr->ifr_name, descr, strdup(ifptr->ifr_name), DEVICE_TYPE_NETWORK, TRUE, - mediaInitNetwork, NULL, NULL, mediaShutdownNetwork, NULL); - msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name); - close(s); - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - msgConfirm("ifconfig: socket"); - continue; - } - if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */ - ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr)); - } } /* diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c index 319c2493eae3..04d04d87acaf 100644 --- a/release/sysinstall/disks.c +++ b/release/sysinstall/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.55 1996/07/09 03:07:47 jkh Exp $ + * $Id: disks.c,v 1.70 1996/10/09 09:53:27 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -48,12 +48,13 @@ static int current_chunk; static void record_chunks(Disk *d) { - struct chunk *c1; + struct chunk *c1 = NULL; int i = 0; int last_free = 0; + if (!d->chunks) msgFatal("No chunk list found for %s!", d->name); - current_chunk = 0; + for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == unused && c1->size > last_free) { last_free = c1->size; @@ -62,32 +63,34 @@ record_chunks(Disk *d) chunk_info[i++] = c1; } chunk_info[i] = NULL; + if (current_chunk >= i) + current_chunk = i - 1; } +static int Total; + static void print_chunks(Disk *d) { int row; int i; - if ((!d->bios_cyl || d->bios_cyl > 65536) || (!d->bios_hd || d->bios_hd > 256) || (!d->bios_sect || d->bios_sect >= 64)) { - int sz; - - dialog_clear(); - msgConfirm("WARNING: The current geometry for %s is incorrect. Using\n" + for (i = Total = 0; chunk_info[i]; i++) + Total += chunk_info[i]->size; + if (d->bios_hd <= 1 && d->bios_sect <= 1) { + All_FreeBSD(d, TRUE); + d->bios_hd = d->bios_sect = d->bios_cyl = 1; + } + else if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) { + dialog_clear_norefresh(); + msgConfirm("WARNING: A geometry of %d/%d/%d for %s is incorrect. Using\n" "a default geometry of 64 heads and 32 sectors. If this geometry\n" "is incorrect or you are unsure as to whether or not it's correct,\n" "please consult the Hardware Guide in the Documentation submenu\n" - "or use the (G)eometry command to change it now.", d->name); + "or use the (G)eometry command to change it now.", d->bios_cyl, d->bios_hd, d->bios_sect, d->name); d->bios_hd = 64; d->bios_sect = 32; - sz = 0; - for (i = 0; chunk_info[i]; i++) - sz += chunk_info[i]->size; - if (sz) - d->bios_cyl = sz / ONE_MEG; - else - msgConfirm("Couldn't set geometry! You'll have to do it by hand."); + d->bios_cyl = Total / ONE_MEG; } attrset(A_NORMAL); mvaddstr(0, 0, "Disk name:\t"); @@ -168,20 +171,27 @@ getBootMgr(char *dname) void diskPartition(Device *dev, Disk *d) { - char *p; - int key = 0; + char *cp, *p; + int rv, key = 0; Boolean chunking; char *msg = NULL; u_char *mbrContents; - WINDOW *w; + WINDOW *w = savescr(); chunking = TRUE; keypad(stdscr, TRUE); - w = savescr(); - clear(); + /* Flush both the dialog and curses library views of the screen + since we don't always know who called us */ + dialog_clear_norefresh(), clear(); + + /* Set up the chunk array */ record_chunks(d); + while (chunking) { + char *val, geometry[80]; + + /* Now print our overall state */ print_chunks(d); print_command_summary(); if (msg) { @@ -189,21 +199,25 @@ diskPartition(Device *dev, Disk *d) beep(); msg = NULL; } + else { + move(23, 0); + clrtoeol(); + } - key = toupper(getch()); - switch (key) { - - case '\014': /* ^L */ + /* Get command character */ + key = getch(); + switch (toupper(key)) { + case '\014': /* ^L (redraw) */ clear(); - print_command_summary(); - continue; - + msg = NULL; + break; + case KEY_UP: case '-': if (current_chunk != 0) --current_chunk; break; - + case KEY_DOWN: case '+': case '\r': @@ -224,15 +238,14 @@ diskPartition(Device *dev, Disk *d) case KEY_F(1): case '?': systemDisplayHelp("slice"); + clear(); break; - case 'A': { - int rv; - + case 'A': rv = msgYesNo("Do you want to do this with a true partition entry\n" "so as to remain cooperative with any future possible\n" "operating systems on the drive(s)?"); - if (rv) { + if (rv != 0) { rv = !msgYesNo("This is dangerous in that it will make the drive totally\n" "uncooperative with other potential operating systems on the\n" "same disk. It will lead instead to a totally dedicated disk,\n" @@ -246,14 +259,21 @@ diskPartition(Device *dev, Disk *d) "less at risk.\n\n" "Do you insist on dedicating the entire disk this way?"); } + if (rv == -1) + rv = 0; All_FreeBSD(d, rv); if (rv) d->bios_hd = d->bios_sect = d->bios_cyl = 1; + else { + d->bios_hd = 64; + d->bios_sect = 32; + d->bios_cyl = Total / ONE_MEG; + } variable_set2(DISK_PARTITIONED, "yes"); record_chunks(d); - } - break; - + clear(); + break; + case 'B': if (chunk_info[current_chunk]->type != freebsd) msg = "Can only scan for bad blocks in FreeBSD partition."; @@ -265,8 +285,9 @@ diskPartition(Device *dev, Disk *d) else chunk_info[current_chunk]->flags |= CHUNK_BAD144; } + clear(); break; - + case 'C': if (chunk_info[current_chunk]->type != unused) msg = "Partition in use, delete it first or move to an unused one."; @@ -274,10 +295,10 @@ diskPartition(Device *dev, Disk *d) char *val, tmp[20], *cp; int size, subtype; chunk_e partitiontype; - + snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size); val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks\n" - "or append a trailing `M' for megabytes (e.g. 20M)."); + "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= ONE_MEG; @@ -292,21 +313,22 @@ diskPartition(Device *dev, Disk *d) "and use the partition."); if (val && (subtype = strtol(val, NULL, 0)) > 0) { if (subtype==165) - partitiontype=freebsd; + partitiontype=freebsd; else if (subtype==6) - partitiontype=fat; + partitiontype=fat; else - partitiontype=unknown; - Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, - (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); - variable_set2(DISK_PARTITIONED, "yes"); - record_chunks(d); + partitiontype=unknown; + Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, + (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); + variable_set2(DISK_PARTITIONED, "yes"); + record_chunks(d); } } + clear(); } break; - - case '\177': + + case KEY_DC: case 'D': if (chunk_info[current_chunk]->type == unused) msg = "Partition is already unused!"; @@ -316,10 +338,8 @@ diskPartition(Device *dev, Disk *d) record_chunks(d); } break; - - case 'G': { - char *val, geometry[80]; - + + case 'G': snprintf(geometry, 80, "%lu/%lu/%lu", d->bios_cyl, d->bios_hd, d->bios_sect); val = msgGetInput(geometry, "Please specify the new geometry in cyl/hd/sect format.\n" "Don't forget to use the two slash (/) separator characters!\n" @@ -329,41 +349,48 @@ diskPartition(Device *dev, Disk *d) d->bios_hd = strtol(val + 1, &val, 0); d->bios_sect = strtol(val + 1, 0, 0); } - } - break; - - case 'S': - /* Set Bootable */ - chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; - break; - - case 'U': clear(); - if (msgYesNo("Are you SURE you want to Undo everything?")) - break; - d = Open_Disk(d->name); - if (!d) { - msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", d->name); - break; + break; + + case 'S': + /* Set Bootable */ + chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; + break; + + case 'U': + if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) { + msgConfirm("You've already written this information out - you\n" + "can't undo it."); } - Free_Disk(dev->private); - dev->private = d; - variable_unset(DISK_PARTITIONED); - variable_unset(DISK_LABELLED); - record_chunks(d); + else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + d = Open_Disk(d->name); + if (!d) { + msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", d->name); + clear(); + break; + } + Free_Disk(dev->private); + dev->private = d; + variable_unset(DISK_PARTITIONED); + variable_unset(DISK_LABELLED); + record_chunks(d); + } + clear(); break; case 'W': - if (!msgYesNo("WARNING: This should only be used for modifying an\n" - "EXISTING installation - DO NOT USE this option if you\n" - "are installing FreeBSD for the first time! This is not\n" - "an option for use during the standard install.\n\n" - "Are you absolutely sure you want to do this now?")) { - WINDOW *save = savescr(); - + if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) { + msgConfirm("You've already written this information out - if\n" + "you wish to overwrite it, you'll have to restart."); + } + else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + "installation. If you are installing FreeBSD for the first time\n" + "then you should simply type Q when you're finished here and your\n" + "changes will be committed in one batch automatically at the end of\n" + "these questions.\n\n" + "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_PARTITIONED, "yes"); - clear(); - + /* Don't trash the MBR if the first (and therefore only) chunk is marked for a truly dedicated * disk (i.e., the disklabel starts at sector 0), even in cases where the user has requested * booteasy or a "standard" MBR -- both would be fatal in this case. @@ -371,38 +398,31 @@ diskPartition(Device *dev, Disk *d) if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL && (mbrContents = getBootMgr(d->name)) != NULL) Set_Boot_Mgr(d, mbrContents); - + if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS) msgConfirm("Disk partition write returned an error status!"); else msgConfirm("Wrote FDISK partition information out successfully."); - restorescr(save); } + clear(); break; - + case '|': if (!msgYesNo("Are you SURE you want to go into Wizard mode?\n" "No seat belts whatsoever are provided!")) { - WINDOW *w; - - w = savescr(); - dialog_clear(); - end_dialog(); - DialogActive = FALSE; + clear(); + refresh(); slice_wizard(d); variable_set2(DISK_PARTITIONED, "yes"); - dialog_clear(); - DialogActive = TRUE; record_chunks(d); - restorescr(w); } else msg = "Wise choice!"; + clear(); break; case 'Q': chunking = FALSE; - clear(); /* Don't trash the MBR if the first (and therefore only) chunk is marked for a truly dedicated * disk (i.e., the disklabel starts at sector 0), even in cases where the user has requested * booteasy or a "standard" MBR -- both would be fatal in this case. @@ -411,7 +431,7 @@ diskPartition(Device *dev, Disk *d) && (mbrContents = getBootMgr(d->name)) != NULL) Set_Boot_Mgr(d, mbrContents); break; - + default: beep(); msg = "Type F1 or ? for help"; @@ -421,8 +441,8 @@ diskPartition(Device *dev, Disk *d) p = CheckRules(d); if (p) { char buf[FILENAME_MAX]; - - dialog_clear(); + + dialog_clear_norefresh(); use_helpline("Press F1 to read more about disk partitioning."); use_helpfile(systemHelpFile("partition", buf)); dialog_mesgbox("Disk partitioning warning:", p, -1, -1); diff --git a/release/sysinstall/dispatch.c b/release/sysinstall/dispatch.c index 1b072f08dcf1..de1b9936c3d9 100644 --- a/release/sysinstall/dispatch.c +++ b/release/sysinstall/dispatch.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dispatch.c,v 1.1.2.2 1996/06/26 09:31:48 jkh Exp $ + * $Id: dispatch.c,v 1.5 1996/10/01 12:13:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -79,7 +79,7 @@ static struct _word { { "mediaSetFTPPassive", mediaSetFTPPassive }, { "mediaSetUFS", mediaSetUFS }, { "mediaSetNFS", mediaSetNFS }, - { "mediaSetFtpUserPass", mediaSetFtpUserPass }, + { "mediaSetFTPUserPass", mediaSetFTPUserPass }, { "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity }, { "mediaGetType", mediaGetType }, { "optionsEditor", optionsEditor }, diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c index 4eca2d6c3170..b147a3899941 100644 --- a/release/sysinstall/dist.c +++ b/release/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.67 1996/07/13 05:44:51 jkh Exp $ + * $Id: dist.c,v 1.73 1996/10/10 09:22:27 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -91,6 +91,7 @@ static Distribution DESDistTable[] = { /* The /usr/src distribution */ static Distribution SrcDistTable[] = { { "sbase", "/usr/src", &SrcDists, DIST_SRC_BASE, NULL }, +{ "scontrib", "/usr/src", &SrcDists, DIST_SRC_CONTRIB, NULL }, { "sgnu", "/usr/src", &SrcDists, DIST_SRC_GNU, NULL }, { "setc", "/usr/src", &SrcDists, DIST_SRC_ETC, NULL }, { "sgames", "/usr/src", &SrcDists, DIST_SRC_GAMES, NULL }, @@ -264,7 +265,7 @@ distMaybeSetDES(dialogMenuItem *self) { int i = DITEM_SUCCESS; - dialog_clear(); + dialog_clear_norefresh(); if (!msgYesNo("Do wish to install DES cryptographic software?\n\n" "If you choose No, FreeBSD will use an MD5 based password scheme which,\n" "while perhaps more secure, is not interoperable with the traditional\n" @@ -338,7 +339,7 @@ distExtract(char *parent, Distribution *me) struct timeval start, stop; status = TRUE; - dialog_clear(); + dialog_clear_norefresh(); if (isDebug()) msgDebug("distExtract: parent: %s, me: %s\n", parent ? parent : "(none)", me->my_name); @@ -364,30 +365,9 @@ distExtract(char *parent, Distribution *me) goto done; } - /* First try to get the distribution as a single file */ - snprintf(buf, 512, "%s/%s.tgz", path, dist); /* - * Passing TRUE as 3rd parm to get routine makes this a "probing" get, for which errors - * are not considered too significant. - */ - fd = mediaDevice->get(mediaDevice, buf, TRUE); - if (fd >= 0) { - char *dir = root_bias(me[i].my_dir); - - msgNotify("Extracting %s into %s directory...", dist, dir); - status = mediaExtractDist(dir, fd); - mediaDevice->close(mediaDevice, fd); - goto done; - } - else if (fd == IO_ERROR) { /* Hard error, can't continue */ - mediaDevice->shutdown(mediaDevice); - status = FALSE; - goto done; - } - - /* - * If we couldn't get it as one file then we need to get multiple pieces; locate and parse an - * info file telling us how many we need for this distribution. + * Try to get distribution as multiple pieces, locating and parsing an + * info file which tells us how many we need for this distribution. */ dist_attr = NULL; numchunks = 0; @@ -399,7 +379,7 @@ distExtract(char *parent, Distribution *me) msgDebug("Parsing attributes file for distribution %s\n", dist); dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS); if (DITEM_STATUS(attr_parse(dist_attr, fd)) == DITEM_FAILURE) - msgConfirm("Cannot load information file for %s distribution!\n" + msgConfirm("Cannot parse information file for the %s distribution!\n" "Please verify that your media is valid and try again.", dist); else { if (isDebug()) @@ -410,12 +390,40 @@ distExtract(char *parent, Distribution *me) } safe_free(dist_attr); mediaDevice->close(mediaDevice, fd); + if (!numchunks) + continue; } else if (fd == IO_ERROR) { /* Hard error, can't continue */ mediaDevice->shutdown(mediaDevice); status = FALSE; goto done; } + else { + /* Try to get the distribution as a single file */ + snprintf(buf, 512, "%s/%s.tgz", path, dist); + /* + * Passing TRUE as 3rd parm to get routine makes this a "probing" get, for which errors + * are not considered too significant. + */ + fd = mediaDevice->get(mediaDevice, buf, TRUE); + if (fd >= 0) { + char *dir = root_bias(me[i].my_dir); + + msgNotify("Extracting %s into %s directory...", dist, dir); + status = mediaExtractDist(dir, fd); + mediaDevice->close(mediaDevice, fd); + goto done; + } + else if (fd == IO_ERROR) { /* Hard error, can't continue */ + mediaDevice->shutdown(mediaDevice); + status = FALSE; + goto done; + } + else + numchunks = 0; + } + + /* Fall through from "we got the attribute file, now get the pieces" step */ if (!numchunks) continue; @@ -428,9 +436,11 @@ distExtract(char *parent, Distribution *me) /* We have one or more chunks, go pick them up */ mediaExtractDistBegin(root_bias(me[i].my_dir), &fd2, &zpid, &cpid); for (chunk = 0; chunk < numchunks; chunk++) { - int n, retval; + int n, retval, last_msg; char prompt[80]; + last_msg = 0; + snprintf(buf, 512, "%s/%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a'); if (isDebug()) msgDebug("trying for piece %d of %d: %s\n", chunk + 1, numchunks, buf); @@ -459,12 +469,16 @@ distExtract(char *parent, Distribution *me) seconds = stop.tv_sec + (stop.tv_usec / 1000000.0); if (!seconds) seconds = 1; - msgInfo("%10d bytes read from %s dist, chunk %2d of %2d @ %.1f KB/sec.", - total, dist, chunk + 1, numchunks, (total / seconds) / 1024.0); + + if (seconds != last_msg) { + last_msg = seconds; + msgInfo("%10d bytes read from %s dist, chunk %2d of %2d @ %.1f KB/sec.", + total, dist, chunk + 1, numchunks, (total / seconds) / 1024.0); + } retval = write(fd2, buf, n); if (retval != n) { mediaDevice->close(mediaDevice, fd); - dialog_clear(); + dialog_clear_norefresh(); msgConfirm("Write failure on transfer! (wrote %d bytes of %d bytes)", retval, n); goto punt; } @@ -551,7 +565,7 @@ distExtractAll(dialogMenuItem *self) if (!mediaDevice->init(mediaDevice)) return DITEM_FAILURE; - dialog_clear(); + dialog_clear_norefresh(); msgNotify("Attempting to install all selected distributions.."); /* Try for 3 times around the loop, then give up. */ while (Dists && ++retries < 3) @@ -562,10 +576,16 @@ distExtractAll(dialogMenuItem *self) buf[0] = '\0'; printSelected(buf, Dists, DistTable, &col); - dialog_clear(); + dialog_clear_norefresh(); msgConfirm("Couldn't extract the following distributions. This may\n" "be because they were not available on the installation\n" "media you've chosen:\n\n\t%s", buf); + /* Assume that if we couldn't get all the dists, our media probably needs changing at this point */ + if (mediaDevice->type == DEVICE_TYPE_FTP) + variable_unset(VAR_FTP_PATH); + mediaDevice->shutdown(mediaDevice); + return DITEM_FAILURE | DITEM_RESTORE; } return DITEM_SUCCESS; } + diff --git a/release/sysinstall/dist.h b/release/sysinstall/dist.h index b2b4ebbda227..a2b3fec5b144 100644 --- a/release/sysinstall/dist.h +++ b/release/sysinstall/dist.h @@ -36,23 +36,24 @@ #define DIST_DES_KERBEROS 0x0008 /* Subtypes for SRC distribution */ -#define DIST_SRC_BASE 0x0001 -#define DIST_SRC_GNU 0x0002 -#define DIST_SRC_ETC 0x0004 -#define DIST_SRC_GAMES 0x0008 -#define DIST_SRC_INCLUDE 0x0010 -#define DIST_SRC_LIB 0x0020 -#define DIST_SRC_LIBEXEC 0x0040 -#define DIST_SRC_LKM 0x0080 -#define DIST_SRC_RELEASE 0x0100 -#define DIST_SRC_SBIN 0x0200 -#define DIST_SRC_SHARE 0x0400 -#define DIST_SRC_SYS 0x0800 -#define DIST_SRC_UBIN 0x1000 -#define DIST_SRC_USBIN 0x2000 -#define DIST_SRC_BIN 0x4000 -#define DIST_SRC_SMAILCF 0x8000 -#define DIST_SRC_ALL 0x7FFF /* no SMAILCF, it's part of USBIN */ +#define DIST_SRC_BASE 0x00001 +#define DIST_SRC_CONTRIB 0x00002 +#define DIST_SRC_GNU 0x00004 +#define DIST_SRC_ETC 0x00008 +#define DIST_SRC_GAMES 0x00010 +#define DIST_SRC_INCLUDE 0x00020 +#define DIST_SRC_LIB 0x00040 +#define DIST_SRC_LIBEXEC 0x00080 +#define DIST_SRC_LKM 0x00100 +#define DIST_SRC_RELEASE 0x00200 +#define DIST_SRC_SBIN 0x00400 +#define DIST_SRC_SHARE 0x00800 +#define DIST_SRC_SYS 0x01000 +#define DIST_SRC_UBIN 0x02000 +#define DIST_SRC_USBIN 0x04000 +#define DIST_SRC_BIN 0x08000 +#define DIST_SRC_SMAILCF 0x10000 +#define DIST_SRC_ALL 0xFFFF /* no SMAILCF, it's part of USBIN */ /* Subtypes for XFree86 distribution */ #define DIST_XF86_BIN 0x0001 diff --git a/release/sysinstall/dmenu.c b/release/sysinstall/dmenu.c index 65d40b3fbee1..7a9ac478e9e0 100644 --- a/release/sysinstall/dmenu.c +++ b/release/sysinstall/dmenu.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: dmenu.c,v 1.12.2.13 1996/07/05 08:44:03 jkh Exp $ + * $Id: dmenu.c,v 1.25 1996/08/03 10:10:52 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -171,7 +171,10 @@ menu_height(DMenu *menu, int n) int max; char *t; - for (t = menu->prompt, max = MAX_MENU; *t; t++) { + max = MAX_MENU; + if (StatusLine > 24) + max += StatusLine - 24; + for (t = menu->prompt; *t; t++) { if (*t == '\n') --max; } @@ -199,7 +202,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean bu use_helpfile(systemHelpFile(menu->helpfile, buf)); /* Pop up that dialog! */ - dialog_clear(); + dialog_clear_norefresh(); if (menu->type & DMENU_NORMAL_TYPE) rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, -1, -1, menu_height(menu, n), -n, items, (char *)buttons, choice, scroll); diff --git a/release/sysinstall/dos.c b/release/sysinstall/dos.c index fe619cd1a564..e15d61d2f028 100644 --- a/release/sysinstall/dos.c +++ b/release/sysinstall/dos.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: dos.c,v 1.6.2.14 1996/05/24 06:08:31 jkh Exp $ + * $Id: dos.c,v 1.14 1996/08/23 07:55:58 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -82,7 +82,8 @@ mediaGetDOS(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; - msgDebug("Request for %s from DOS\n", file); + if (isDebug()) + msgDebug("Request for %s from DOS\n", file); snprintf(buf, PATH_MAX, "/dos/freebsd/%s", file); if (file_readable(buf)) return open(buf, O_RDONLY); diff --git a/release/sysinstall/floppy.c b/release/sysinstall/floppy.c index 987c743969f4..3160359c7c7d 100644 --- a/release/sysinstall/floppy.c +++ b/release/sysinstall/floppy.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: floppy.c,v 1.7.2.14 1996/07/03 01:31:10 jkh Exp $ + * $Id: floppy.c,v 1.16 1996/10/09 09:53:30 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -54,7 +54,7 @@ static Device *floppyDev; static Boolean floppyMounted; -static char *distWanted; +char *distWanted; /* For finding floppies */ static int @@ -106,7 +106,7 @@ getRootFloppy(void) fd = open(floppyDev->devname, O_RDONLY); if (isDebug()) msgDebug("getRootFloppy on %s yields fd of %d\n", floppyDev->devname, fd); - if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?")) + if (fd == -1 && msgYesNo("Couldn't open the floppy - do you want to try again?") != 0) break; } return fd; @@ -127,9 +127,9 @@ mediaInitFloppy(Device *dev) } msgDebug("Init floppy called for %s distribution.\n", distWanted ? distWanted : "some"); if (!distWanted) - msgConfirm("Please insert next floppy into %s", dev->description); - else - msgConfirm("Please insert floppy containing %s into %s", distWanted, dev->description); + msgConfirm("Please insert floppy for %s", dev->description); + else if (distWanted != (char *)1) /* 1 is kludge for "don't ask!" */ + msgConfirm("Please insert floppy containing %s for %s", distWanted, dev->description); memset(&dosargs, 0, sizeof dosargs); dosargs.fspec = dev->devname; @@ -141,7 +141,8 @@ mediaInitFloppy(Device *dev) if (mount(MOUNT_MSDOS, "/dist", MNT_RDONLY, (caddr_t)&dosargs) == -1) { if (mount(MOUNT_UFS, "/dist", MNT_RDONLY, (caddr_t)&u_args) == -1) { - msgConfirm("Error mounting floppy %s (%s) on /dist : %s", dev->name, dev->devname, strerror(errno)); + if (distWanted != (char *)1) + msgConfirm("Error mounting floppy %s (%s) on /dist : %s", dev->name, dev->devname, strerror(errno)); return FALSE; } } diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index f8a970f1d621..04a4e69b37c8 100644 --- a/release/sysinstall/ftp.c +++ b/release/sysinstall/ftp.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: ftp.c,v 1.14.2.6 1996/05/24 06:08:36 jkh Exp $ + * $Id: ftp.c,v 1.18 1996/08/01 12:35:49 jkh Exp $ * * Return values have been sanitized: * -1 error, but you (still) have a session. @@ -20,10 +20,9 @@ #include <netdb.h> #include <errno.h> #include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> #include <stdarg.h> #include <string.h> +#include <signal.h> #include <errno.h> #include <ctype.h> #include "ftp.h" @@ -41,6 +40,14 @@ int FtpPort; #include "sysinstall.h" #endif /*STANDALONE_FTP*/ +static int sigpipe_caught = 0; + +static void +catch_pipe(int sig) +{ + sigpipe_caught = TRUE; +} + static void debug(FTP_t ftp, const char *fmt, ...) { @@ -64,8 +71,14 @@ static int writes(int fd, char *s) { int i = strlen(s); - if (i != write(fd, s, i)) + + signal(SIGPIPE, catch_pipe); + if (i != write(fd, s, i) || sigpipe_caught) { + if (sigpipe_caught) + msgDebug("sigpipe caught during write - connection invalid\n"); + sigpipe_caught = FALSE; return IO_ERROR; + } return 0; } @@ -75,10 +88,15 @@ get_a_line(FTP_t ftp) static char buf[BUFSIZ]; int i,j; - for(i=0;i<BUFSIZ;) { + signal(SIGPIPE, catch_pipe); + for(i = 0; i < BUFSIZ;) { j = read(ftp->fd_ctrl, buf+i, 1); - if (j != 1) + if (j != 1 || sigpipe_caught) { + if (sigpipe_caught) + msgDebug("sigpipe caught during read - connection invalid\n"); + sigpipe_caught = FALSE; return 0; + } if (buf[i] == '\r' || buf[i] == '\n') { if (!i) continue; diff --git a/release/sysinstall/ftp_strat.c b/release/sysinstall/ftp_strat.c index c476d7ad1738..2ab678a4732b 100644 --- a/release/sysinstall/ftp_strat.c +++ b/release/sysinstall/ftp_strat.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: ftp_strat.c,v 1.22 1996/07/09 14:28:14 jkh Exp $ + * $Id: ftp_strat.c,v 1.29 1996/10/12 23:48:31 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -69,9 +69,10 @@ mediaInitFTP(Device *dev) return FALSE; } +try: cp = variable_get(VAR_FTP_PATH); if (!cp) { - msgConfirm("%s is not set!", VAR_FTP_PATH); + if (DITEM_STATUS(mediaSetFTP(NULL)) == DITEM_FAILURE || (cp = variable_get(VAR_FTP_PATH)) == NULL) return FALSE; } @@ -101,23 +102,36 @@ mediaInitFTP(Device *dev) FtpPassive(ftp, !strcmp(variable_get(VAR_FTP_STATE), "passive")); FtpBinary(ftp, 1); if (dir && *dir != '\0') { - msgDebug("Attempt to chdir to distribution in %s\n", dir); - if (FtpChdir(ftp, dir) == IO_ERROR) + if (FtpChdir(ftp, dir) == IO_ERROR) { + msgDebug("Attempt to chdir to distribution in %s returns I/O error\n", dir); goto punt; + } } - /* Give it a shot - can't hurt to try and zoom in if we can, unless the release is set to __RELEASE which signifies that it's not set */ + /* Give it a shot - can't hurt to try and zoom in if we can, unless the release is set to + __RELEASE or "none" which signifies that it's not set */ rel = variable_get(VAR_RELNAME); - if (strcmp(rel, "__RELEASE")) + if (strcmp(rel, "__RELEASE") && strcmp(rel, "none")) i = FtpChdir(ftp, rel); else i = 0; - if (i == -1) - msgConfirm("Warning: Can't CD to `%s' distribution on this\n" - "FTP server. You may need to visit the Options menu\n" - "to set the release name explicitly if this FTP server\n" - "isn't exporting a CD (or some other custom release) at\n" - "the top level as a release tree.", rel); + if (i == -1) { + if (!msgYesNo("Warning: Can't CD to `%s' distribution on this\n" + "FTP server. You may need to visit a different server for\n" + "the release you're trying to fetch or go to the Options\n" + "menu and to set the release name to explicitly match what's\n" + "available on %s (or set to \"none\").\n\n" + "Would you like to select another FTP server?", + rel, hostname)) { + variable_unset(VAR_FTP_PATH); + if (DITEM_STATUS(mediaSetFTP(NULL)) == DITEM_FAILURE) + goto punt; + else + goto try; + } + else + goto punt; + } else if (i == IO_ERROR) goto punt; @@ -131,6 +145,7 @@ punt: FtpClose(ftp); ftp = NULL; } + variable_unset(VAR_FTP_PATH); return FALSE; } @@ -148,11 +163,16 @@ mediaGetFTP(Device *dev, char *file, Boolean probe) lastRequest = file; while ((fd = FtpGet(ftp, fp)) < 0) { /* If a hard fail, try to "bounce" the ftp server to clear it */ - if (fd == IO_ERROR) { + if (fd == IO_ERROR) { + char *cp = variable_get(VAR_FTP_PATH); + dev->shutdown(dev); + variable_unset(VAR_FTP_PATH); /* If we can't re-initialize, just forget it */ if (!dev->init(dev)) return IO_ERROR; + else + variable_set2(VAR_FTP_PATH, cp); } else if (probe) return EOF; diff --git a/release/sysinstall/globals.c b/release/sysinstall/globals.c index 1393fb7168ae..7e30a18c2291 100644 --- a/release/sysinstall/globals.c +++ b/release/sysinstall/globals.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: globals.c,v 1.13 1996/04/28 20:53:58 jkh Exp $ + * $Id: globals.c,v 1.14 1996/08/01 10:58:51 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,6 +50,7 @@ Boolean OnVTY; /* Are we on a VTY? */ Variable *VarHead; /* The head of the variable chain */ Device *mediaDevice; /* Where we're installing from */ int BootMgr; /* Which boot manager we're using */ +int StatusLine; /* Where to stick our status messages */ /* * Yes, I know some of these are already automatically initialized as diff --git a/release/sysinstall/help/XF86.hlp b/release/sysinstall/help/XF86.hlp index edbc8d89059a..2e4abd3db7c9 100644 --- a/release/sysinstall/help/XF86.hlp +++ b/release/sysinstall/help/XF86.hlp @@ -1,4 +1,4 @@ -README for XFree86 3.1.2 on FreeBSD 2.1 +README for XFree86 3.1.2S on FreeBSD 2.1.6 Rich Murphey, David Dawes 20 January 1995 [Last Updated: 14 October 1995] @@ -394,11 +394,11 @@ that expect a few meg free. The R6 X servers may work with 4Mb of memory, but in practice compilation while running X can take 5 or 10 times as long due to constant paging. -The easiest way for new users to start X windows is to type ``startx +The easiest way for new users to start X Window System is to type ``startx >& startx.log''. Error messages are lost unless you redirect them because the server takes over the screen. -To get out of X windows, type: ``exit'' in the console xterm. You can +To get out of X Window System, type: ``exit'' in the console xterm. You can customize your X by creating .xinitrc, .xserverrc, and .twmrc files in your home directory as described in the xinit and startx man pages. diff --git a/release/sysinstall/help/install.hlp b/release/sysinstall/help/install.hlp index cf91bd2495f1..dbe42df524ab 100644 --- a/release/sysinstall/help/install.hlp +++ b/release/sysinstall/help/install.hlp @@ -1,9 +1,12 @@ - QUICK INSTALLATION GUIDE FOR FREEBSD 2.1.5 + QUICK INSTALLATION GUIDE FOR FREEBSD 2.1.6 This manual documents the process of installing FreeBSD on your -machine. Please also see the Hardware Guide for hardware-specific -installation instructions (how to configure your hardware, what sorts -of things to watch out for, etc) before starting a new installation. +machine. Please also see the Hardware Guide (HARDWARE.TXT, or +the "Hardware" selection in the Documentation submenu of the boot +floppy) for hardware-specific installation instructions if you're +not sure how to configure your hardware or don't know what sorts +of things one should watch out for with PC UNIXes in general or +FreeBSD in particular. Table of Contents: @@ -28,7 +31,7 @@ Table of Contents: 3.1 Repairing an existing FreeBSD installation. -3.2 Upgrading from FreeBSD 2.1 or 2.0.5 +3.2 Upgrading from FreeBSD 2.1 1.0 DOS user's Question and Answer section @@ -87,11 +90,10 @@ mount -t msdos /dev/sd0s5 /dos_d Not yet! We'd like to add support for this someday, but are still lacking anyone to actually do the work. Ongoing work with Linux's DOSEMU utility may bring this much closer to being a reality sometime -soon, as perhaps will the BSDI `rundos' emulator which BSDI has been -kind enough to donate to the BSD community. Send mail to -emulation@freebsd.org if you're interested in joining this effort! +soon. Send mail to hackers@freebsd.org if you're interested in +joining this effort! -For now there is, however, a neat utility called "pcemu" in the ports +There is, however, a neat utility called "pcemu" in the ports collection which emulates an 8088 and enough BIOS services to run DOS text mode applications. It requires the X Window System (provided as XFree86 3.1.2) to operate. @@ -123,23 +125,18 @@ that ``dd if=floppies/boot.flp of=/dev/rfd0'' or ``dd if=floppies/boot.flp of=/dev/floppy'' works well, depending on your hardware and operating system environment. -IMPORTANT NOTE: If you have a 4MB machine then you will need to use -the ``boot4.flp'' image and use dd or rawrite directly in creating -it since the supplied batch files assume the default boot.flp (which -requires at least 5MB to run). - - Once you've booted from DOS or floppy, you should then be able to select CDROM as the media type in the Media menu and load the entire -distribution from CDROM. No other types of installation media should -be required. +distribution from CDROM (note: If you have only one CDROM drive, and +the appropriate FreeBSD CDROM is detected in it, it will be selected +automatically as your media). After your system is fully installed and you have rebooted from the hard disk, you can mount the cdrom at any time by typing: ``mount /cdrom'' Before removing the CD again, also note that it's necessary to first type ``umount /cdrom''. Don't just remove it from the drive! -IMPORTANT NOTE: Before invoking the installation, be sure that the CDROM +SPECIAL NOTE: Before invoking the installation, be sure that the CDROM is in the drive so that the "probe" can find it! This is also true if you wish the CDROM to be added to the default system configuration automatically during the install (whether or not you actually use it @@ -236,7 +233,7 @@ installation requires quite a bit of temporary storage! You should expect to require as much temporary storage as you have stuff written on tape. -IMPORTANT NOTE: When going to do the installation, the tape must be in +SPECIAL NOTE: When going to do the installation, the tape must be in the drive *before* booting from the boot floppy. The installation "probe" may otherwise fail to find it. @@ -315,7 +312,7 @@ installation can continue over NFS or FTP. Options flag. In order for NFS installation to work, the server must also support - "subdir mounts", e.g. if your FreeBSD 2.1.5 distribution directory + "subdir mounts", e.g. if your FreeBSD 2.1 distribution directory lives on: ziggy:/usr/archive/stuff/FreeBSD Then ziggy will have to allow the direct mounting of /usr/archive/stuff/FreeBSD, not just /usr or /usr/archive/stuff. @@ -330,7 +327,7 @@ installation can continue over NFS or FTP. 2.5.2 Preparing for FTP Installation FTP installation may be done from any mirror site containing a - reasonably up-to-date version of FreeBSD 2.1.5. A full menu of + reasonably up-to-date version of FreeBSD 2.1. A full menu of reasonable choices for almost any location in the world is provided in the FTP site menu. @@ -341,7 +338,7 @@ installation can continue over NFS or FTP. contain a hostname or an IP address, so the following would work in the absence of a name server: - ftp://192.216.191.11/pub/FreeBSD/2.1.5-RELEASE + ftp://192.216.191.11/pub/FreeBSD/2.1.0-RELEASE There are two FTP installation modes you can use: @@ -520,7 +517,7 @@ mailing list - questions@FreeBSD.org. We'll do our best to help you! 3.1 Repairing an existing FreeBSD installation. --- ------------------------------------------- -FreeBSD 2.1.5 features a "Fixit" option in the top menu of the boot +FreeBSD 2.1 now features a "Fixit" option in the top menu of the boot floppy. To use it, you will also need a fixit.flp image floppy, generated in the same fashion as the boot floppy. diff --git a/release/sysinstall/help/partition.hlp b/release/sysinstall/help/partition.hlp index cbce9a4e3c6e..e0cc43bed1f4 100644 --- a/release/sysinstall/help/partition.hlp +++ b/release/sysinstall/help/partition.hlp @@ -21,13 +21,6 @@ without initializing it. If you want it initialized, use the (T)oggle command to flip the Newfs flag. When Newfs is set to "Y", the filesystem in question will be ERASED and rebuilt from scratch! -NOTE: The (W)rite option is HIGHLY DANGEROUS and should NOT BE USED if -you're installing a new system! It's only for use in resurrecting -or changing an existing system, and will cause unpredictable things to -happen if you use it in any other circumstances. Don't do it! Wait -for the final commit dialog if you're express/novice installing, or -use the "Commit" menu item if you're custom installing, and do it there. - You should use this editor to create at least the following filesystems: diff --git a/release/sysinstall/help/readme.hlp b/release/sysinstall/help/readme.hlp index a254e06d2513..543d5c28c883 100644 --- a/release/sysinstall/help/readme.hlp +++ b/release/sysinstall/help/readme.hlp @@ -1,8 +1,8 @@ ----------------------------------------- - FreeBSD 2.1.5 --- RELEASE Version , , + FreeBSD 2.1.6 --- RELEASE Version , , ----------------------------------------- /( )` \ \___ / | -Welcome to the 2.1.5 RELEASE version of FreeBSD! /- _ `-/ ' +Welcome to the 2.1.6 RELEASE version of FreeBSD! /- _ `-/ ' This is the follow-on release to 2.1R, and focuses (/\/ \ \ /\ primarily on fixing bugs, closing security holes / / | ` \ and conservative enhancements. This is also the O O ) / | diff --git a/release/sysinstall/help/relnotes.hlp b/release/sysinstall/help/relnotes.hlp index 00f582cecf72..bcee3449879f 100644 --- a/release/sysinstall/help/relnotes.hlp +++ b/release/sysinstall/help/relnotes.hlp @@ -1,11 +1,13 @@ RELEASE NOTES - FreeBSD Release 2.1.5 RELEASE + FreeBSD Release 2.1.6 RELEASE 0. What is this release? ------------------------ -FreeBSD 2.1.5R is the follow-on release to 2.1R and focuses primarily -on fixing bugs, closing security holes and conservative enhancements. -For more information on bleeding-edge development, please see +FreeBSD 2.1.6R is the follow-on release to 2.1.6R and focuses primarily +on fixing bugs, closing security holes and making the system easier to +install than 2.1.5. + +For more information on our bleeding-edge development, please see http://www.freebsd.org/handbook/current.html. @@ -526,5 +528,5 @@ We sincerely hope you enjoy this release of FreeBSD! The FreeBSD Core Team -$Id: relnotes.hlp,v 1.1.2.24 1996/07/12 11:41:44 jkh Exp $ +$Id: relnotes.hlp,v 1.1.2.25 1996/07/16 17:34:39 jkh Exp $ LocalWords: Adaptec diff --git a/release/sysinstall/help/slice.hlp b/release/sysinstall/help/slice.hlp index 1c1581bf5ea1..40e4d493b330 100644 --- a/release/sysinstall/help/slice.hlp +++ b/release/sysinstall/help/slice.hlp @@ -36,13 +36,6 @@ Install menu or use the (W)rite option here! You're working with what is essentially a copy of the disk label(s), both here and in the Label Editor. -NOTE: The (W)rite option is HIGHLY DANGEROUS and should NOT BE USED if -you're installing a new system! It's only for use in resurrecting -or changing an existing system, and will cause unpredictable things to -happen if you use it in any other circumstances. Don't do it! Wait -for the final commit dialog if you're express/novice installing, or -use the "Commit" menu item if you're custom installing, and do it there. - If you want to use the entire disk for FreeBSD, type `A'. You'll be asked whether or not you wish to keep the disk (potentially) compatible with other operating systems, i.e. the information in the FDISK table diff --git a/release/sysinstall/help/usage.hlp b/release/sysinstall/help/usage.hlp index 27271608dd02..64b7c3463647 100644 --- a/release/sysinstall/help/usage.hlp +++ b/release/sysinstall/help/usage.hlp @@ -8,7 +8,7 @@ to the next screen when you finish reading this one]: KEY ACTION --- ------ SPACE Select or toggle the current item. -RETURN Finish with an item (or menu, if radio or checkbox). +RETURN Finish with an item. UP ARROW Move to previous item (or up, in a text display box). DOWN ARROW Move to next item (or down, in a text display box). TAB Move to next item or group. diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 1d36eb8453fc..363e26e47a00 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.71.2.103 1996/07/13 05:14:52 jkh Exp $ + * $Id: install.c,v 1.134 1996/10/14 21:32:28 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -35,6 +35,7 @@ */ #include "sysinstall.h" +#include "uc_main.h" #include <ctype.h> #include <sys/disklabel.h> #include <sys/errno.h> @@ -50,24 +51,27 @@ #include <sys/mount.h> static void create_termcap(void); +#ifdef SAVE_USERCONFIG +static void save_userconfig_to_kernel(char *); +#endif #define TERMCAP_FILE "/usr/share/misc/termcap" static void installConfigure(void); -static Boolean -checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev) +Boolean +checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev) { Device **devs; Boolean status; Disk *disk; - Chunk *c1, *c2, *rootdev, *swapdev, *usrdev; + Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; int i; status = TRUE; - *rdev = *sdev = *udev = rootdev = swapdev = usrdev = NULL; + *rdev = *sdev = *udev = *vdev = rootdev = swapdev = usrdev = vardev = NULL; - /* We don't need to worry about root/usr/swap if we already have it */ + /* We don't need to worry about root/usr/swap if we're already multiuser */ if (!RunningAsInit) return status; @@ -86,8 +90,9 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev) if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { if (c2->flags & CHUNK_IS_ROOT) { if (rootdev) { - msgConfirm("WARNING: You have more than one root device set?!\n" - "Using the first one found."); + if (whinge) + msgConfirm("WARNING: You have more than one root device set?!\n" + "Using the first one found."); continue; } else { @@ -98,8 +103,9 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev) } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/usr")) { if (usrdev) { - msgConfirm("WARNING: You have more than one /usr filesystem.\n" - "Using the first one found."); + if (whinge) + msgConfirm("WARNING: You have more than one /usr filesystem.\n" + "Using the first one found."); continue; } else { @@ -108,6 +114,19 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev) msgDebug("Found usrdev at %s!\n", usrdev->name); } } + else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/var")) { + if (vardev) { + if (whinge) + msgConfirm("WARNING: You have more than one /var filesystem.\n" + "Using the first one found."); + continue; + } + else { + vardev = c2; + if (isDebug()) + msgDebug("Found vardev at %s!\n", vardev->name); + } + } } } } @@ -140,23 +159,31 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev) *rdev = rootdev; *sdev = swapdev; *udev = usrdev; + *vdev = vardev; - if (!rootdev) { + if (!rootdev && whinge) { msgConfirm("No root device found - you must label a partition as /\n" "in the label editor."); status = FALSE; } - if (!swapdev) { + if (!swapdev && whinge) { msgConfirm("No swap devices found - you must create at least one\n" "swap partition."); status = FALSE; } - if (!usrdev) { + if (!usrdev && whinge) { msgConfirm("WARNING: No /usr filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to mount your /usr filesystem over NFS), but it may otherwise\n" "cause you trouble if you're not exactly sure what you are doing!"); } + if (!vardev && whinge) { + msgConfirm("WARNING: No /var filesystem found. This is not technically\n" + "an error if your root filesystem is big enough (or you later\n" + "intend to link /var to someplace else), but it may otherwise\n" + "cause your root filesystem to fill up if you receive lots of mail\n" + "or edit large temporary files."); + } return status; } @@ -178,12 +205,12 @@ installInitial(void) variable_set2(DISK_PARTITIONED, "yes"); /* If we refuse to proceed, bail. */ - dialog_clear(); + dialog_clear_norefresh(); if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\n" "If you're running this on a disk with data you wish to save\n" "then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n" "proceeding!\n\n" - "We can take no responsibility for lost disk contents!")) + "We can take no responsibility for lost disk contents!") != 0) return DITEM_FAILURE | DITEM_RESTORE; if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) { @@ -239,11 +266,10 @@ installFixitFloppy(dialogMenuItem *self) msgConfirm("Please insert a writable fixit floppy and press return"); if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1) break; - if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?")) + if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0) return DITEM_FAILURE; } dialog_clear(); - dialog_update(); end_dialog(); DialogActive = FALSE; if (!directory_exists("/tmp")) @@ -286,7 +312,6 @@ installFixitFloppy(dialogMenuItem *self) DialogActive = TRUE; clear(); dialog_clear(); - dialog_update(); unmount("/mnt2", MNT_FORCE); msgConfirm("Please remove the fixit floppy now."); return DITEM_SUCCESS; @@ -305,13 +330,13 @@ installExpress(dialogMenuItem *self) return i; if (!Dists) { - dialog_clear(); + dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) return DITEM_FAILURE | DITEM_RECREATE; } if (!mediaDevice) { - dialog_clear(); + dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) return DITEM_FAILURE | DITEM_RECREATE; } @@ -333,10 +358,9 @@ int installNovice(dialogMenuItem *self) { int i; - extern int cdromMounted; variable_set2(SYSTEM_STATE, "novice"); - dialog_clear(); + dialog_clear_norefresh(); msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n" "scheme for your hard disk. If you simply wish to devote all disk space\n" "to FreeBSD (overwritting anything else that might be on the disk(s) selected)\n" @@ -347,7 +371,7 @@ installNovice(dialogMenuItem *self) if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; - dialog_clear(); + dialog_clear_norefresh(); msgConfirm("Next, you need to create BSD partitions inside of the fdisk partition(s)\n" "just created. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" @@ -358,12 +382,8 @@ installNovice(dialogMenuItem *self) if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; - dialog_clear(); - msgConfirm("Now it is time to select an installation subset. There are a number of\n" - "canned distribution sets, ranging from minimal installation sets to full\n" - "X11 developer oriented configurations. You can also select a custom set\n" - "of distributions if none of the provided ones are suitable."); while (1) { + dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) return DITEM_FAILURE | DITEM_RECREATE; @@ -371,13 +391,11 @@ installNovice(dialogMenuItem *self) break; } - if (!mediaDevice) { - msgConfirm("Finally, you must specify an installation medium."); - if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RECREATE; - } + if (!mediaDevice && !dmenuOpenSimple(&MenuMedia, FALSE)) + return DITEM_FAILURE | DITEM_RECREATE; if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { + dialog_clear_norefresh(); msgConfirm("Installation completed with some errors. You may wish to\n" "scroll through the debugging messages on VTY1 with the\n" "scroll-lock feature. You can also chose \"No\" at the next\n" @@ -386,47 +404,55 @@ installNovice(dialogMenuItem *self) return i | DITEM_RECREATE; } - else - msgConfirm("Congradulations! You now have FreeBSD installed on your system.\n\n" + else { + dialog_clear_norefresh(); + msgConfirm("Congratulations! You now have FreeBSD installed on your system.\n\n" "We will now move on to the final configuration questions.\n" "For any option you do not wish to configure, simply select\n" "No.\n\n" "If you wish to re-enter this utility after the system is up, you\n" "may do so by typing: /stand/sysinstall."); - + } if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) { - if (!msgYesNo("Does this system have a network interface card?")) { + if (!msgYesNo("Would you like to configure any SLIP/PPP or network interface devices?")) { Device *save = mediaDevice; /* This will also set the media device, which we don't want */ tcpDeviceSelect(); /* so we restore our saved value below */ mediaDevice = save; - dialog_clear(); + dialog_clear_norefresh(); } } + dialog_clear_norefresh(); if (!msgYesNo("Would you like to configure Samba for connecting NETBUI clients to this\n" "machine? Windows 95, Windows NT and Windows for Workgroups\n" "machines can use NETBUI transport for disk and printer sharing.")) configSamba(self); + dialog_clear_norefresh(); if (!msgYesNo("Will this machine be an IP gateway (e.g. will it forward packets\n" "between interfaces)?")) variable_set2("gateway", "YES"); + dialog_clear_norefresh(); if (!msgYesNo("Do you want to allow anonymous FTP connections to this machine?")) configAnonFTP(self); + dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS server?")) configNFSServer(self); + dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client", "YES"); + dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as a WEB server?")) configApache(self); + dialog_clear_norefresh(); if (!msgYesNo("Would you like to customize your system console settings?")) { WINDOW *w = savescr(); @@ -434,6 +460,7 @@ installNovice(dialogMenuItem *self) restorescr(w); } + dialog_clear_norefresh(); if (!msgYesNo("Would you like to set this machine's time zone now?")) { WINDOW *w = savescr(); @@ -442,6 +469,7 @@ installNovice(dialogMenuItem *self) restorescr(w); } + dialog_clear_norefresh(); if (!msgYesNo("Does this system have a mouse attached to it?")) { WINDOW *w = savescr(); @@ -450,20 +478,13 @@ installNovice(dialogMenuItem *self) } if (directory_exists("/usr/X11R6")) { + dialog_clear_norefresh(); if (!msgYesNo("Would you like to configure your X server at this time?")) configXFree86(self); } - if (cdromMounted) { - if (!msgYesNo("Would you like to link to the ports tree on your CDROM?\n\n" - "This will require that you have your FreeBSD CD in the CDROM\n" - "drive to use the ports collection, but at a substantial savings\n" - "in disk space (NOTE: This may take as long as 15 or 20 minutes\n" - "depending on the speed of your CDROM drive).")) - configPorts(self); - } - - if (!msgYesNo("The FreeBSD package collection is a collection of over 450 ready-to-run\n" + dialog_clear_norefresh(); + if (!msgYesNo("The FreeBSD package collection is a collection of over 550 ready-to-run\n" "applications, from text editors to games to WEB servers. Would you like\n" "to browse the collection now?")) configPackages(self); @@ -516,6 +537,7 @@ installCommit(dialogMenuItem *self) { int i; char *str; + Boolean need_bin = FALSE; if (!mediaVerify()) return DITEM_FAILURE; @@ -532,23 +554,12 @@ installCommit(dialogMenuItem *self) return i; } + if (Dists & DIST_BIN) + need_bin = TRUE; i = distExtractAll(self); - if (DITEM_STATUS(i) == DITEM_FAILURE) - (void)installFixup(self); - else - i = installFixup(self); + if (DITEM_STATUS(i) != DITEM_FAILURE || !need_bin || !(Dists & DIST_BIN)) + i = installFixup(self); - /* Don't print this if we're express or novice installing - they have their own error reporting */ - if (strcmp(str, "express") && strcmp(str, "novice")) { - if (Dists || DITEM_STATUS(i) == DITEM_FAILURE) - msgConfirm("Installation completed with some errors. You may wish to\n" - "scroll through the debugging messages on VTY1 with the\n" - "scroll-lock feature."); - else - msgConfirm("Installation completed successfully.\n\n" - "If you have any network devices you have not yet configured,\n" - "see the Interfaces configuration item on the Configuration menu."); - } variable_set2(SYSTEM_STATE, DITEM_STATUS(i) == DITEM_FAILURE ? "error-install" : "full-install"); return i | DITEM_RECREATE; } @@ -557,6 +568,7 @@ static void installConfigure(void) { /* Final menu of last resort */ + dialog_clear_norefresh(); if (!msgYesNo("Visit the general configuration menu for a chance to set\n" "any last options?")) { WINDOW *w = savescr(); @@ -574,6 +586,10 @@ installFixup(dialogMenuItem *self) if (!file_readable("/kernel")) { if (file_readable("/kernel.GENERIC")) { +#ifdef SAVE_USERCONFIG + /* Snapshot any boot -c changes back to the GENERIC kernel */ + save_userconfig_to_kernel("/kernel.GENERIC"); +#endif if (vsystem("cp -p /kernel.GENERIC /kernel")) { msgConfirm("Unable to link /kernel into place!"); return DITEM_FAILURE; @@ -586,6 +602,7 @@ installFixup(dialogMenuItem *self) return DITEM_FAILURE; } } + /* Resurrect /dev after bin distribution screws it up */ if (RunningAsInit) { msgNotify("Remaking all devices.. Please wait!"); @@ -647,16 +664,20 @@ installFilesystems(dialogMenuItem *self) { int i; Disk *disk; - Chunk *c1, *c2, *rootdev, *swapdev, *usrdev; + Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; Device **devs; PartInfo *root; char dname[80], *str; extern int MakeDevChunk(Chunk *c, char *n); Boolean upgrade = FALSE; + /* If we've already done this, bail out */ + if ((str = variable_get(DISK_LABELLED)) && !strcmp(str, "written")) + return DITEM_SUCCESS; + str = variable_get(SYSTEM_STATE); - if (!checkLabels(&rootdev, &swapdev, &usrdev)) + if (!checkLabels(TRUE, &rootdev, &swapdev, &usrdev, &vardev)) return DITEM_FAILURE; if (rootdev) @@ -871,3 +892,61 @@ create_termcap(void) } } +#ifdef SAVE_USERCONFIG +static void +save_userconfig_to_kernel(char *kern) +{ + struct kernel *core, *boot; + struct list *c_isa, *b_isa, *c_dev, *b_dev; + int i, d; + + if ((core = uc_open("-incore")) == NULL) { + msgDebug("save_userconf: Can't read in-core information for kernel.\n"); + return; + } + + if ((boot = uc_open(kern)) == NULL) { + msgDebug("save_userconf: Can't read device information for kernel image %s\n", kern); + return; + } + + msgNotify("Saving any boot -c changes to new kernel..."); + c_isa = uc_getdev(core, "-isa"); + b_isa = uc_getdev(boot, "-isa"); + if (isDebug()) + msgDebug("save_userconf: got %d ISA device entries from core, %d from boot.\n", c_isa->ac, b_isa->ac); + for (d = 0; d < c_isa->ac; d++) { + if (isDebug()) + msgDebug("save_userconf: ISA device loop, c_isa->av[%d] = %s\n", d, c_isa->av[d]); + if (strcmp(c_isa->av[d], "npx0")) { /* special case npx0, which mucks with its id_irq member */ + c_dev = uc_getdev(core, c_isa->av[d]); + b_dev = uc_getdev(boot, b_isa->av[d]); + if (!c_dev || !b_dev) { + msgDebug("save_userconf: c_dev: %x b_dev: %x\n", c_dev, b_dev); + continue; + } + if (isDebug()) + msgDebug("save_userconf: ISA device %s: %d config parameters (core), %d (boot)\n", + c_isa->av[d], c_dev->ac, b_dev->ac); + for (i = 0; i < c_dev->ac; i++) { + if (isDebug()) + msgDebug("save_userconf: c_dev->av[%d] = %s, b_dev->av[%d] = %s\n", i, c_dev->av[i], i, b_dev->av[i]); + if (strcmp(c_dev->av[i], b_dev->av[i])) { + if (isDebug()) + msgDebug("save_userconf: %s (boot) -> %s (core)\n", + c_dev->av[i], b_dev->av[i]); + isa_setdev(boot, c_dev); + } + } + } + else { + if (isDebug()) + msgDebug("skipping npx0\n"); + } + } + if (isDebug()) + msgDebug("Closing kernels\n"); + uc_close(core, 0); + uc_close(boot, 1); +} +#endif diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c index adea64a40681..98446678fe56 100644 --- a/release/sysinstall/label.c +++ b/release/sysinstall/label.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: label.c,v 1.53 1996/07/14 01:54:39 jkh Exp $ + * $Id: label.c,v 1.63 1996/10/06 11:40:31 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -108,8 +108,12 @@ diskLabelEditor(dialogMenuItem *self) return DITEM_FAILURE; } i = diskLabel(devs[0]->name); - if (DITEM_STATUS(i) != DITEM_FAILURE) - variable_set2(DISK_LABELLED, "yes"); + if (DITEM_STATUS(i) != DITEM_FAILURE) { + char *cp; + + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); + } return i; } @@ -263,7 +267,12 @@ get_mountpoint(struct chunk *old) tmp = old->private_data; else tmp = NULL; + if (!old) { + DialogX = 14; + DialogY = 16; + } val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition"); + DialogX = DialogY = 0; if (!val || !*val) { if (!old) return NULL; @@ -313,7 +322,6 @@ get_partition_type(void) { char selection[20]; int i; - WINDOW *w = savescr(); static unsigned char *fs_types[] = { "FS", @@ -321,11 +329,13 @@ get_partition_type(void) "Swap", "A swap partition.", }; + DialogX = 7; + DialogY = 8; i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\n" "If you want to put a filesystem on it, choose FS.", -1, -1, 2, 2, fs_types, selection, NULL, NULL); - restorescr(w); + DialogX = DialogY = 0; if (!i) { if (!strcmp(selection, "FS")) return PART_FILESYSTEM; @@ -447,7 +457,7 @@ print_label_chunks(void) } static void -print_command_summary() +print_command_summary(void) { mvprintw(17, 0, "The following commands are valid here (upper or lower case):"); mvprintw(18, 0, "C = Create D = Delete M = Mount"); @@ -459,16 +469,22 @@ print_command_summary() move(0, 0); } +static void +clear_wins(void) +{ + clear(); + wclear(ChunkWin); +} + static int diskLabel(char *str) { - int sz, key = 0, first_time = 1; + int sz, key = 0; Boolean labeling; char *msg = NULL; PartInfo *p, *oldp; PartType type; Device **devs; - WINDOW *w; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { @@ -480,14 +496,12 @@ diskLabel(char *str) keypad(stdscr, TRUE); record_label_chunks(devs); - w = savescr(); - dialog_clear(); clear(); + clear(); while (labeling) { + char *cp; + print_label_chunks(); - if (first_time) { - print_command_summary(); - first_time = 0; - } + print_command_summary(); if (msg) { attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL); clrtoeol(); @@ -498,12 +512,16 @@ diskLabel(char *str) move(23, 0); clrtoeol(); } - key = toupper(getch()); - switch (key) { + + refresh(); + key = getch(); + switch (toupper(key)) { int i; + static char _msg[40]; case '\014': /* ^L */ - continue; + clear_wins(); + break; case KEY_UP: case '-': @@ -536,6 +554,7 @@ diskLabel(char *str) case KEY_F(1): case '?': systemDisplayHelp("partition"); + clear_wins(); break; case 'A': @@ -544,91 +563,99 @@ diskLabel(char *str) break; } sz = space_free(label_chunk_info[here].c); - if (sz <= FS_MIN_SIZE) { + if (sz <= FS_MIN_SIZE) msg = "Not enough free space to create a new partition in the slice"; - break; - } else { struct chunk *tmp; int mib[2]; int physmem; size_t size, swsize; char *cp; + Chunk *rootdev, *swapdev, *usrdev, *vardev; - cp = variable_get(VAR_ROOT_SIZE); - tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - (cp ? atoi(cp) : 32) * ONE_MEG, part, FS_BSDFFS, - CHUNK_IS_ROOT); - - if (!tmp) { - msgConfirm("Unable to create the root partition. Too big?"); - break; - } - tmp->private_data = new_part("/", TRUE, tmp->size); - tmp->private_free = safe_free; - record_label_chunks(devs); - - cp = variable_get(VAR_SWAP_SIZE); - if (cp) - swsize = atoi(cp) * ONE_MEG; - else { - mib[0] = CTL_HW; - mib[1] = HW_PHYSMEM; - size = sizeof physmem; - sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); - swsize = 16 * ONE_MEG + (physmem * 2 / 512); - } - tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - swsize, - part, FS_SWAP, 0); - if (!tmp) { - msgConfirm("Unable to create the swap partition. Too big?"); - break; + (void)checkLabels(FALSE, &rootdev, &swapdev, &usrdev, &vardev); + if (!rootdev) { + cp = variable_get(VAR_ROOT_SIZE); + tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, + (cp ? atoi(cp) : 32) * ONE_MEG, part, FS_BSDFFS, CHUNK_IS_ROOT); + if (!tmp) { + msgConfirm("Unable to create the root partition. Too big?"); + clear_wins(); + break; + } + tmp->private_data = new_part("/", TRUE, tmp->size); + tmp->private_free = safe_free; + record_label_chunks(devs); } - - tmp->private_data = 0; - tmp->private_free = safe_free; - record_label_chunks(devs); - - cp = variable_get(VAR_VAR_SIZE); - tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - (cp ? atoi(cp) : VAR_MIN_SIZE) * ONE_MEG, part, FS_BSDFFS, 0); - if (!tmp) { - msgConfirm("Less than %dMB free for /var - you will need to\n" - "partition your disk manually with a custom install!", (cp ? atoi(cp) : VAR_MIN_SIZE)); - break; + + if (!swapdev) { + cp = variable_get(VAR_SWAP_SIZE); + if (cp) + swsize = atoi(cp) * ONE_MEG; + else { + mib[0] = CTL_HW; + mib[1] = HW_PHYSMEM; + size = sizeof physmem; + sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); + swsize = 16 * ONE_MEG + (physmem * 2 / 512); + } + tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, + swsize, part, FS_SWAP, 0); + if (!tmp) { + msgConfirm("Unable to create the swap partition. Too big?"); + clear_wins(); + break; + } + tmp->private_data = 0; + tmp->private_free = safe_free; + record_label_chunks(devs); } - tmp->private_data = new_part("/var", TRUE, tmp->size); - tmp->private_free = safe_free; - record_label_chunks(devs); - - cp = variable_get(VAR_USR_SIZE); - if (cp) - sz = atoi(cp) * ONE_MEG; - else - sz = space_free(label_chunk_info[here].c); - if (!sz || sz < (USR_MIN_SIZE * ONE_MEG)) { - msgConfirm("Less than %dMB free for /usr - you will need to\n" - "partition your disk manually with a custom install!", USR_MIN_SIZE); - break; + + if (!vardev) { + cp = variable_get(VAR_VAR_SIZE); + tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, + (cp ? atoi(cp) : VAR_MIN_SIZE) * ONE_MEG, part, FS_BSDFFS, 0); + if (!tmp) { + msgConfirm("Less than %dMB free for /var - you will need to\n" + "partition your disk manually with a custom install!", + (cp ? atoi(cp) : VAR_MIN_SIZE)); + clear_wins(); + break; + } + tmp->private_data = new_part("/var", TRUE, tmp->size); + tmp->private_free = safe_free; + record_label_chunks(devs); } - tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - sz, part, FS_BSDFFS, 0); - if (!tmp) { - msgConfirm("Unable to create the /usr partition. Not enough space?\n" - "You will need to partition your disk manually with a custom install!"); - break; + if (!usrdev) { + cp = variable_get(VAR_USR_SIZE); + if (cp) + sz = atoi(cp) * ONE_MEG; + else + sz = space_free(label_chunk_info[here].c); + if (!sz || sz < (USR_MIN_SIZE * ONE_MEG)) { + msgConfirm("Less than %dMB free for /usr - you will need to\n" + "partition your disk manually with a custom install!", USR_MIN_SIZE); + clear_wins(); + break; + } + + tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, + label_chunk_info[here].c, + sz, part, FS_BSDFFS, 0); + if (!tmp) { + msgConfirm("Unable to create the /usr partition. Not enough space?\n" + "You will need to partition your disk manually with a custom install!"); + clear_wins(); + break; + } + tmp->private_data = new_part("/usr", TRUE, tmp->size); + tmp->private_free = safe_free; + record_label_chunks(devs); } /* At this point, we're reasonably "labelled" */ - variable_set2(DISK_LABELLED, "yes"); - tmp->private_data = new_part("/usr", TRUE, tmp->size); - tmp->private_free = safe_free; - record_label_chunks(devs); + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); } break; @@ -643,18 +670,24 @@ diskLabel(char *str) break; } else { - char *val, *cp; + char *val; int size; struct chunk *tmp; char osize[80]; u_long flags = 0; sprintf(osize, "%d", sz); - val = msgGetInput(osize, "Please specify the size for new FreeBSD partition in blocks, or\n" - "append a trailing `M' for megabytes (e.g. 20M) or `C' for cylinders.\n\n" - "Space free is %d blocks (%dMB)", sz, sz / ONE_MEG); - if (!val || (size = strtol(val, &cp, 0)) <= 0) + DialogX = 3; + DialogY = 2; + val = msgGetInput(osize, + "Please specify the partition size in blocks or append a trailing M for\n" + "megabytes or C for cylinders. %d blocks (%dMB) are free.", + sz, sz / ONE_MEG); + DialogX = DialogY = 0; + if (!val || (size = strtol(val, &cp, 0)) <= 0) { + clear_wins(); break; + } if (*cp) { if (toupper(*cp) == 'M') @@ -664,20 +697,28 @@ diskLabel(char *str) } if (size <= FS_MIN_SIZE) { msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG); + clear_wins(); break; } type = get_partition_type(); - if (type == PART_NONE) + if (type == PART_NONE) { + clear_wins(); + beep(); break; + } if (type == PART_FILESYSTEM) { - if ((p = get_mountpoint(NULL)) == NULL) + if ((p = get_mountpoint(NULL)) == NULL) { + clear_wins(); + beep(); break; + } else if (!strcmp(p->mountpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; - } else + } + else p = NULL; if ((flags & CHUNK_IS_ROOT)) { @@ -686,6 +727,7 @@ diskLabel(char *str) "FreeBSD boot code cannot deal with a root partition created\n" "in that location. Please choose another location or smaller\n" "size for your root partition and try again!"); + clear_wins(); break; } if (size < (ROOT_MIN_SIZE * ONE_MEG)) { @@ -701,6 +743,7 @@ diskLabel(char *str) flags); if (!tmp) { msgConfirm("Unable to create the partition. Too big?"); + clear_wins(); break; } if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) { @@ -709,6 +752,7 @@ diskLabel(char *str) "poor location to boot from. Please choose another\n" "location (or smaller size) for your root partition and try again!"); Delete_Chunk(label_chunk_info[here].c->disk, tmp); + clear_wins(); break; } if (type != PART_SWAP) { @@ -719,12 +763,14 @@ diskLabel(char *str) else tmp->private_data = p; tmp->private_free = safe_free; - variable_set2(DISK_LABELLED, "yes"); + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); record_label_chunks(devs); + clear_wins(); } break; - case '\177': + case KEY_DC: case 'D': /* delete */ if (label_chunk_info[here].type == PART_SLICE) { msg = MSG_NOT_APPLICABLE; @@ -735,7 +781,8 @@ diskLabel(char *str) break; } Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c); - variable_set2(DISK_LABELLED, "yes"); + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); record_label_chunks(devs); break; @@ -763,8 +810,10 @@ diskLabel(char *str) strcpy(p->mountpoint, "/bogus"); } } - variable_set2(DISK_LABELLED, "yes"); + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); record_label_chunks(devs); + clear_wins(); break; default: @@ -779,6 +828,7 @@ diskLabel(char *str) getNewfsCmd(label_chunk_info[here].c->private_data); else msg = MSG_NOT_APPLICABLE; + clear_wins(); break; case 'T': /* Toggle newfs state */ @@ -788,43 +838,54 @@ diskLabel(char *str) new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size); safe_free(pi); label_chunk_info[here].c->private_free = safe_free; - variable_set2(DISK_LABELLED, "yes"); - } + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); + } else msg = MSG_NOT_APPLICABLE; break; case 'U': clear(); - if (msgYesNo("Are you SURE you want to Undo everything?")) - break; - variable_unset(DISK_PARTITIONED); - variable_unset(DISK_LABELLED); - for (i = 0; devs[i]; i++) { - Disk *d; + if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) { + msgConfirm("You've already written out your changes -\n" + "it's too late to undo!"); + } + else if (!msgYesNo("Are you SURE you want to Undo everything?")) { + variable_unset(DISK_PARTITIONED); + variable_unset(DISK_LABELLED); + for (i = 0; devs[i]; i++) { + Disk *d; - if (!devs[i]->enabled) - continue; - else if ((d = Open_Disk(devs[i]->name)) != NULL) { - Free_Disk(devs[i]->private); - devs[i]->private = d; - diskPartition(devs[i], d); + if (!devs[i]->enabled) + continue; + else if ((d = Open_Disk(devs[i]->name)) != NULL) { + Free_Disk(devs[i]->private); + devs[i]->private = d; + diskPartition(devs[i], d); + } } + record_label_chunks(devs); } - record_label_chunks(devs); + clear_wins(); break; case 'W': - if (!msgYesNo("You also have the option of doing this later in one final 'commit'\n" - "operation, and it should also be noted that this option is NOT for\n" - "use during new installations but rather for modifying existing ones.\n\n" - "Are you absolutely SURE you want to do this now?")) { - WINDOW *save = savescr(); - + if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) { + msgConfirm("You've already written out your changes - if you\n" + "wish to overwrite them, you'll have to start this\n" + "procedure again from the beginning."); + } + else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" + "installation. If you are installing FreeBSD for the first time\n" + "then you should simply type Q when you're finished here and your\n" + "changes will be committed in one batch automatically at the end of\n" + "these questions.\n\n" + "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_LABELLED, "yes"); diskLabelCommit(NULL); - restorescr(save); } + clear_wins(); break; case '|': @@ -833,7 +894,6 @@ diskLabel(char *str) "expected to understand!")) { int i; Device **devs; - WINDOW *save = savescr(); dialog_clear(); end_dialog(); @@ -847,11 +907,11 @@ diskLabel(char *str) if (devs[i]->enabled) slice_wizard(((Disk *)devs[i]->private)); } - variable_set2(DISK_LABELLED, "yes"); + if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) + variable_set2(DISK_LABELLED, "yes"); DialogActive = TRUE; - dialog_clear(); - restorescr(save); record_label_chunks(devs); + clear_wins(); } else msg = "A most prudent choice!"; @@ -863,10 +923,10 @@ diskLabel(char *str) default: beep(); - msg = "Type F1 or ? for help"; + sprintf(_msg, "Invalid key %d - Type F1 or ? for help", key); + msg = _msg; break; } } - restorescr(w); - return DITEM_SUCCESS; + return DITEM_SUCCESS | DITEM_RESTORE; } diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c index 49a14d5cf09e..3a65a157cee7 100644 --- a/release/sysinstall/main.c +++ b/release/sysinstall/main.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: main.c,v 1.13.2.20 1996/07/03 01:31:13 jkh Exp $ + * $Id: main.c,v 1.28 1996/09/26 21:03:35 pst Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -37,6 +37,7 @@ #include "sysinstall.h" #include <stdio.h> #include <sys/signal.h> +#include <sys/fcntl.h> static void screech(int sig) @@ -75,7 +76,6 @@ main(int argc, char **argv) variable_set2(VAR_DEBUG, "YES"); Fake = TRUE; msgConfirm("I'll be just faking it from here on out, OK?"); - --argc, ++argv; } /* Try to preserve our scroll-back buffer */ @@ -99,6 +99,8 @@ main(int argc, char **argv) if (!strstr(argv[0], "sysinstall")) start_arg = 0; + else if (Fake) + start_arg = 2; else start_arg = 1; for (i = start_arg; i < argc; i++) { @@ -109,7 +111,58 @@ main(int argc, char **argv) systemShutdown(0); } + { + int fd; + Attribs attrs[512]; + + bzero(attrs, sizeof(attrs)); + + fd = open("install.cfg", O_RDONLY); + if (fd >= 0) { + msgNotify("Loading pre-configuration file"); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + close(fd); + } + +#if defined(LOAD_CONFIG_FILE) + else { + /* If we have a compiled-in startup config file name on + the floppy, look for it and try to load it on startup */ + extern char *distWanted; + + /* Tell mediaSetFloppy() to try floppy now */ + distWanted = (char *)1; + + /* Try to open the floppy drive if we can do that first */ + if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && + mediaDevice->init(mediaDevice)) { + int fd; + + fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); + if (fd > 0) { + msgNotify("Loading %s pre-configuration file", + LOAD_CONFIG_FILE); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + mediaDevice->close(mediaDevice, fd); + } + mediaDevice->shutdown(mediaDevice); + } + } +#endif + } + /* Begin user dialog at outer menu */ + dialog_clear(); while (1) { choice = scroll = curr = max = 0; dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index b869d994bca7..a5f63fa758ac 100644 --- a/release/sysinstall/media.c +++ b/release/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.49 1996/07/08 12:00:40 jkh Exp $ + * $Id: media.c,v 1.62 1996/10/14 21:50:38 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -259,19 +259,27 @@ mediaSetFTP(dialogMenuItem *self) static Device ftpDevice; char *cp, *hostname, *dir; extern int FtpPort; + static Boolean network_init = 1; + int what = DITEM_RESTORE; + + cp = variable_get(VAR_FTP_PATH); + /* If we've been through here before ... */ + if (!network_init && cp && msgYesNo("Re-use old FTP site selection values?")) + cp = NULL; - dialog_clear(); - if (!dmenuOpenSimple(&MenuMediaFTP, FALSE)) - return DITEM_FAILURE | DITEM_RECREATE; - else - cp = variable_get(VAR_FTP_PATH); if (!cp) { - msgConfirm("%s not set! Not setting an FTP installation path, OK?", VAR_FTP_PATH); - return DITEM_FAILURE | DITEM_RECREATE; + dialog_clear_norefresh(); + if (!dmenuOpenSimple(&MenuMediaFTP, FALSE)) + return DITEM_FAILURE | DITEM_RECREATE; + else + cp = variable_get(VAR_FTP_PATH); + what = DITEM_RECREATE; } + if (!cp) + return DITEM_FAILURE | what; else if (!strcmp(cp, "other")) { variable_set2(VAR_FTP_PATH, "ftp://"); - dialog_clear(); + dialog_clear_norefresh(); cp = variable_get_value(VAR_FTP_PATH, "Please specify the URL of a FreeBSD distribution on a\n" "remote ftp site. This site must accept either anonymous\n" "ftp or you should have set an ftp username and password\n" @@ -279,22 +287,35 @@ mediaSetFTP(dialogMenuItem *self) "A URL looks like this: ftp://<hostname>/<path>\n" "Where <path> is relative to the anonymous ftp directory or the\n" "home directory of the user being logged in as."); - if (!cp || !*cp) - return DITEM_FAILURE | DITEM_RECREATE; + if (!cp || !*cp || !strcmp(cp, "ftp://")) { + variable_unset(VAR_FTP_PATH); + return DITEM_FAILURE | what; + } } if (strncmp("ftp://", cp, 6)) { msgConfirm("Sorry, %s is an invalid URL!", cp); - return DITEM_FAILURE | DITEM_RECREATE; + variable_unset(VAR_FTP_PATH); + return DITEM_FAILURE | what; } strcpy(ftpDevice.name, cp); - if (!tcpDeviceSelect()) - return DITEM_FAILURE | DITEM_RECREATE; - if (!mediaDevice || !mediaDevice->init(mediaDevice)) { - if (isDebug()) - msgDebug("mediaSetFTP: Net device init failed.\n"); - return DITEM_FAILURE | DITEM_RECREATE; + dialog_clear_norefresh(); + if (network_init || msgYesNo("You've already done the network configuration once,\n" + "would you like to skip over it now?") != 0) { + if (mediaDevice) + mediaDevice->shutdown(mediaDevice); + if (!tcpDeviceSelect()) { + variable_unset(VAR_FTP_PATH); + return DITEM_FAILURE | what; + } + if (!mediaDevice || !mediaDevice->init(mediaDevice)) { + if (isDebug()) + msgDebug("mediaSetFTP: Net device init failed.\n"); + variable_unset(VAR_FTP_PATH); + return DITEM_FAILURE | what; + } } + network_init = FALSE; hostname = cp + 6; if ((cp = index(hostname, ':')) != NULL) { *(cp++) = '\0'; @@ -309,12 +330,15 @@ mediaSetFTP(dialogMenuItem *self) msgDebug("dir = `%s'\n", dir ? dir : "/"); msgDebug("port # = `%d'\n", FtpPort); } - msgNotify("Looking up host %s..", hostname); - if ((gethostbyname(hostname) == NULL) && (inet_addr(hostname) == INADDR_NONE)) { - msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" - "name server, gateway and network interface are correctly configured?", hostname); - mediaDevice->shutdown(mediaDevice); - return DITEM_FAILURE | DITEM_RECREATE; + if (variable_get(VAR_NAMESERVER)) { + msgNotify("Looking up host %s..", hostname); + if ((gethostbyname(hostname) == NULL) && (inet_addr(hostname) == INADDR_NONE)) { + msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" + "name server, gateway and network interface are correctly configured?", hostname); + mediaDevice->shutdown(mediaDevice); + network_init = TRUE; + return DITEM_FAILURE | what; + } } variable_set2(VAR_FTP_HOST, hostname); variable_set2(VAR_FTP_DIR, dir ? dir : "/"); @@ -326,7 +350,7 @@ mediaSetFTP(dialogMenuItem *self) ftpDevice.shutdown = mediaShutdownFTP; ftpDevice.private = mediaDevice; /* Set to network device by tcpDeviceSelect() */ mediaDevice = &ftpDevice; - return DITEM_LEAVE_MENU | DITEM_RECREATE; + return DITEM_SUCCESS | DITEM_LEAVE_MENU | what; } int @@ -349,6 +373,7 @@ mediaSetUFS(dialogMenuItem *self) static Device ufsDevice; char *cp; + dialog_clear_norefresh(); cp = variable_get_value(VAR_UFS_PATH, "Enter a fully qualified pathname for the directory\n" "containing the FreeBSD distribution files:"); if (!cp) @@ -370,6 +395,7 @@ mediaSetNFS(dialogMenuItem *self) static Device nfsDevice; char *cp, *idx; + dialog_clear_norefresh(); cp = variable_get_value(VAR_NFS_PATH, "Please enter the full NFS file specification for the remote\n" "host and directory containing the FreeBSD distribution files.\n" "This should be in the format: hostname:/some/freebsd/dir"); @@ -390,11 +416,13 @@ mediaSetNFS(dialogMenuItem *self) return DITEM_FAILURE; } *idx = '\0'; - msgNotify("Looking up host %s..", cp); - if ((gethostbyname(cp) == NULL) && (inet_addr(cp) == INADDR_NONE)) { - msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" - "name server, gateway and network interface are correctly configured?", cp); - return DITEM_FAILURE; + if (variable_get(VAR_NAMESERVER)) { + msgNotify("Looking up host %s..", cp); + if ((gethostbyname(cp) == NULL) && (inet_addr(cp) == INADDR_NONE)) { + msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" + "name server, gateway and network interface are correctly configured?", cp); + return DITEM_FAILURE; + } } variable_set2(VAR_NFS_HOST, cp); nfsDevice.type = DEVICE_TYPE_NFS; @@ -473,7 +501,7 @@ mediaExtractDistEnd(int zpid, int cpid) int i,j; i = waitpid(zpid, &j, 0); - /* Don't check status - gunzip seems to return a bogus one! */ + /* Don't check exit status - gunzip seems to return a bogus one! */ if (i < 0) { if (isDebug()) msgDebug("wait for gunzip returned status of %d!\n", i); @@ -545,7 +573,7 @@ mediaExtractDist(char *dir, int fd) close(pfd[1]); i = waitpid(zpid, &j, 0); - /* Don't check status - gunzip seems to return a bogus one! */ + /* Don't check exit status - gunzip seems to return a bogus one! */ if (i < 0) { if (isDebug()) msgDebug("wait for gunzip returned status of %d!\n", i); @@ -583,15 +611,18 @@ mediaVerify(void) /* Set the FTP username and password fields */ int -mediaSetFtpUserPass(dialogMenuItem *self) +mediaSetFTPUserPass(dialogMenuItem *self) { char *pass; - if (variable_get_value(VAR_FTP_USER, "Please enter the username you wish to login as:")) + dialog_clear_norefresh(); + if (variable_get_value(VAR_FTP_USER, "Please enter the username you wish to login as:")) { + dialog_clear_norefresh(); pass = variable_get_value(VAR_FTP_PASS, "Please enter the password for this user:"); + } else pass = NULL; - return pass ? DITEM_SUCCESS : DITEM_FAILURE; + return (pass ? DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE; } /* Set CPIO verbosity level */ diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c index 44fa4454a1b9..2c46b17628f6 100644 --- a/release/sysinstall/menus.c +++ b/release/sysinstall/menus.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.42.2.62 1996/07/11 20:06:57 jkh Exp $ + * $Id: menus.c,v 1.89 1996/10/14 21:32:31 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -258,7 +258,6 @@ DMenu MenuIndex = { { "Packages", "The packages collection", NULL, configPackages }, { "Partition", "The disk Partition Editor", NULL, diskPartitionEditor }, { "PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, - { "Ports", "Link to FreeBSD ports collection.", NULL, configPorts }, { "Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "Routed", "Set flags for routed (default: -q)", dmenuVarCheck, configRoutedFlags, NULL, "routed" }, { "Samba", "Configure Samba for LanManager access.", dmenuVarCheck, configSamba, NULL, "samba" }, @@ -406,8 +405,8 @@ of the following CDROM drives as your installation drive.", DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", - "You have more than one floppy drive. Please chose the drive\n\ -you would like to use for this operation", + "You have more than one floppy drive. Please chose which drive\n\ +you would like to use.", NULL, NULL, { { NULL } }, @@ -440,8 +439,10 @@ guaranteed to carry the full range of possible distributions.", "install", { { "Primary Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/" }, - { "Other", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, + { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, + { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org/pub/FreeBSD/" }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.au.freebsd.org/pub/FreeBSD/" }, { "Australia #2", "ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, @@ -490,10 +491,10 @@ guaranteed to carry the full range of possible distributions.", VAR_FTP_PATH "=ftp://ftp.hk.super.net/pub/FreeBSD/" }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org/pub/FreeBSD/" }, - { "Israel", "orgchem.weizmann.ac.il", NULL, dmenuSetVariable, NULL, - VAR_FTP_PATH "=ftp://orgchem.weizmann.ac.il/pub/FreeBSD/" }, - { "Israel #2", "xray4.weizmann.ac.il", NULL, dmenuSetVariable, NULL, - VAR_FTP_PATH "=ftp://xray4.weizmann.ac.il/pub/FreeBSD/" }, + { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH "=ftp://ftp.il.freebsd.org/pub/FreeBSD/" }, + { "Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH "=ftp://ftp2.il.freebsd.org/pub/FreeBSD/" }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.jp.freebsd.org/pub/FreeBSD/" }, { "Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, @@ -574,11 +575,11 @@ select one of the following tape devices detected on your system.", DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", - "If you are using PPP over a serial device as opposed\n" - "to a direct ethernet connection, then you may first need to dial your\n" - "service provider using the ppp utility we provide for that purpose.\n" - "If you're using SLIP over a serial device then it's expected that you\n" - "have a hardwired connection.\n\n" + "If you are using PPP over a serial device, as opposed to a direct\n" + "ethernet connection, then you may first need to dial your Internet\n" + "Service Provider using the ppp utility we provide for that purpose.\n" + "If you're using SLIP over a serial device then the expectation is\n" + "that you have a HARDWIRED connection.\n\n" "You can also install over a parallel port using a special \"laplink\"\n" "cable to another machine running a fairly recent (2.0R or later) version\n" "of FreeBSD.", @@ -600,18 +601,18 @@ media.", "media", { { "1 CDROM", "Install from a FreeBSD CDROM", NULL, mediaSetCDROM }, - { "2 DOS", "Install from a DOS partition", - NULL, mediaSetDOS }, - { "3 File System", "Install from an existing filesystem", - NULL, mediaSetUFS }, - { "4 Floppy", "Install from a floppy disk set", - NULL, mediaSetFloppy }, - { "5 FTP", "Install from an FTP server", + { "2 FTP", "Install from an FTP server", NULL, mediaSetFTPActive }, - { "6 FTP Passive", "Install from an FTP server through a firewall", + { "3 FTP Passive", "Install from an FTP server through a firewall", NULL, mediaSetFTPPassive }, - { "7 NFS", "Install over NFS", + { "4 DOS", "Install from a DOS partition", + NULL, mediaSetDOS }, + { "5 NFS", "Install over NFS", NULL, mediaSetNFS }, + { "6 File System", "Install from an existing filesystem", + NULL, mediaSetUFS }, + { "7 Floppy", "Install from a floppy disk set", + NULL, mediaSetFloppy }, { "8 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { NULL } }, @@ -731,6 +732,8 @@ you wish to install.", NULL, { { "base", "top-level files in /usr/src [300K]", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BASE }, + { "contrib", "/usr/src/contrib (contributed software) [33MB]", + dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_CONTRIB }, { "gnu", "/usr/src/gnu (software from the GNU Project) [42MB]", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GNU }, { "etc", "/usr/src/etc (miscellaneous system files) [460K]", @@ -1007,15 +1010,13 @@ software not provided in the base distributions.", NULL, optionsEditor }, { "8 Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, - { "9 Ports", "Link to FreeBSD Ports Collection on CD", - NULL, configPorts }, - { "A Root Password", "Set the system manager's password", + { "9 Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, - { "B HTML Docs", "Go to the HTML documentation menu (post-install)", + { "A HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, - { "C XFree86", "Configure XFree86", + { "B XFree86", "Configure XFree86", NULL, configXFree86 }, - { "0 Exit", "Exit this menu (returning to previous)", + { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; @@ -1143,9 +1144,6 @@ the other keymaps below.", { "German ISO", "German ISO keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=german.iso" }, { "Italian", "Italian ISO keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=it.iso" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=jp.106" }, - { "Russian CP866", "Russian Code Page 866 keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=ru.cp866" }, - { "Russian KOI8", "Russian koi8 keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=ru.koi8-r" }, - { "Russian s-KOI8", "Russian shifted koi8 keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=ru.koi8-r.shift" }, { "Swedish CP850", "Swedish Code Page 850 keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=swedish.cp850" }, { "Swedish ISO", "Swedish ISO keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=swedish.iso" }, { "U.K. CP850", "United Kingdom Code Page 850 keymap", dmenuVarCheck, dmenuSetVariable, NULL, "keymap=uk.cp850" }, diff --git a/release/sysinstall/msg.c b/release/sysinstall/msg.c index 56ab3933dbf4..da5f9afe34ff 100644 --- a/release/sysinstall/msg.c +++ b/release/sysinstall/msg.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: msg.c,v 1.29.2.15 1996/06/14 18:35:11 jkh Exp $ + * $Id: msg.c,v 1.41 1996/10/01 04:56:34 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -39,9 +39,6 @@ #include <sys/ioctl.h> #include <machine/console.h> -#define VTY_STATLINE 24 -#define TTY_STATLINE 23 - Boolean isDebug(void) { @@ -64,7 +61,7 @@ msgYap(char *fmt, ...) va_end(args); attrs = getattrs(stdscr); attrset(A_REVERSE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); } @@ -81,10 +78,8 @@ msgInfo(char *fmt, ...) attrs = getattrs(stdscr); /* NULL is a special convention meaning "erase the old stuff" */ if (!fmt) { - move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0); - attrset(A_NORMAL); + move(StatusLine, 0); clrtoeol(); - attrset(attrs); return; } errstr = (char *)alloca(FILENAME_MAX); @@ -100,9 +95,9 @@ msgInfo(char *fmt, ...) } line[80] = '\0'; attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, line); + mvaddstr(StatusLine, 0, line); attrset(attrs); - move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 79); + move(StatusLine, 79); refresh(); } @@ -122,7 +117,7 @@ msgWarn(char *fmt, ...) attrs = getattrs(stdscr); beep(); attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); if (OnVTY && isDebug()) @@ -145,7 +140,7 @@ msgError(char *fmt, ...) beep(); attrs = getattrs(stdscr); attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); if (OnVTY && isDebug()) @@ -168,7 +163,7 @@ msgFatal(char *fmt, ...) beep(); attrs = getattrs(stdscr); attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); addstr(" - "); addstr("PRESS ANY KEY TO "); if (getpid() == 1) @@ -189,7 +184,6 @@ msgConfirm(char *fmt, ...) { va_list args; char *errstr; - WINDOW *w; errstr = (char *)alloca(FILENAME_MAX); va_start(args, fmt); @@ -197,14 +191,12 @@ msgConfirm(char *fmt, ...) va_end(args); use_helpline(NULL); use_helpfile(NULL); - w = savescr(); if (OnVTY) { msgDebug("Switching back to VTY1\n"); ioctl(0, VT_ACTIVATE, 1); msgInfo(NULL); } dialog_notify(errstr); - restorescr(w); } /* Put up a message in a popup information box */ @@ -222,7 +214,7 @@ msgNotify(char *fmt, ...) use_helpfile(NULL); if (isDebug()) msgDebug("Notify: %s\n", errstr); - dialog_clear(); + dialog_clear_norefresh(); dialog_msgbox("Information Dialog", errstr, -1, -1, 0); } @@ -233,7 +225,6 @@ msgYesNo(char *fmt, ...) va_list args; char *errstr; int ret; - WINDOW *w; errstr = (char *)alloca(FILENAME_MAX); va_start(args, fmt); @@ -241,14 +232,12 @@ msgYesNo(char *fmt, ...) va_end(args); use_helpline(NULL); use_helpfile(NULL); - w = savescr(); if (OnVTY) { msgDebug("Switching back to VTY1\n"); ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); - restorescr(w); return ret; } @@ -260,7 +249,6 @@ msgGetInput(char *buf, char *fmt, ...) char *errstr; static char input_buffer[256]; int rval; - WINDOW *w; errstr = (char *)alloca(FILENAME_MAX); va_start(args, fmt); @@ -272,14 +260,12 @@ msgGetInput(char *buf, char *fmt, ...) strcpy(input_buffer, buf); else input_buffer[0] = '\0'; - w = savescr(); if (OnVTY) { msgDebug("Switching back to VTY1\n"); ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer); - restorescr(w); if (!rval) return input_buffer; else @@ -317,7 +303,7 @@ msgWeHaveOutput(char *fmt, ...) use_helpline(NULL); use_helpfile(NULL); msgDebug("Notify: %s\n", errstr); - dialog_clear(); + dialog_clear_norefresh(); dialog_msgbox("Information Dialog", errstr, -1, -1, 0); } diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c index 145e4b5456f6..aacdc3c43ccc 100644 --- a/release/sysinstall/network.c +++ b/release/sysinstall/network.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: network.c,v 1.7.2.23 1996/07/08 09:07:25 jkh Exp $ + * $Id: network.c,v 1.16 1996/08/03 10:11:26 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -76,7 +76,7 @@ mediaInitNetwork(Device *dev) char *val; char attach[256]; - dialog_clear(); + dialog_clear_norefresh(); /* Cheesy slip attach */ snprintf(attach, 256, "slattach -a -h -l -s 9600 %s", dev->devname); val = msgGetInput(attach, @@ -180,7 +180,7 @@ startPPP(Device *devp) Mkdir("/var/spool/lock"); Mkdir("/etc/ppp"); - dialog_clear(); + dialog_clear_norefresh(); if (!variable_get(VAR_SERIAL_SPEED)) variable_set2(VAR_SERIAL_SPEED, "115200"); /* Get any important user values */ diff --git a/release/sysinstall/nfs.c b/release/sysinstall/nfs.c index 1e3684cf9a68..ffabd261c22b 100644 --- a/release/sysinstall/nfs.c +++ b/release/sysinstall/nfs.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: nfs.c,v 1.5.2.20 1996/05/24 06:09:01 jkh Exp $ + * $Id: nfs.c,v 1.11 1996/08/23 07:55:59 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -75,7 +75,8 @@ mediaGetNFS(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; - msgDebug("Request for %s from NFS\n", file); + if (isDebug()) + msgDebug("Request for %s from NFS\n", file); snprintf(buf, PATH_MAX, "/dist/%s", file); if (file_readable(buf)) return open(buf, O_RDONLY); diff --git a/release/sysinstall/samba.c b/release/sysinstall/samba.c index cdcbfa3f7d65..e2df2087a65e 100644 --- a/release/sysinstall/samba.c +++ b/release/sysinstall/samba.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: samba.c,v 1.6 1996/07/10 04:52:27 jkh Exp $ + * $Id: samba.c,v 1.9 1996/10/09 09:53:41 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard & Coranth Gryphon. All rights reserved. @@ -52,8 +52,8 @@ static DMenu MenuSamba = { }; /* These probably shouldn't be hard-coded, but making them options might prove to be even more confusing! */ -#define SMB_CONF_DIR "/usr/local/samba/lib" -#define SMB_CONF "/usr/local/samba/lib/smb.conf" +#define SMB_CONF_DIR "/usr/local/etc" +#define SMB_CONF "/usr/local/etc/smb.conf" int configSamba(dialogMenuItem *self) @@ -115,7 +115,7 @@ configSamba(dialogMenuItem *self) } if (variable_get("SAMBA_export")) { - dialog_clear(); + dialog_clear_norefresh(); for (tval = 0; ! tval; tval = msgYesNo("Another?")) { tptr = msgGetInput(NULL,"What directory to export?"); if (tptr && *tptr && (tptr[0] == '/')) { @@ -131,7 +131,7 @@ configSamba(dialogMenuItem *self) tptr = msgGetInput(NULL, "Enter a short description of this share?"); if (tptr && *tptr) fprintf(fptr, "comment = %s\n", tptr); - if (msgYesNo("Do you want this share to be read only?")) + if (msgYesNo("Do you want this share to be read only?") != 0) fprintf(fptr, "read only = no\n\n"); else fprintf(fptr, "read only = yes\n\n"); diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index bb0aac58b00e..0123da53567f 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.42.2.65 1996/07/09 14:37:03 jkh Exp $ + * $Id: sysinstall.h,v 1.82 1996/10/14 21:32:33 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -295,6 +295,7 @@ extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern int BootMgr; /* Which boot manager to use */ +extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuFixit; /* Fixit repair menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ @@ -361,7 +362,6 @@ extern void command_func_add(char *key, commandFunc func, void *data); extern int configFstab(void); extern void configSysconfig(char *config); extern void configResolv(void); -extern int configPorts(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); @@ -466,6 +466,7 @@ void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); /* install.c */ +extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); @@ -511,7 +512,7 @@ extern int mediaSetFTPActive(dialogMenuItem *self); extern int mediaSetFTPPassive(dialogMenuItem *self); extern int mediaSetUFS(dialogMenuItem *self); extern int mediaSetNFS(dialogMenuItem *self); -extern int mediaSetFtpUserPass(dialogMenuItem *self); +extern int mediaSetFTPUserPass(dialogMenuItem *self); extern int mediaSetCPIOVerbosity(dialogMenuItem *self); extern int mediaGetType(dialogMenuItem *self); extern Boolean mediaExtractDist(char *dir, int fd); diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c index 97c169595574..908917a252a2 100644 --- a/release/sysinstall/system.c +++ b/release/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.44.2.24 1996/07/08 09:07:29 jkh Exp $ + * $Id: system.c,v 1.66 1996/10/01 12:13:29 jkh Exp $ * * Jordan Hubbard * @@ -37,8 +37,12 @@ static void handle_intr(int sig) { + WINDOW *save = savescr(); + if (!msgYesNo("Are you sure you want to abort the installation?")) systemShutdown(1); + else + restorescr(save); } /* Expand a file into a convenient location, nuking it each time */ @@ -64,7 +68,11 @@ systemInitialize(int argc, char **argv) /* Are we running as init? */ if (getpid() == 1) { setsid(); - close(0); open("/dev/ttyv0", O_RDWR); + close(0); + if (open("/dev/ttyv0", O_RDWR) < 0) + open("/dev/console", O_RDWR); + else + OnVTY = TRUE; close(1); dup(0); close(2); dup(0); printf("%s running as init\n", argv[0]); @@ -153,7 +161,6 @@ systemDisplayHelp(char *file) { char *fname = NULL; char buf[FILENAME_MAX]; - WINDOW *old = savescr(); int ret = 0; fname = systemHelpFile(file, buf); @@ -169,7 +176,6 @@ systemDisplayHelp(char *file) use_helpline(NULL); dialog_textbox(file, fname, LINES, COLS); } - restorescr(old); return ret; } diff --git a/release/sysinstall/tape.c b/release/sysinstall/tape.c index 5c757a3e2f18..c65426e62080 100644 --- a/release/sysinstall/tape.c +++ b/release/sysinstall/tape.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: tape.c,v 1.6.2.16 1996/05/24 06:09:06 jkh Exp $ + * $Id: tape.c,v 1.13 1996/08/23 07:56:00 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -84,7 +84,8 @@ mediaGetTape(Device *dev, char *file, Boolean probe) int fd; sprintf(buf, "%s/%s", (char *)dev->private, file); - msgDebug("Request for %s from tape (looking in %s)\n", file, buf); + if (isDebug()) + msgDebug("Request for %s from tape (looking in %s)\n", file, buf); if (file_readable(buf)) fd = open(buf, O_RDONLY); else { diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index beb7872ac09d..ef01c2a1bb7b 100644 --- a/release/sysinstall/tcpip.c +++ b/release/sysinstall/tcpip.c @@ -1,8 +1,10 @@ /* - * $Id: tcpip.c,v 1.30.2.25 1996/07/03 01:31:18 jkh Exp $ + * $Id: tcpip.c,v 1.48 1996/10/05 16:33:04 jkh Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. + * Copyright (c) 1996 + * Jordan K. Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -15,10 +17,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY GARY J PALMER ``AS IS'' AND ANY EXPRESS OR + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL GARY J PALMER BE LIABLE FOR ANY DIRECT, INDIRECT, + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED @@ -78,11 +80,11 @@ typedef struct _layout { static Layout layout[] = { { 1, 2, 25, HOSTNAME_FIELD_LEN - 1, - "Host name:", "Your fully-qualified hostname, e.g. foo.bar.com", + "Host:", "Your fully-qualified hostname, e.g. foo.bar.com", hostname, STRINGOBJ, NULL }, #define LAYOUT_HOSTNAME 0 { 1, 35, 20, HOSTNAME_FIELD_LEN - 1, - "Domain name:", + "Domain:", "The name of the domain that your machine is in, e.g. bar.com", domainname, STRINGOBJ, NULL }, #define LAYOUT_DOMAINNAME 1 @@ -107,7 +109,7 @@ static Layout layout[] = { #define LAYOUT_NETMASK 5 { 14, 10, 37, HOSTNAME_FIELD_LEN - 1, "Extra options to ifconfig:", - "Any interface-specific options to ifconfig you would like to use", + "Any interface-specific options to ifconfig you would like to add", extras, STRINGOBJ, NULL }, #define LAYOUT_EXTRAS 6 { 19, 15, 0, 0, @@ -234,16 +236,20 @@ tcpOpenDialog(Device *devp) char help[FILENAME_MAX]; char title[80]; + if (!RunningAsInit) { + if (isDebug()) + msgDebug("Running multi-user, assuming that the network is already up\n"); + return DITEM_SUCCESS; + } save = savescr(); - dialog_clear(); + dialog_clear_norefresh(); /* We need a curses window */ ds_win = newwin(LINES, COLS, 0, 0); if (ds_win == 0) msgFatal("Cannot open TCP/IP dialog window!!"); /* Say where our help comes from */ - systemHelpFile(TCP_HELPFILE, help); - use_helpfile(help); + use_helpfile(systemHelpFile(TCP_HELPFILE, help)); /* Setup a nice screen for us to splat stuff onto */ draw_box(ds_win, TCP_DIALOG_Y, TCP_DIALOG_X, TCP_DIALOG_HEIGHT, TCP_DIALOG_WIDTH, dialog_attr, border_attr); @@ -397,27 +403,9 @@ tcpOpenDialog(Device *devp) awkward for the user to go back and correct screw up's in the per-interface section */ - case KEY_UP: - if (obj->prev !=NULL ) { - obj = obj->prev; - --n; - } else { - obj = last; - n = max; - } - break; - case KEY_DOWN: - if (obj->next != NULL) { - obj = obj->next; - ++n; - } else { - obj = first; - n = 0; - } - break; - case SEL_TAB: + case SEL_CR: if (n < max) ++n; else @@ -434,14 +422,7 @@ tcpOpenDialog(Device *devp) } break; - /* Generic CR handler */ - case SEL_CR: - if (n < max) - ++n; - else - n = 0; - break; - + case KEY_UP: case SEL_BACKTAB: if (n) --n; @@ -466,8 +447,7 @@ tcpOpenDialog(Device *devp) } /* Clear this crap off the screen */ - dialog_clear(); - refresh(); + dialog_clear_norefresh(); use_helpfile(NULL); /* We actually need to inform the rest of sysinstall about this @@ -545,14 +525,9 @@ tcpDeviceSelect(void) msgConfirm("No network devices available!"); status = FALSE; } - else if (cnt == 1 || (!RunningAsInit && !Fake)) { - /* If we're running in user mode, assume network already up */ - if (RunningAsInit) { - if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_FAILURE)) - return FALSE; - } - else - msgDebug("Running multi-user, assuming that the network is already up\n"); + else if (cnt == 1) { + if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_FAILURE)) + return FALSE; mediaDevice = devs[0]; status = TRUE; } diff --git a/release/sysinstall/termcap.c b/release/sysinstall/termcap.c index 834ea0f5b954..5771e5f44eb6 100644 --- a/release/sysinstall/termcap.c +++ b/release/sysinstall/termcap.c @@ -23,13 +23,16 @@ #include "sysinstall.h" +#define VTY_STATUS_LINE 24 +#define TTY_STATUS_LINE 23 + int set_termcap(void) { char *term; int stat; + struct ttysize ts; - OnVTY = FALSE; term = getenv("TERM"); stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay); @@ -39,7 +42,7 @@ set_termcap(void) DebugFD = open("/dev/null", O_RDWR, 0); } - if (stat < 0) { + if (!OnVTY || (stat < 0)) { if (!term) { if (setenv("TERM", "vt100", 1) < 0) return -1; @@ -74,7 +77,11 @@ set_termcap(void) return -1; } } - OnVTY = TRUE; } + if (ioctl(0, TIOCGSIZE, &ts) == -1) { + msgDebug("Unable to get terminal size - errno %d\n", errno); + ts.ts_lines = 0; + } + StatusLine = ts.ts_lines ? ts.ts_lines : (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE); return 0; } diff --git a/release/sysinstall/ufs.c b/release/sysinstall/ufs.c index 0dbf272b7955..ac08c1d847df 100644 --- a/release/sysinstall/ufs.c +++ b/release/sysinstall/ufs.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: ufs.c,v 1.8 1996/04/13 13:32:14 jkh Exp $ + * $Id: ufs.c,v 1.9 1996/08/23 07:56:01 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -47,7 +47,8 @@ mediaGetUFS(Device *dev, char *file, Boolean probe) { char buf[PATH_MAX]; - msgDebug("Request for %s from UFS\n", file); + if (isDebug()) + msgDebug("Request for %s from UFS\n", file); snprintf(buf, PATH_MAX, "%s/%s", dev->private, file); if (file_readable(buf)) return open(buf, O_RDONLY); diff --git a/release/sysinstall/variable.c b/release/sysinstall/variable.c index 27176dad3497..a19c6afc847c 100644 --- a/release/sysinstall/variable.c +++ b/release/sysinstall/variable.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: variable.c,v 1.6.2.12 1996/05/24 06:09:13 jkh Exp $ + * $Id: variable.c,v 1.11 1996/06/12 14:02:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. |
