Index: stable/2.1/release/MIRROR.SITES =================================================================== --- stable/2.1/release/MIRROR.SITES (revision 15974) +++ stable/2.1/release/MIRROR.SITES (nonexistent) @@ -1,189 +0,0 @@ -$Id: MIRROR.SITES,v 1.1.2.7 1995/11/21 10:18:18 asami Exp $ - -Obtaining FreeBSD - - The official sources for FreeBSD available via anonymous FTP from: - - ftp://ftp.FreeBSD.org/pub/FreeBSD - - and on CD-ROM from Walnut Creek CDROM: - - Walnut Creek CDROM - 1547 Palos Verdes Mall, Suite 260 - Walnut Creek CA 94596 USA - Phone: +1 510 674-0783 - Fax: +1 510 674-0821 - Email: info@cdrom.com - WWW: http://www.cdrom.com/ - - - Additionally, FreeBSD is available via anonymous FTP from the - following mirror sites. If you choose to obtain FreeBSD via anonymous - FTP, please try to use a site near you. - - Australia - - + ftp://ftp.physics.usyd.edu.au/FreeBSD - Contact: dawes@xfree86.org. - - + ftp://minnie.cs.adfa.oz.au/FreeBSD - Contact: wkt@dolphin.cs.adfa.oz.au. - - Canada - - + ftp://ftp.synapse.net/contrib/FreeBSD - Contact: evanc@synapse.net. - - Finland - - + ftp://nic.funet.fi/pub/unix/FreeBSD - Contact: count@nic.funet.fi. - - France - - + ftp://ftp.ibp.fr/pub/FreeBSD - Contact: Remy.Card@ibp.fr. - - Germany - - + ftp://ftp.fb9dv.uni-duisburg.de/pub/unix/FreeBSD - Contact: ftp@ftp.fb9dv.uni-duisburg.de. - - + ftp://gil.physik.rwth-aachen.de/pub/FreeBSD - Contact: kuku@gil.physik.rwth-aachen.de. - - + ftp://ftp.uni-paderborn.de/freebsd - Contact: ftp@uni-paderborn.de. - - + ftp://ftp.leo.org/pub/comp/os/bsd/FreeBSD - Contact: bsd@leo.org. - - + ftp://ftp.tu-dresden.de/pub/soft/unix/bsd/FreeBSD - Contact: pdsowner@rcs1.urz.tu-dresden.de. - - Hong Kong - - + ftp://ftp.hk.super.net/pub/mirror/FreeBSD - Contact: ftp-admin@HK.Super.NET. - - Ireland - - + ftp://ftp.internet-eireann.ie/pub/FreeBSD - Contact: ftpadmin@internet-eireann.ie. - - Israel - - + ftp://orgchem.weizmann.ac.il/pub/FreeBSD - Contact: serg@klara.weizmann.ac.il. - - Japan - - + ftp://ftp.tokyonet.ad.jp/pub/FreeBSD - Contact: ftpadmin@TokyoNet.AD.JP. - - + ftp://ftp.nisiq.net/pub/os/FreeBSD/ - Contact: ftp-admin@nisiq.net. - - + ftp://ftp.iij.ad.jp/pub/FreeBSD/ - Contact: ftp@ftp.iij.ad.jp. - - + ftp://ftp.kuis.kyoto-u.ac.jp/BSD/FreeBSD/ - Contact: ftp-admin@kuis.kyoto-u.ac.jp. - - + ftp://ftp.ee.uec.ac.jp/pub/os/mirror/ftp.freebsd.org - Contact: ftp-admin@ftp.ee.uec.ac.jp. - - + ftp://ftp.u-aizu.ac.jp/pub/os/FreeBSD - Contact: ftp-admin@u-aizu.ac.jp. - - Korea - - + ftp://ftp.cau.ac.kr/pub/FreeBSD - Contact: ftpadm@ftp.cau.ac.kr. - - + ftp://ftp.easy.re.kr/pub/FreeBSD - Contact: ftpadm@easy.re.kr. - - Netherlands - - + ftp://ftp.nl.net/pub/os/FreeBSD - Contact: archive@nl.net. - - Poland - - + ftp://SunSITE.icm.edu.pl/pub/FreeBSD/ftp.freebsd.org - Contact: w.sylwestrzak@icm.edu.pl - - Russia - - + ftp://ftp.kiae.su/FreeBSD - Contact: ftp@ftp.kiae.su. - - Sweden - - + ftp://ftp.luth.se/pub/FreeBSD - Contact: ragge@ludd.luth.se. - - Taiwan - - + ftp://NCTUCCCA.edu.tw/Operating-Systems/FreeBSD - Contact: freebsd@NCTUCCCA.edu.tw. - - + ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD - Contact: ftp@netbsd.csie.nctu.edu.tw. - - Thailand - - + ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD - Contact: ftpadmin@ftp.nectec.or.th. - - UK - - + ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD - Contact: wizards@doc.ic.ac.uk. - - + ftp://unix.hensa.ac.uk/mirrors/walnut.creek/FreeBSD - Contact: archive-admin@unix.hensa.ac.uk. - - + ftp://ftp.demon.co.uk/pub/BSD/FreeBSD - Contact: uploads@demon.net. - - USA - - + ftp://ftp.neosoft.com/systems/FreeBSD - Contact: smace@NeoSoft.COM. - - + ftp://kryten.atinc.com/pub/FreeBSD - Contact: jmb@kryten.atinc.com. - - + ftp://ftp.cps.cmich.edu/pub/ftp.freebsd.org - Contact: ftpadmin@cps.cmich.edu. - - + ftp://ftp.cslab.vt.edu/pub/FreeBSD - Contact: ftp@ftp.cslab.vt.edu. - - - - The latest versions of export-restricted code for FreeBSD (2.0C or - later) (eBones and secure) are being made available at the following - locations. If you are outside the U.S. or Canada, please get secure - (DES) and eBones (Kerberos) from one of the following foreign - distribution sites: - - South Africa - - + ftp://ftp.internat.freebsd.org/pub/FreeBSD - Contact: Mark Murray mark@grondar.za. - - + ftp://storm.sea.uct.ac.za/pub/FreeBSD - Contact: Shaun Courtney ftp@storm.sea.uct.ac.za. - - Brazil - - + ftp://ftp.iqm.unicamp.br/pub/FreeBSD - Contact: Pedro A M Vazquez vazquez@iqm.unicamp.br. - - Finland - - + ftp://nic.funet.fi/pub/unix/FreeBSD/eurocrypt - Contact: count@nic.funet.fi. Property changes on: stable/2.1/release/MIRROR.SITES ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: stable/2.1/release/root_crunch.conf =================================================================== --- stable/2.1/release/root_crunch.conf (revision 15974) +++ stable/2.1/release/root_crunch.conf (nonexistent) @@ -1,35 +0,0 @@ -# $Id: root_crunch.conf,v 1.5.2.2 1995/09/25 01:35:53 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. - -srcdirs /usr/src/gnu/usr.bin -srcdirs /usr/src/bin /usr/src/sbin /usr/src/sbin/i386 /usr/src/usr.bin -srcdirs /usr/src/usr.sbin - -# second, we list all the programs we want to include in our crunched binary. -# The order doesn't matter. Any program that needs hard links to it gets an -# `ln' directive. - -# /bin stuff - -progs ls cat df ee chmod cksum cp date dd echo ed expr grep hostname kill ln -progs mkdir mt mv rcp rm rmdir sleep stty sync test ft -ln test [ - -# /sbin stuff - -progs badsect basename chown clri disklabel dmesg dump dmesg fdisk ft -progs getopt init mknod mount mount_cd9660 mount_msdos mount_nfs -progs ping reboot restore swapon umount -ln dump rdump -ln restore rrestore -ln reboot halt - -# /usr/bin stuff - -progs tar ftp rsh sed telnet rlogin - -# finally, we specify the libraries to link in with our binary -libs -lcrypt -ltelnet -lutil -ll -ledit -libs -lgnuregex -lreadline -lncurses -lmytinfo -lkvm Property changes on: stable/2.1/release/root_crunch.conf ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: stable/2.1/release/Makefile =================================================================== --- stable/2.1/release/Makefile (revision 15974) +++ stable/2.1/release/Makefile (revision 15975) @@ -1,577 +1,545 @@ -# $Id: Makefile,v 1.215 1996/05/16 03:20:52 jkh Exp $ +# $Id: Makefile,v 1.217 1996/05/29 04:13:17 jkh Exp $ # # How to roll a release: # # make release CHROOTDIR= [ RELEASETAG=something ] # # As far as I know, this will roll everything nicely into the "stage" # directory. I still need to write the two rules to move that into # the "cdrom" and "ftp" directories. # I also need to "make ports" and install those, but I'm not going to do # that on a 14.4 line just yet... # # SET THIS !!! #BUILDNAME=2.2-960501-SNAP #CHROOTDIR=/junk/release # If this is a RELEASE, then set #RELEASETAG=RELENG_2_1_0 # Things which without too much trouble can be considered variables EXPORT_DISTS= games manpages proflibs dict info doc EXTRA_DISTS= krb des ${EXPORT_DISTS} ALL_DISTS= bin ${EXTRA_DISTS} # Extra source tarballs; each argument is a pair of source dir and # distribution name. The dist name should not exceed 7 characters # (another "s" for "source" will be prepended). EXTRA_SRC+= usr.sbin/sendmail/cf smailcf #EXTRA_SRC+= usr.sbin/config kconf BOOT1= etc/protocols etc/sysconfig # mountpoint for filesystems. MNT= /mnt # other floppy parameters. FDSIZE= 1200 FDLABEL= fd1200 FDINODE= 4300 NEWFSARGS= -c 80 -b 4096 -f 512 -i 4000 -m 0 -t 0 -u 0 \ -o space -T ${FDLABEL} ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 - # Upper size for the mfs in the boot.flp kernel. # These are adjusted down to the minimum needed but doFS.sh. BOOTMFSSIZE= 1200 MFSINODE= 40000 # Things which will get you into trouble if you change them DISTRIBUTIONS= bin ${EXTRA_DISTS} MTREEFILES= ${.CURDIR}/../etc/mtree RD= ${RELEASEDIR}/stage FD= ${RELEASEDIR}/ftp CD= ${RELEASEDIR}/cdrom .if !defined(WHICH_CRUNCH) -WHICH_CRUNCH= boot root fixit +WHICH_CRUNCH= boot fixit .endif rerelease release: .if !defined(CHROOTDIR) || !defined(BUILDNAME) @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false .endif .if make(release) .if exists(${CHROOTDIR}) chflags -R noschg ${CHROOTDIR}/. -rm -rf ${CHROOTDIR} .endif -mkdir -p ${CHROOTDIR} cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR} cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} .if !defined(RELEASETAG) cd ${CHROOTDIR}/usr && cvs co -P src .else cd ${CHROOTDIR}/usr && cvs co -P -r ${RELEASETAG} src .endif .endif .if make(rerelease) .if !defined(RELEASENOUPDATE) .if !defined(RELEASETAG) cd ${CHROOTDIR}/usr && cvs -q update -P -d src .else cd ${CHROOTDIR}/usr && cvs -q update -P -d -r ${RELEASETAG} src .endif .endif .endif ( cd ${CHROOTDIR}/usr/src/sys/conf && \ mv newvers.sh foo && \ 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 ) echo "#!/bin/sh" > ${CHROOTDIR}/mk echo "set -ex" >> ${CHROOTDIR}/mk echo "CFLAGS='-O2 -pipe'" >> ${CHROOTDIR}/mk echo "export CFLAGS" >> ${CHROOTDIR}/mk echo "RELEASEDIR=/R" >> ${CHROOTDIR}/mk echo "export RELEASEDIR" >> ${CHROOTDIR}/mk echo "cd /usr/src" >> ${CHROOTDIR}/mk .if make(release) echo "make world" >> ${CHROOTDIR}/mk .endif .if make(rerelease) echo "make all install" >> ${CHROOTDIR}/mk .endif echo "cd /usr/src/release" >> ${CHROOTDIR}/mk echo "make obj" >> ${CHROOTDIR}/mk echo "rm -f obj/release.4" >> ${CHROOTDIR}/mk echo "make doRELEASE" >> ${CHROOTDIR}/mk echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk chmod 755 ${CHROOTDIR}/mk chroot ${CHROOTDIR} /mk whap: ( cd ${CHROOTDIR}/usr/src/release/sysinstall && \ sed "s/__RELEASE/${BUILDNAME}/" version.h > version.h.new && mv version.h.new version.h ) clean: - rm -rf root_crunch boot_crunch release.[0-9] release.1[0] + rm -rf boot_crunch release.[0-9] release.1[0] # Clean out ${RELEASEDIR} and make the directory structure. release.1: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR -mkdir ${RELEASEDIR} chflags -R noschg ${RELEASEDIR}/. rm -rf ${RELEASEDIR}/* mkdir ${RD} mkdir ${RD}/floppies mkdir ${RD}/trees mkdir ${RD}/dists mkdir ${RD}/kernels for i in ${ALL_DISTS} ; do \ mkdir ${RD}/trees/$$i && \ mkdir ${RD}/dists/$$i && \ mtree -deU -f ${MTREEFILES}/BSD.root.dist \ -p ${RD}/trees/$$i > /dev/null && \ mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ -p ${RD}/trees/$$i/usr > /dev/null && \ mtree -deU -f ${MTREEFILES}/BSD.include.dist \ -p ${RD}/trees/$$i/usr/include > /dev/null && \ mtree -deU -f ${MTREEFILES}/BSD.var.dist \ -p ${RD}/trees/$$i/var > /dev/null ; \ done touch release.1 # Install the system into the various distributions. release.2: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees .if exists(${.CURDIR}/../eBones) cd ${.CURDIR}/../eBones && ( \ make bootstrap &&\ make obj all help-distribute DISTDIR=${RD}/trees &&\ make kprog \ ) .endif chflags -R noschg ${RD}/trees # We don't really want to make a compat20 distribution for just # one file. uudecode ${.CURDIR}/compat20/libgcc.so.261.0.uu install -m 444 -o bin -g bin libgcc.so.261.0 ${RD}/trees/bin/usr/lib touch release.2 # Make and install the generic kernel. release.3: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -f ${RD}/kernels/GENERIC rm -rf ${.CURDIR}/../sys/compile/GENERIC cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=GENERIC rm -rf ${.CURDIR}/../sys/compile/GENERIC touch release.3 # Make and install the three crunched binaries which live on the floppies. # You are not supposed to like this :-) release.4: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR cd ${.CURDIR}/sysinstall && make obj && make depend && make all rm -rf ${RD}/crunch mkdir -p ${RD}/crunch for j in ${WHICH_CRUNCH} ; do \ rm -rf $${j}_crunch && \ mkdir $${j}_crunch && \ ( cd $${j}_crunch && \ crunchgen ${.CURDIR}/$${j}_crunch.conf && \ ${MAKE} -f $${j}_crunch.mk all NOCRYPT=yes \ "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \ mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ true || rm -rf $${j}_crunch ; \ done touch release.4 # # --==## Fix up the distributions. ##==-- # release.5: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR ln -f ${RD}/kernels/GENERIC ${RD}/trees/bin/kernel.GENERIC # Handle some grief caused by the ammunition braindeadness. for i in sbin/init bin/ed ; do \ ( cd ${.CURDIR}/../$$i; \ make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ done # 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 ;\ 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 ;\ 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 ;\ 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 ;\ 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 ;\ 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 ; \ 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 ;\ fi # Move the profiled libraries out to their own dist for i in ${RD}/trees/bin/usr/lib/*_p.a ; do \ if [ -f $$i ] ; then \ mv $$i \ ${RD}/trees/proflibs/usr/lib ; \ fi ; \ done # Create symlinks for the MD5-based crypt lib, too. The # automatically created links still point to the DES stuff, # which went into its own distribution. for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \ c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \ rm -f $$c ; \ ln -s `basename $$i` $$c ; \ done # Remove some files we can faster regen after installing. cd ${RD}/trees/bin/usr/share/misc && rm -f termcap.db vgrindefs.db # Remove all the directories we don't need. -cd ${RD}/trees && \ find ${EXTRA_DISTS} -depth -type d -print | xargs rmdir touch release.5 # # --==## Make binary dists ##==-- # release.6: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -rf ${RD}/dists mkdir -p ${RD}/dists - mkdir -p ${RD}/info @for i in ${DISTRIBUTIONS} ; \ do \ if [ -d ${RD}/trees/$${i} ] ; then \ cd ${.CURDIR} && $(MAKE) doTARBALL \ SD=${RD}/trees/$${i} \ TN=$$i TD=$$i ARG="." && \ echo "$${i} distribution is finished."; \ fi ; \ done ( cd ${RD}/dists && \ if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi ) - ( cd ${RD}/info && \ - if [ -d krb ] ; then mv krb/* des && rmdir krb ; fi ) touch release.6 # # --==## Make source dists ##==-- # release.7: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ TD=src TN=sbase ARG="[A-Z]*" @for i in `cd /usr/src && echo [a-z]*` ; do \ if [ -d /usr/src/$$i ] ; then \ cd ${.CURDIR} && $(MAKE) doTARBALL \ TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \ SD=/usr/src TD=src ARG="$$i" ; \ fi ; \ done .if defined(EXTRA_SRC) @set ${EXTRA_SRC} && \ while [ $$# -ge 2 ] ; do \ if [ -d /usr/src/$$1 ] ; then \ cd ${.CURDIR} && $(MAKE) doTARBALL \ SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ fi && shift && shift ; \ done .endif ( cd ${RD}/dists/src && \ if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \ - if [ -f sebones.aa ] ; then mv sebones.* ../des ; fi ) - ( cd ${RD}/info/src && \ + if [ -f sebones.aa ] ; then mv sebones.* ../des ; fi && \ if [ -f ssecure.inf ] ; then mv ssecure.inf ../des ; fi && \ if [ -f sebones.inf ] ; then mv sebones.inf ../des ; fi ; ) @echo "src distribution is finished." touch release.7 # Complete the bootfd # # Now, just to get this picture down once and for all: # # +------------------------------------------------------------------------+ # |boot.flp | # +-----+-----+------------------------------------------------------------+ # |boot1|boot2|floppy filesystem "bootfd" | # +-----+-----+-+--------------------------------------------------------+-+ # |kernel | # +------------+-----------------------------------------+-+ # |mfs filesystem "mfsfd" | # +-----------------------------------------+ # release.8: write_mfs_in_kernel @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -rf ${RD}/mfsfd mkdir ${RD}/mfsfd cd ${RD}/mfsfd && \ mkdir -p dev mnt stand/help @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ DIR=${RD}/mfsfd/stand ZIP=false ( cd ${RD}/trees/bin/dev && \ ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero \ *[sw]d* cuaa[01] cuaa[23] fd[01] rfd[01] \ cd0a mcd0a scd0a matcd0a wcd0c rst0 rft0 rwt0 | \ cpio -dump ${RD}/mfsfd/dev ) ( cd ${RD}/mfsfd/dev && rm -f *[sw]d*[bdefgh] ) cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services install -c ${.CURDIR}/../COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp # make the small bootfd sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \ ${MFSINODE} minimum mv fs-image fs-image.4 mv fs-image.size fs-image.4.size # add more stuff for the complete bootfd tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \ tar xvf - -C ${RD}/mfsfd/stand + cp ${.CURDIR}/sysinstall/power.uu ${RD}/mfsfd/stand && \ + cd ${RD}/mfsfd/stand && uudecode power.uu && rm power.uu sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \ ${MFSINODE} minimum mv fs-image fs-image.std mv fs-image.size fs-image.std.size #rm -rf ${.CURDIR}/../sys/compile/BOOTMFS cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=4 cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=std mv ${RD}/floppies/bootstd.flp ${RD}/floppies/boot.flp #rm -rf ${.CURDIR}/../sys/compile/BOOTMFS touch release.8 # -# --==## Create a root floppy ##==-- +# --==## Create a fixit floppy ##==-- # release.9: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR - rm -rf ${RD}/rootfd - mkdir ${RD}/rootfd - cd ${RD}/rootfd && \ - mkdir stand stand/info - @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=root \ - DIR=${RD}/rootfd/stand ZIP=false - tar --exclude CVS -cf - -C ${RD} info | tar xvf - -C ${RD}/rootfd/stand - tar -cf - -C ${RD}/trees/bin/dev MAKEDEV | \ - tar xvf - -C ${RD}/rootfd/stand - cp ${.CURDIR}/sysinstall/power.uu ${RD}/rootfd/stand && \ - cd ${RD}/rootfd/stand && uudecode power.uu && rm power.uu - cd ${RD}/rootfd && \ - ( rm -f OK && find . -print && touch OK && echo OK ) | \ - cpio -H newc -oa | gzip -9 -c | \ - dd conv=osync > ${RD}/floppies/root.tmp - mv ${RD}/floppies/root.tmp ${RD}/floppies/root.flp - touch release.9 - -# -# --==## Create a fixit floppy ##==-- -# -release.10: - @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -rf ${RD}/fixitfd mkdir ${RD}/fixitfd cd ${RD}/fixitfd && \ mkdir dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \ DIR=${RD}/fixitfd/stand ZIP=true ( cd ${RD}/fixitfd/dev && \ cp ${RD}/trees/bin/dev/MAKEDEV . && \ sh MAKEDEV all ) cp ${RD}/trees/bin/etc/spwd.db ${RD}/fixitfd/etc cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${FDSIZE} ${RD}/fixitfd \ 10000 ${FDLABEL} mv fs-image ${RD}/floppies/fixit.flp - touch release.10 + touch release.9 # # --==## Setup a suitable ftp-area ##==-- # ftp.1: rm -rf ${FD} mkdir ${FD} cd ${RD} && find floppies -print | cpio -dumpl ${FD} cd ${RD}/dists && find . -print | cpio -dumpl ${FD} # # --==## Setup a suitable cdrom-area ##==-- # cdrom.1: rm -rf ${CD} mkdir ${CD} mkdir ${CD}/filesys cd ${RD} && find floppies dists -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} ; \ do \ if [ -d ${RD}/trees/$${i} ] ; then \ ( cd ${RD}/trees/$${i} && \ find . -depth -print | cpio -dumpl ${CD}/filesys ) ; \ fi \ done # Various "subroutine" and other supporting targets. doTARBALL: .if !defined(SD) @echo "SD undefined in doTARBALL" && exit 1 .endif .if !defined(TD) @echo "TB undefined in doTARBALL" && exit 1 .endif .if !defined(ARG) @echo "ARG undefined in doTARBALL" && exit 1 .endif rm -rf ${RD}/dists/${TD}/${TN}* mkdir -p ${RD}/dists/${TD} ( cd ${SD} && \ tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \ echo rolling ${TD}/$$tn tarball &&\ tar --exclude CVS --exclude obj -cf - ${ARG} | \ ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ - cd ${RD}/info && \ - mkdir -p ${TD} && \ - sh ${.CURDIR}/info.sh ${RD}/dists/${TD}/$$tn > ${TD}/$$tn.inf \ - ) + mkdir -p ${TD} && sh ${.CURDIR}/info.sh \ + ${RD}/dists/${TD}/$$tn > ${RD}/dists/${TD}/$$tn.inf ) doRELEASE: release.1 release.2 release.3 release.4 release.5 release.6 \ - release.7 release.8 release.9 release.10 + release.7 release.8 release.9 cd ${.CURDIR} && ${MAKE} cdrom.1 ftp.1 @echo "Release done" floppies: cd ${.CURDIR} && ${MAKE} boot.flp - cd ${.CURDIR} && ${MAKE} root.flp cd ${.CURDIR} && ${MAKE} fixit.flp cd ${RD} && find floppies -print | cpio -dumpl ${FD} boot.flp: rm -f release.4 release.8 cd ${.CURDIR} && ${MAKE} release.4 release.8 WHICH_CRUNCH=boot -root.flp: - rm -f release.4 release.9 - cd ${.CURDIR} && ${MAKE} release.4 release.9 WHICH_CRUNCH=root - fixit.flp: - rm -f release.4 release.10 - cd ${.CURDIR} && ${MAKE} release.4 release.10 WHICH_CRUNCH=fixit + rm -f release.4 release.9 + cd ${.CURDIR} && ${MAKE} release.4 release.9 WHICH_CRUNCH=fixit write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c ckRELEASEDIR: .if !defined(RELEASEDIR) @echo "To make a release RELEASEDIR must be defined" && false .endif installCRUNCH: .if !defined(CRUNCH) @echo "CRUNCH undefined in installCRUNCH" && exit 1 .endif .if !defined(DIR) @echo "DIR undefined in installCRUNCH" && exit 1 .endif .if !defined(ZIP) @echo "ZIP undefined in installCRUNCH" && exit 1 .endif if ${ZIP} ; then \ gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ else \ ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ fi chmod 555 ${DIR}/${CRUNCH}_crunch for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ done # # --==## Compile a kernel by name ${KERNEL} ##==-- # # We don't erase the sys/compile/${KERNEL} directory, since somebody # may want to reuse it (release.8 presently) # doKERNEL: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -f ${RD}/kernels/${KERNEL} cd ${.CURDIR}/../sys/i386/conf && config -n ${KERNEL} cd ${.CURDIR}/../sys/compile/${KERNEL} && \ make depend && \ make kernel && \ cp kernel ${RD}/kernels/${KERNEL} # # --==## Put a filesystem into a BOOTMFS kernel ##==-- # doMFSKERN: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} rm -f /sys/compile/BOOTMFS/mfs_vfsops.o cd ${.CURDIR}/../sys/i386/conf && \ fgrep -v SYSV GENERIC | \ fgrep -v pty | \ fgrep -v PROCFS | \ sed 's/GENERIC/BOOTMFS/g' | \ sed '/maxusers/s/10/4/' > BOOTMFS && \ echo "options MFS" >> BOOTMFS && \ echo "options NFS_NOSERVER" >> BOOTMFS && echo 'options "MAXCONS=4"' >> 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 ./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 .include Index: stable/2.1/release/sysinstall/config.c =================================================================== --- stable/2.1/release/sysinstall/config.c (revision 15974) +++ stable/2.1/release/sysinstall/config.c (revision 15975) @@ -1,604 +1,605 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.32 1996/05/23 16:34:24 jkh Exp $ + * $Id: config.c,v 1.16.2.48 1996/05/24 06:08:18 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * 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 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS 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) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "sysinstall.h" #include #include #include #include #include #include #include #include #include static Chunk *chunk_list[MAX_CHUNKS]; static int nchunks; /* arg to sort */ static int chunk_compare(Chunk *c1, Chunk *c2) { if (!c1 && !c2) return 0; else if (!c1 && c2) return 1; else if (c1 && !c2) return -1; else if (!c1->private_data && !c2->private_data) return 0; else if (c1->private_data && !c2->private_data) return 1; else if (!c1->private_data && c2->private_data) return -1; else return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint); } static void chunk_sort(void) { int i, j; for (i = 0; i < nchunks; i++) { for (j = 0; j < nchunks; j++) { if (chunk_compare(chunk_list[j], chunk_list[j + 1]) > 0) { Chunk *tmp = chunk_list[j]; chunk_list[j] = chunk_list[j + 1]; chunk_list[j + 1] = tmp; } } } } static char * name_of(Chunk *c1) { static char rootname[32]; /* Our boot blocks can't deal with root partitions on slices - need the compatbility name */ if (c1->type == part && c1->flags & CHUNK_IS_ROOT) { sprintf(rootname, "%sa", c1->disk->name); return rootname; } else return c1->name; } static char * mount_point(Chunk *c1) { if (c1->type == part && c1->subtype == FS_SWAP) return "none"; else if (c1->type == part || c1->type == fat) return ((PartInfo *)c1->private_data)->mountpoint; return "/bogus"; } static char * fstype(Chunk *c1) { if (c1->type == fat) return "msdos"; else if (c1->type == part) { if (c1->subtype != FS_SWAP) return "ufs"; else return "swap"; } return "bogus"; } static char * fstype_short(Chunk *c1) { if (c1->type == part) { if (c1->subtype != FS_SWAP) return "rw"; else return "sw"; } else if (c1->type == fat) return "ro"; return "bog"; } static int seq_num(Chunk *c1) { if (c1->type == part && c1->subtype != FS_SWAP) return 1; return 0; } int configFstab(void) { Device **devs; Disk *disk; FILE *fstab; int i, cnt; Chunk *c1, *c2; if (!RunningAsInit) { if (file_readable("/etc/fstab")) return DITEM_SUCCESS; else { msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n" "any CD devices in use before running sysinstall then they may NOT\n" "be found by this run!"); } } devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); return DITEM_FAILURE; } /* Record all the chunks */ nchunks = 0; for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && (c2->subtype == FS_SWAP || c2->private_data)) chunk_list[nchunks++] = c2; } } else if (c1->type == fat && c1->private_data) chunk_list[nchunks++] = c1; } } chunk_list[nchunks] = 0; chunk_sort(); fstab = fopen("/etc/fstab", "w"); if (!fstab) { msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n" "will be required."); return DITEM_FAILURE; } /* Go for the burn */ msgDebug("Generating /etc/fstab file\n"); for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); Mkdir("/proc", NULL); fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs\trw 0 0\n"); /* Now look for the CDROMs */ devs = deviceFind(NULL, DEVICE_TYPE_CDROM); cnt = deviceCount(devs); /* Write the first one out as /cdrom */ if (cnt) { if (Mkdir("/cdrom", NULL)) { msgConfirm("Unable to make mount point for: /cdrom"); } else fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660\tro,noauto 0 0\n", devs[0]->name); } /* Write the others out as /cdrom */ for (i = 1; i < cnt; i++) { char cdname[10]; sprintf(cdname, "/cdrom%d", i); if (Mkdir(cdname, NULL)) { msgConfirm("Unable to make mount point for: %s", cdname); } else fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660\tro,noauto 0 0\n", devs[i]->name, cdname); } fclose(fstab); if (isDebug()) msgDebug("Wrote out /etc/fstab file\n"); return DITEM_SUCCESS; } /* * This sucks in /etc/sysconfig, substitutes anything needing substitution, then * writes it all back out. It's pretty gross and needs re-writing at some point. */ #define MAX_LINES 2000 /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */ void configSysconfig(void) { FILE *fp; char *lines[MAX_LINES], *cp; char line[256]; Variable *v; int i, nlines; fp = fopen("/etc/sysconfig", "r"); if (!fp) { msgConfirm("Unable to open /etc/sysconfig file! Things may work\n" "rather strangely as a result of this."); return; } msgNotify("Writing configuration changes to /etc/sysconfig file.."); nlines = 0; /* Read in the entire file */ for (i = 0; i < MAX_LINES; i++) { if (!fgets(line, 255, fp)) break; lines[nlines++] = strdup(line); } msgDebug("Read %d lines from sysconfig.\n", nlines); /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { for (i = 0; i < nlines; i++) { char tmp[256]; /* Skip the comments */ if (lines[i][0] == '#') continue; strcpy(tmp, lines[i]); cp = index(tmp, '='); if (!cp) continue; *(cp++) = '\0'; if (!strcmp(tmp, v->name)) { free(lines[i]); lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + 5); sprintf(lines[i], "%s=\"%s\"\n", v->name, v->value); msgDebug("Variable substitution on: %s\n", lines[i]); } } } /* Now write it all back out again */ fclose(fp); if (Fake) { msgDebug("Writing sysconfig out to debugging screen..\n"); fp = fdopen(DebugFD, "w"); } else fp = fopen("/etc/sysconfig", "w"); for (i = 0; i < nlines; i++) { static Boolean firstTime = TRUE; fprintf(fp, lines[i]); /* Stand by for bogus special case handling - we try to dump the interface specs here */ if (firstTime && !strncmp(lines[i], VAR_INTERFACES, strlen(VAR_INTERFACES))) { Device **devp; int j, cnt; devp = deviceFind(NULL, DEVICE_TYPE_NETWORK); cnt = deviceCount(devp); for (j = 0; j < cnt; j++) { char iname[255]; snprintf(iname, 255, "%s%s", VAR_IFCONFIG, devp[j]->name); if ((cp = variable_get(iname))) { fprintf(fp, "%s=\"%s\"\n", iname, cp); } } firstTime = FALSE; } free(lines[i]); } fclose(fp); } int configSaverTimeout(dialogMenuItem *self) { return variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") ? DITEM_SUCCESS : DITEM_FAILURE; } int configNTP(dialogMenuItem *self) { return variable_get_value(VAR_NTPDATE, "Enter the name of an NTP server") ? DITEM_SUCCESS : DITEM_FAILURE; } int configXFree86(dialogMenuItem *self) { if (file_executable("/usr/X11R6/bin/xf86config")) { dialog_clear(); systemExecute("/usr/X11R6/bin/xf86config"); return DITEM_SUCCESS | DITEM_RESTORE; } else { msgConfirm("XFree86 does not appear to be installed! Please install\n" "The XFree86 distribution before attempting to configure it."); return DITEM_FAILURE; } } void configResolv(void) { FILE *fp; char *cp, *dp, *hp; 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", NULL)) { msgConfirm("Unable to create /etc directory. Network configuration\n" "files will therefore not be written!"); return; } fp = fopen("/etc/resolv.conf", "w"); if (!fp) { msgConfirm("Unable to open /etc/resolv.conf! You will need to do this manually."); return; } 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)); fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/resolv.conf\n"); skip: /* Tack ourselves into /etc/hosts */ cp = variable_get(VAR_IPADDR); dp = variable_get(VAR_DOMAINNAME); if (cp && *cp != '0' && (hp = variable_get(VAR_HOSTNAME))) { 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); fclose(fp); if (isDebug()) msgDebug("Wrote entry for %s to /etc/hosts\n", cp); } } int configRoutedFlags(dialogMenuItem *self) { 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; } int configPackages(dialogMenuItem *self) { static PkgNode top, plist; static Boolean index_initted = FALSE; PkgNodePtr tmp; int fd; if (!mediaVerify()) return DITEM_FAILURE; if (!mediaDevice->init(mediaDevice)) return DITEM_FAILURE; if (!index_initted) { msgNotify("Attempting to fetch packages/INDEX file from selected media."); fd = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE); if (fd < 0) { + dialog_clear(); 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" "without the packages collection mirrored). Please verify media\n" "(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); if (index_read(fd, &top)) { 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; } mediaDevice->close(mediaDevice, fd); index_sort(&top); index_initted = TRUE; } while (1) { int ret, pos, scroll; /* Bring up the packages menu */ pos = scroll = 0; index_menu(&top, &plist, &pos, &scroll); if (plist.kids && plist.kids->name) { /* Now show the packing list menu */ pos = scroll = 0; ret = index_menu(&plist, NULL, &pos, &scroll); if (ret & DITEM_LEAVE_MENU) break; else if (DITEM_STATUS(ret) != DITEM_FAILURE) { index_extract(mediaDevice, &top, &plist); break; } } else { msgConfirm("No packages were selected for extraction."); break; } } tmp = plist.kids; while (tmp) { PkgNodePtr tmp2 = tmp->next; safe_free(tmp); tmp = tmp2; } index_init(NULL, &plist); return DITEM_SUCCESS; } int configPorts(dialogMenuItem *self) { char *cp, *dist = NULL; /* Shut up compiler */ if (!variable_get(VAR_PORTS_PATH)) variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports"); while (!directory_exists(dist)) { dist = variable_get_value(VAR_PORTS_PATH, "Unable to locate a ports tree on CDROM. Please specify the\n" "location of the master ports directory you wish to create the\n" "link tree to."); if (!dist) break; } if (dist) { 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) return DITEM_FAILURE; if (Mkdir(cp, NULL)) return DITEM_FAILURE; else { 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); return DITEM_FAILURE; } 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."); } } } else return DITEM_FAILURE; return DITEM_SUCCESS; } /* Load gated package */ int configGated(dialogMenuItem *self) { int ret; ret = package_add("gated-3.5a11"); if (DITEM_STATUS(ret) == DITEM_SUCCESS) variable_set2("gated", "YES"); return ret; } /* Load pcnfsd package */ int configPCNFSD(dialogMenuItem *self) { int ret; ret = package_add("pcnfsd-93.02.16"); if (DITEM_STATUS(ret) == DITEM_SUCCESS) variable_set2("pcnfsd", "YES"); return ret; } int configNFSServer(dialogMenuItem *self) { char cmd[256]; /* If we're an NFS server, we need an exports file */ if (!file_readable("/etc/exports")) { WINDOW *w = savescr(); 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" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, finally, /a to 2 privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); vsystem("echo '#/home -alldirs janice jimmy frank' >> /etc/exports"); vsystem("echo '#/a -maproot=0 bill albert' >> /etc/exports"); vsystem("echo '#' >> /etc/exports"); vsystem("echo '# You should replace these lines with your actual exported filesystems.' >> /etc/exports"); vsystem("echo >> /etc/exports"); sprintf(cmd, "%s /etc/exports", variable_get(VAR_EDITOR)); dialog_clear(); systemExecute(cmd); restorescr(w); } variable_set2("nfs_server", "YES"); return DITEM_SUCCESS; } Index: stable/2.1/release/sysinstall/dist.c =================================================================== --- stable/2.1/release/sysinstall/dist.c (revision 15974) +++ stable/2.1/release/sysinstall/dist.c (revision 15975) @@ -1,529 +1,537 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.53 1996/05/23 16:34:25 jkh Exp $ + * $Id: dist.c,v 1.36.2.30 1996/05/24 06:08:26 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * 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 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS 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) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include #include "sysinstall.h" unsigned int Dists; unsigned int DESDists; unsigned int SrcDists; unsigned int XF86Dists; unsigned int XF86ServerDists; unsigned int XF86FontDists; typedef struct _dist { char *my_name; char *my_dir; unsigned int *my_mask; unsigned int my_bit; struct _dist *my_dist; } Distribution; extern Distribution DistTable[]; extern Distribution DESDistTable[]; extern Distribution SrcDistTable[]; extern Distribution XF86DistTable[]; extern Distribution XF86FontDistTable[]; extern Distribution XF86ServerDistTable[]; /* The top-level distribution categories */ static Distribution DistTable[] = { { "bin", "/", &Dists, DIST_BIN, NULL }, { "doc", "/", &Dists, DIST_DOC, NULL }, { "games", "/", &Dists, DIST_GAMES, NULL }, { "manpages", "/", &Dists, DIST_MANPAGES, NULL }, { "proflibs", "/", &Dists, DIST_PROFLIBS, NULL }, { "dict", "/", &Dists, DIST_DICT, NULL }, { "info", "/", &Dists, DIST_INFO, NULL }, { "src", "/", &Dists, DIST_SRC, SrcDistTable }, { "des", "/", &Dists, DIST_DES, DESDistTable }, { "compat1x", "/", &Dists, DIST_COMPAT1X, NULL }, { "compat20", "/", &Dists, DIST_COMPAT20, NULL }, { "compat21", "/", &Dists, DIST_COMPAT21, NULL }, { "commerce", "/usr/local", &Dists, DIST_COMMERCIAL, NULL }, { "xperimnt", "/usr/local", &Dists, DIST_EXPERIMENTAL, NULL }, { "XF86312", "/usr", &Dists, DIST_XF86, XF86DistTable }, { NULL }, }; /* The DES distribution (not for export!) */ static Distribution DESDistTable[] = { { "des", "/", &DESDists, DIST_DES_DES, NULL }, { "krb", "/", &DESDists, DIST_DES_KERBEROS, NULL }, { "ssecure", "/usr/src", &DESDists, DIST_DES_SSECURE, NULL }, { "sebones", "/usr/src", &DESDists, DIST_DES_SEBONES, NULL }, { NULL }, }; /* The /usr/src distribution */ static Distribution SrcDistTable[] = { { "sbase", "/usr/src", &SrcDists, DIST_SRC_BASE, 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 }, { "sinclude", "/usr/src", &SrcDists, DIST_SRC_INCLUDE, NULL }, { "slib", "/usr/src", &SrcDists, DIST_SRC_LIB, NULL }, { "slibexec", "/usr/src", &SrcDists, DIST_SRC_LIBEXEC, NULL }, { "slkm", "/usr/src", &SrcDists, DIST_SRC_LKM, NULL }, { "srelease", "/usr/src", &SrcDists, DIST_SRC_RELEASE, NULL }, { "sbin", "/usr/src", &SrcDists, DIST_SRC_BIN, NULL }, { "ssbin", "/usr/src", &SrcDists, DIST_SRC_SBIN, NULL }, { "sshare", "/usr/src", &SrcDists, DIST_SRC_SHARE, NULL }, { "ssys", "/usr/src", &SrcDists, DIST_SRC_SYS, NULL }, { "subin", "/usr/src", &SrcDists, DIST_SRC_UBIN, NULL }, { "susbin", "/usr/src", &SrcDists, DIST_SRC_USBIN, NULL }, { "ssmailcf", "/usr/src", &SrcDists, DIST_SRC_SMAILCF, NULL }, { NULL }, }; /* The XFree86 distribution */ static Distribution XF86DistTable[] = { { "X312bin", "/usr", &XF86Dists, DIST_XF86_BIN, NULL }, { "X312lib", "/usr", &XF86Dists, DIST_XF86_LIB, NULL }, { "X312doc", "/usr", &XF86Dists, DIST_XF86_DOC, NULL }, { "X312etc", "/usr", &XF86Dists, DIST_XF86_ETC, NULL }, { "XF86312", "/usr", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable }, { "X312man", "/usr", &XF86Dists, DIST_XF86_MAN, NULL }, { "X312ctrb", "/usr", &XF86Dists, DIST_XF86_CTRB, NULL }, { "X312prog", "/usr", &XF86Dists, DIST_XF86_PROG, NULL }, { "X312link", "/usr", &XF86Dists, DIST_XF86_LINK, NULL }, { "X312pex", "/usr", &XF86Dists, DIST_XF86_PEX, NULL }, { "X312lbx", "/usr", &XF86Dists, DIST_XF86_LBX, NULL }, { "X312ubin", "/usr", &XF86Dists, DIST_XF86_UBIN, NULL }, { "X312xicf", "/usr", &XF86Dists, DIST_XF86_XINIT, NULL }, { "X312xdcf", "/usr", &XF86Dists, DIST_XF86_XDMCF, NULL }, { "XF86312", "/usr", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable }, { "XF86-xc", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL }, { "XF86-co", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL }, { NULL }, }; /* The XFree86 server distribution */ static Distribution XF86ServerDistTable[] = { { "X3128514", "/usr", &XF86ServerDists, DIST_XF86_SERVER_8514, NULL }, { "X312AGX", "/usr", &XF86ServerDists, DIST_XF86_SERVER_AGX, NULL }, { "X312Ma8", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH8, NULL }, { "X312Ma32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH32,NULL }, { "X312Ma64", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH64,NULL }, { "X312Mono", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MONO, NULL }, { "X312P9K", "/usr", &XF86ServerDists, DIST_XF86_SERVER_P9000, NULL }, { "X312S3", "/usr", &XF86ServerDists, DIST_XF86_SERVER_S3, NULL }, { "X312SVGA", "/usr", &XF86ServerDists, DIST_XF86_SERVER_SVGA, NULL }, { "X312VG16", "/usr", &XF86ServerDists, DIST_XF86_SERVER_VGA16, NULL }, { "X312W32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_W32, NULL }, { "X312nest", "/usr", &XF86ServerDists, DIST_XF86_SERVER_NEST, NULL }, { NULL }, }; /* The XFree86 font distribution */ static Distribution XF86FontDistTable[] = { { "X312fnts", "/usr", &XF86FontDists, DIST_XF86_FONTS_MISC, NULL }, { "X312f100", "/usr", &XF86FontDists, DIST_XF86_FONTS_100, NULL }, { "X312fcyr", "/usr", &XF86FontDists, DIST_XF86_FONTS_CYR, NULL }, { "X312fscl", "/usr", &XF86FontDists, DIST_XF86_FONTS_SCALE, NULL }, { "X312fnon", "/usr", &XF86FontDists, DIST_XF86_FONTS_NON, NULL }, { "X312fsrv", "/usr", &XF86FontDists, DIST_XF86_FONTS_SERVER, NULL }, { NULL }, }; int distReset(dialogMenuItem *self) { Dists = 0; DESDists = 0; SrcDists = 0; XF86Dists = 0; XF86ServerDists = 0; XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } int distSetDeveloper(dialogMenuItem *self) { distReset(NULL); Dists = _DIST_DEVELOPER; SrcDists = DIST_SRC_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } int distSetXDeveloper(dialogMenuItem *self) { distReset(NULL); Dists = _DIST_DEVELOPER; SrcDists = DIST_SRC_ALL; XF86Dists = DIST_XF86_BIN | DIST_XF86_LIB | DIST_XF86_PROG | DIST_XF86_MAN | DIST_XF86_SERVER | DIST_XF86_FONTS; XF86ServerDists = DIST_XF86_SERVER_SVGA; XF86FontDists = DIST_XF86_FONTS_MISC; return distSetXF86(NULL); } int distSetKernDeveloper(dialogMenuItem *self) { distReset(NULL); Dists = _DIST_DEVELOPER; SrcDists = DIST_SRC_SYS; return DITEM_SUCCESS | DITEM_REDRAW; } int distSetUser(dialogMenuItem *self) { distReset(NULL); Dists = _DIST_USER; return DITEM_SUCCESS | DITEM_REDRAW; } int distSetXUser(dialogMenuItem *self) { distReset(NULL); Dists = _DIST_USER; XF86Dists = DIST_XF86_BIN | DIST_XF86_LIB | DIST_XF86_MAN | DIST_XF86_SERVER | DIST_XF86_FONTS; XF86ServerDists = DIST_XF86_SERVER_SVGA; XF86FontDists = DIST_XF86_FONTS_MISC; return distSetXF86(NULL); } int distSetMinimum(dialogMenuItem *self) { distReset(NULL); Dists = DIST_BIN; return DITEM_SUCCESS | DITEM_REDRAW; } int distSetEverything(dialogMenuItem *self) { Dists = DIST_ALL; SrcDists = DIST_SRC_ALL; XF86Dists = DIST_XF86_ALL; XF86ServerDists = DIST_XF86_SERVER_ALL; XF86FontDists = DIST_XF86_FONTS_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } int distSetDES(dialogMenuItem *self) { int i = DITEM_SUCCESS; if (dmenuOpenSimple(&MenuDESDistributions)) { if (DESDists) { if (DESDists & DIST_DES_KERBEROS) DESDists |= DIST_DES_DES; Dists |= DIST_DES; msgDebug("SetDES Masks: DES: %0x, Dists: %0x\n", DESDists, Dists); } } else i = DITEM_FAILURE; return i | DITEM_RECREATE | DITEM_RESTORE; } int distSetSrc(dialogMenuItem *self) { int i = DITEM_SUCCESS; if (dmenuOpenSimple(&MenuSrcDistributions)) { if (SrcDists) { Dists |= DIST_SRC; msgDebug("SetSrc Masks: Srcs: %0x, Dists: %0x\n", SrcDists, Dists); } } else i = DITEM_FAILURE; return i | DITEM_RECREATE | DITEM_RESTORE; } int distSetXF86(dialogMenuItem *self) { int i = DITEM_SUCCESS; if (dmenuOpenSimple(&MenuXF86Select)) { if (XF86ServerDists) XF86Dists |= DIST_XF86_SERVER; if (XF86FontDists) XF86Dists |= DIST_XF86_FONTS; if (XF86Dists) Dists |= DIST_XF86; msgDebug("SetXF86 Masks: Server: %0x, Fonts: %0x, XDists: %0x, Dists: %0x\n", XF86ServerDists, XF86FontDists, XF86Dists, Dists); } else i = DITEM_FAILURE; return i | DITEM_RECREATE | DITEM_RESTORE; } static Boolean distExtract(char *parent, Distribution *me) { int i, status, total; int cpid, zpid, fd, fd2, chunk, numchunks; char *path, *dist, buf[10240]; const char *tmp; Attribs *dist_attr; WINDOW *w = savescr(); struct timeval start, stop; status = TRUE; dialog_clear(); if (isDebug()) msgDebug("distExtract: parent: %s, me: %s\n", parent ? parent : "(none)", me->my_name); /* Loop through to see if we're in our parent's plans */ for (i = 0; me[i].my_name; i++) { dist = me[i].my_name; path = parent ? parent : dist; /* If our bit isn't set, go to the next */ if (!(me[i].my_bit & *(me[i].my_mask))) continue; /* This is shorthand for "dist currently disabled" */ if (!me[i].my_dir) { *(me[i].my_mask) &= ~(me[i].my_bit); continue; } /* Recurse if we actually have a sub-distribution */ if (me[i].my_dist) { if ((status = distExtract(dist, me[i].my_dist)) == TRUE) *(me[i].my_mask) &= ~(me[i].my_bit); goto done; } /* First try to get the distribution as a single file */ snprintf(buf, 512, "%s/%s.tgz", path, dist); if (isDebug()) msgDebug("Trying to get large piece: %s\n", buf); /* * 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) { msgNotify("Extracting %s into %s directory...", me[i].my_name, me[i].my_dir); status = mediaExtractDist(me[i].my_dir, fd); mediaDevice->close(mediaDevice, fd); goto done; } else if (fd == -2) { /* 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. */ dist_attr = NULL; numchunks = 0; - snprintf(buf, sizeof buf, "/stand/info/%s/%s.inf", path, dist); - if (file_readable(buf)) { + snprintf(buf, sizeof buf, "%s/%s.inf", path, dist); + fd = mediaDevice->get(mediaDevice, buf, TRUE); + if (fd >= 0) { if (isDebug()) msgDebug("Parsing attributes file for distribution %s\n", dist); dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS); - if (DITEM_STATUS(attr_parse_file(dist_attr, buf)) == DITEM_FAILURE) + if (DITEM_STATUS(attr_parse(dist_attr, fd)) == DITEM_FAILURE) msgConfirm("Cannot load information file for %s distribution!\n" "Please verify that your media is valid and try again.", dist); else { if (isDebug()) msgDebug("Looking for attribute `pieces'\n"); tmp = attr_match(dist_attr, "pieces"); if (tmp) numchunks = strtol(tmp, 0, 0); } safe_free(dist_attr); + mediaDevice->close(mediaDevice, fd); } - + else if (fd == -2) { /* Hard error, can't continue */ + mediaDevice->shutdown(mediaDevice); + status = FALSE; + goto done; + } if (!numchunks) continue; if (isDebug()) msgDebug("Attempting to extract distribution from %u chunks.\n", numchunks); /* We have one or more chunks, go pick them up */ mediaExtractDistBegin(me[i].my_dir, &fd2, &zpid, &cpid); total = 0; (void)gettimeofday(&start, (struct timezone *)0); for (chunk = 0; chunk < numchunks; chunk++) { int n, retval; char prompt[80]; 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); fd = mediaDevice->get(mediaDevice, buf, FALSE); if (fd < 0) { msgConfirm("failed to retreive piece file %s!\n" "Aborting the transfer", buf); goto punt; } snprintf(prompt, 80, "Extracting %s into %s directory...", me[i].my_name, me[i].my_dir); dialog_gauge("Progress", prompt, 8, 15, 6, 50, (int)((float)(chunk + 1) / numchunks * 100)); while (1) { int seconds; n = read(fd, buf, sizeof buf); if (n <= 0) break; total += n; /* Print statistics about how we're doing */ (void) gettimeofday(&stop, (struct timezone *)0); stop.tv_sec = stop.tv_sec - start.tv_sec; stop.tv_usec = stop.tv_usec - start.tv_usec; if (stop.tv_usec < 0) stop.tv_sec--, stop.tv_usec += 1000000; seconds = stop.tv_sec + (stop.tv_usec / 1000000.0); if (!seconds) seconds = 1; - msgInfo("%d bytes read from distribution chunk %d of %d, %d KBytes/second", + msgInfo("%d bytes read from distribution, chunk %d of %d, %d KBytes/second", total, chunk + 1, numchunks, (total / seconds) / 1024); retval = write(fd2, buf, n); if (retval != n) { mediaDevice->close(mediaDevice, fd); dialog_clear(); msgConfirm("Write failure on transfer! (wrote %d bytes of %d bytes)", retval, n); goto punt; } } mediaDevice->close(mediaDevice, fd); } close(fd2); status = mediaExtractDistEnd(zpid, cpid); goto done; punt: close(fd2); mediaExtractDistEnd(zpid, cpid); status = FALSE; done: if (!status) { if (variable_get(VAR_NO_CONFIRM)) status = TRUE; else { if (me[i].my_dist) { msgConfirm("Unable to transfer all components of the %s distribution.\n" "If this is a CDROM install, it may be because export restrictions prohibit\n" "DES code from being shipped from the U.S. Try to get this code from a\n" "local FTP site instead!", me[i].my_name); status = TRUE; } else { status = msgYesNo("Unable to transfer the %s distribution from %s.\n" "Do you want to try to retrieve it again?", me[i].my_name, mediaDevice->name); } } } /* Extract was successful, remove ourselves from further consideration */ if (status) *(me[i].my_mask) &= ~(me[i].my_bit); } restorescr(w); return status; } static void -printSelected(char *buf, int selected, Distribution *me) +printSelected(char *buf, int selected, Distribution *me, int *col) { int i; - static int col = 0; /* Loop through to see if we're in our parent's plans */ for (i = 0; me[i].my_name; i++) { /* If our bit isn't set, go to the next */ if (!(me[i].my_bit & selected)) continue; /* This is shorthand for "dist currently disabled" */ if (!me[i].my_dir) continue; - col += strlen(me[i].my_name); - if (col > 50) { - col = 0; + *col += strlen(me[i].my_name); + if (*col > 50) { + *col = 0; strcat(buf, "\n"); } sprintf(&buf[strlen(buf)], " %s", me[i].my_name); /* Recurse if have a sub-distribution */ if (me[i].my_dist) - printSelected(buf, *(me[i].my_mask), me[i].my_dist); + printSelected(buf, *(me[i].my_mask), me[i].my_dist, col); } } int distExtractAll(dialogMenuItem *self) { int retries = 0; char buf[512]; /* First try to initialize the state of things */ if (!Dists) { msgConfirm("You haven't selected any distributions to extract."); return DITEM_FAILURE; } if (!mediaVerify()) return DITEM_FAILURE; if (!mediaDevice->init(mediaDevice)) return DITEM_FAILURE; dialog_clear(); msgNotify("Attempting to install all selected distributions.."); /* Try for 3 times around the loop, then give up. */ while (Dists && ++retries < 3) distExtract(NULL, DistTable); if (Dists) { - printSelected(buf, Dists, DistTable); + int col = 0; + + buf[0] = '\0'; + printSelected(buf, Dists, DistTable, &col); dialog_clear(); 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); } return DITEM_SUCCESS; } Index: stable/2.1/release/sysinstall/help/install.hlp =================================================================== --- stable/2.1/release/sysinstall/help/install.hlp (revision 15974) +++ stable/2.1/release/sysinstall/help/install.hlp (revision 15975) @@ -1,587 +1,571 @@ QUICK INSTALLATION GUIDE FOR FREEBSD 2.2 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. Table of Contents: ================== 1.0 DOS User's Q&A section. 1.1 How do I make space for FreeBSD? 1.2 Can I use compressed DOS filesystems from FreeBSD? 1.3 Can I use DOS extended partitions? 1.4 Can I run DOS executables under FreeBSD? 2.0 Preparing for the installation. 2.1 Before installing from CDROM 2.2 Before installing from Floppy 2.3 Before installing from a DOS partition 2.4 Before installing from QIC/SCSI tape 2.5 Before installing over a network 2.5.1 Preparing for NFS Installation 2.5.2 Preparing for FTP Installation 3.0 Installing FreeBSD. 3.1 Repairing an existing FreeBSD installation. 3.2 Upgrading from FreeBSD 2.1 1.0 DOS user's Question and Answer section === ====================================== 1.1 Help! I have no space! Do I need to delete everything first? If your machine is already running DOS and has little or no free space available for FreeBSD's installation, all is not lost! You may find the "FIPS" utility, provided in the tools/ subdirectory on the FreeBSD CDROM or on the various FreeBSD ftp sites, to be quite useful. FIPS allows you to split an existing DOS partition into two pieces, preserving the original partition and allowing you to install onto the second free piece. You first "defrag" your DOS partition, using the DOS 6.xx "DEFRAG" utility or the Norton Disk tools, then run FIPS. It will prompt you for the rest of the information it needs. Afterwards, you can reboot and install FreeBSD on the new partition. Also note that FIPS will create the second partition as a "clone" of the first, so you'll actually see that you now have two DOS Primary partitions where you formerly had one. Don't be alarmed! You can simply delete the extra DOS Primary parititon (making sure it's the right one by examining its size! :) See the Distributions menu for an estimation of how much free space you'll need for the kind of installation you want. 1.2 Can I use compressed DOS filesystems from FreeBSD? No. If you are using a utility such as Stacker(tm) or DoubleSpace(tm), FreeBSD will only be able to use whatever portion of the filesystem you leave uncompressed. The rest of the filesystem will show up as one large file (the stacked/dblspaced file!). DO NOT REMOVE THAT FILE as you will probably regret it greatly! It is probably better to create another uncompressed DOS primary partition and use this for communications between DOS and FreeBSD if such is your desire. 1.3 Can I mount my DOS extended partitions? Yes. DOS extended partitions are mapped in at the end of the other ``slices'' in FreeBSD, e.g. your D: drive might be /dev/sd0s5, your E: drive /dev/sd0s6, and so on. This example assumes, of course, that your extended partition is on SCSI drive 0. For IDE drives, substitute ``wd'' for ``sd'' appropriately. You otherwise mount extended partitions exactly like you would mount any other DOS drive, e.g.: mount -t msdos /dev/sd0s5 /dos_d 1.4 Can I run DOS binaries under FreeBSD? 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. Send mail to hackers@freebsd.org if you're interested in joining this effort! 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. 2.0 Preparing for the installation === ============================== 2.1 Before installing from CDROM: If your CDROM is of an unsupported type, then please skip to section 2.3 which describes how to install from a DOS partition. There is not a lot of preparatory work that needs to be done to successfully install from one of Walnut Creek's FreeBSD CDROMs (other CDROM distributions may work as well, though we cannot say for certain as we have no hand or say in how they're created). You can either boot into the CD installation directly from DOS using Walnut Creek's supplied ``install.bat'' batch file or you can make a boot floppy with the ``makeflp.bat'' command [NOTE: If you're using an IDE CDROM, use the inst_ide.bat or atapiflp.bat batch files instead]. For the easiest interface of all (from DOS), type "view". This will bring up a DOS menu utility that leads you through all the available options. If you're creating the boot floppy from a UNIX machine, you may find 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. 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. 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! 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 as the installation media). Finally, if you would like people to be able to FTP install FreeBSD directly from the CDROM in your machine, you'll find it quite easy. After the machine is fully installed, you simply need to add the following line to the password file (using the vipw command): ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent Anyone else at your site will now be able to chose a Media type of FTP and type in: ftp:// after picking "Other" in the ftp sites menu to install from the CD in your machine! 2.2 Before installing from Floppy: If you must install from floppy disks, either due to unsupported hardware or just because you enjoy doing things the hard way, you must first prepare some floppies for the install. -The first floppy you'll need in addition to the boot.flp image is -``floppies/root.flp'', which is somewhat special in that it's not a -DOS filesystem floppy at all, but rather a floppy "image" (it's -actually a gzip'd cpio file). You can create this floppy in the same -way that you created the boot floppy (see notes in section 2.1). Once -this floppy is made, you can go on to make the distribution set -floppies using ordinary DOS or UFS (if you're preparing the floppies -on another FreeBSD machine) formatted diskettes. - You will need, at minimum, as many 1.44MB or 1.2MB floppies as it takes to hold all files in the bin (binary distribution) directory. If you're preparing these floppies under DOS, then THESE floppies *must* be formatted using the MS-DOS FORMAT command. If you're using Windows, use the Windows File Manager format command. Don't trust Factory Preformatted floppies! Format them again yourself, just to make sure! Many problems reported by our users in the past have resulted from the use of improperly formatted media, which is why I'm taking such special care to mention it here! If you're creating the floppies from another FreeBSD machine, a format is still not a bad idea though you don't need to put a DOS filesystem on each floppy. You can use the `disklabel' and `newfs' commands to put a UFS filesystem on a floppy, as the following sequence of commands (for a 3.5" 1.44MB floppy disk) illustrates: fdformat -f 1440 fd0.1440 disklabel -w -r fd0.1440 floppy3 newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0 (Use "fd0.1200" and "floppy5" for 5.25" 1.2MB disks). After you've formatted the floppies for DOS or UFS, you'll need to copy the files onto them. The distribution files are split into chunks conveniently sized so that 5 of them will fit on a conventional 1.44MB floppy. Go through all your floppies, packing as many files as will fit on each one, until you've got all the distributions you want packed up in this fashion. Each distribution should go into its own subdirectory on the floppy, e.g.: a:\bin\bin.aa, a:\bin\bin.ab, ... Once you come to the Media screen of the install, select "Floppy" and you'll be prompted for the rest. 2.3 Before installing from a DOS partition: To prepare for installation from an MS-DOS partition you should simply copy the files from the distribution into a directory called "FREEBSD". For example, to do a minimal installation of FreeBSD from DOS using files copied from the CDROM, you might do something like this: C> MD C:\FREEBSD C> XCOPY /S E:\DISTS\BIN C:\FREEBSD\BIN - C> XCOPY /S E:\FLOPPIES C:\FREEBSD\FLOPPIES Asssuming that `C:' was where you had free space and `E:' was where -your CD was mounted. Note that you need the FLOPPIES directory -because the `root.flp' image is automatically looked for there when -you're doing a DOS installation. +your CD was mounted. For as many `DISTS' as you wish to install from DOS (and you have free space for), install each one in a directory under `C:\FREEBSD' - the BIN dist is only the minimal requirement. 2.4 Before installing from QIC/SCSI Tape: Installing from tape is probably the easiest method, short of an on-line install using FTP or a CDROM. The installation program expects the files to be simply tar'ed onto the tape, so after getting all of the files for the distributions you're interested in, simply tar them onto the tape with a command like: cd /where/you/have/your/dists - tar cvf /dev/rwt0 (or /dev/rst0) floppies dist1 .. dist2 - -It's important to make sure that the `floppies/' directory is -specified along with the dists because the installation will look for -`floppies/root.flp' on the tape. + tar cvf /dev/rwt0 (or /dev/rst0) dist1 .. dist2 When you go to do the installation, you should also make sure that you leave enough room in some temporary directory (which you'll be allowed to choose) to accommodate the FULL contents of the tape you've created. Due to the non-random access nature of tapes, this method of installation requires quite a bit of temporary storage! You should expect to require as much temporary storage as you have stuff written on tape. 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. 2.5 Before installing over a network: You can do network installations over 3 types of connections: Serial port: SLIP / PPP Parallel port: PLIP (using ``laplink'' style cable) Ethernet: A standard ethernet controller (includes some PCMCIA). SLIP support is rather primitive, and is limited primarily to hard-wired links, such as a serial cable running between two computers. The link must be hard-wired because the SLIP installation doesn't currently offer a dialing capability. If you need to dial out with a modem or otherwise dialog with the link before connecting to it, then I recommend that the PPP utility be used instead. If you're using PPP, make sure that you have your Internet Service Provider's IP address and DNS information handy as you'll need to know it fairly early in the installation process. You may also need to know your own IP address, though PPP supports dynamic address negotiation and may be able to pick up this information directly from your ISP if they support it. You will also need to know how to use the various "AT commands" for dialing out with your particular brand of modem as the PPP dialer provides only a very simple terminal emulator. If a hard-wired connection to another FreeBSD (2.0R or later) machine is available, you might also consider installing over a "laplink" style parallel port cable. The data rate over the parallel port is much higher than what is typically possible over a serial line (up to 50k/sec), thus resulting in a quicker installation. Finally, for the fastest possible network installation, an ethernet adaptor is always a good choice! FreeBSD supports most common PC ethernet cards, a table of supported cards (and their required settings) being provided as part of the FreeBSD Hardware Guide (see the Documentation menu on the boot floppy or the top level directory of the CDROM). If you are using one of the supported PCMCIA ethernet cards, also be sure that it's plugged in _before_ the laptop is powered on! FreeBSD does not, unfortunately, currently support "hot insertion" of PCMCIA cards. You will also need to know your IP address on the network, the "netmask" value for your address class and the name of your machine. Your system administrator can tell you which values are appropriate to your particular network setup. If you will be referring to other hosts by name rather than IP address, you'll also need a name server and possibly the address of a gateway (if you're using PPP, it's your provider's IP address) to use in talking to it. If you do not know the answers to these questions then you should really probably talk to your system administrator _first_ before trying this type of installation! Using a randomly chosen IP address or netmask on a live network will almost certainly get you shot. Once you have a network connection of some sort working, the installation can continue over NFS or FTP. 2.5.1 Preparing for NFS installation: NFS installation is fairly straight-forward: Simply copy the FreeBSD distribution files you want onto a server somewhere and then point the NFS media selection at it. If this server supports only "privileged port" access (as is generally the default for Sun and Linux workstations), you will need to set this option in the Options menu before installation can proceed. If you have a poor quality ethernet card which suffers from very slow transfer rates, you may also wish to toggle the appropriate Options flag. In order for NFS installation to work, the server must also support "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. In FreeBSD's /etc/exports file this is controlled by the ``-alldirs'' option. Other NFS servers may have different conventions. If you are getting `Permission Denied' messages from the server then it's likely that you don't have this properly enabled! 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. A full menu of reasonable choices for almost any location in the world is provided in the FTP site menu. If you are installing from some other FTP site not listed in this menu, or you are having troubles getting your name server configured properly, you can also specify your own URL by selecting the ``Other'' choice in that menu. A URL can 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.0-RELEASE There are two FTP installation modes you can use: o FTP: For all FTP transfers, use the standard "Active" mode for transfers. This will not work through most firewalls but will often work best with older ftp servers that do not support passive mode. If your connection hangs with passive mode, try this one! o FTP Passive: For all FTP transfers, use "Passive" mode. This allows the user to pass through firewalls that do not allow incoming connections on random port addresses. NOTE: ACTIVE AND PASSIVE MODES ARE NOT THE SAME AS A `PROXY' CONNECTIONS, WHERE A PROXY FTP SERVER IS LISTENING ON A DIFFERENT PORT! In such instances, you should specify the URL as something like: ftp://foo.bar.com:1234/pub/FreeBSD Where "1234" is the port number of the proxy ftp server. 3.0 Installing FreeBSD --- ------------------ Once you've taken note of the appropriate preinstallation steps, you should be able to install FreeBSD without any further trouble. Should the installation fail at some stage, then you may wish to go back and re-read the relevant preparation section (section 2.x) for the installation media type you're trying to use. Perhaps there's a helpful hint there that you missed the first time? If you're having hardware trouble or FreeBSD refuses to boot at all, then read the Hardware Guide again for a list of possible solutions. The FreeBSD boot floppy contains all the on-line documentation you should need to be able to navigate through an installation, and if it doesn't then I'd like to know what you found most confusing so that I can fix it in future releases! It is the objective of the FreeBSD installation program (sysinstall) to be self-documenting enough that painful "step-by-step" guides are no longer necessary. You may also find the following "typical installation sequence" to be useful reading: o Boot the boot floppy. After a boot sequence which can take anywhere from from 30 seconds to 3 minutes, depending on the speed of your hardware, you should be presented with a menu of initial choices. If the floppy doesn't boot at all, or the boot hangs at some stage, go read the Q&A section of the Hardware Guide for some possible causes. o Press F1. You should see some basic usage instructions on the menu system and general navigation within it. If you haven't used this installation system before then PLEASE read this thoroughly! o Select the Novice installation and follow the instructions. Even if you're moderately familiar with UNIX, chose the Novice install! "Novice" in this context means new to the FreeBSD installer, not computers in general! The other installation types (Custom and Express) assume that you've installed FreeBSD using *this* version of the installation utility and know *exactly* what you are doing! Novice users and 25 year veterans of UNIX alike can benefit from the tips provided by the Novice install, so don't be proud - be a novice! :) Installation type overview: o Custom installation: You can do anything you like in this menu without altering your system _except_ for "Commit", which will perform any pending actions you may have selected. Some of the menu options will also have direct `Write' commands available for commiting an operation immediately, but they should only be used if you're *absolutely sure* it's necessary. It's generally safer to stack up your changes and then commit them all at once so that you're left with the option of changing your mind up to the very last moment. In particular, the (W)rite options in the fdisk and label screens WILL NOT WORK for a new installation! They're meant for tweaking *existing* installations, not doing new ones. Use the final commit option as there is no advantage whatsoever to be gained in writing the information out stage by stage in a new installation. If you're confused at any point, the F1 key will pull up what is hopefully some helpful information for the screen you're in. o Express installation: This installation will invoke all the appropriate steps in order as if you'd selected them one by one from the custom installation menu. It assumes that you *know what you are doing* and have run the installation at least once before. If this is not the case, the Novice installation method is recommended. o Novice installation: As previously mentioned, the Novice installation leads you through the required stages in the proper order and presents you with various helpful prompts in between. Once the system is installed, it will also present you with the opportunity to perform a variety of "post install" actions. A quick synopsis of the stages involved in a novice installation follows: o The first step is the `Partition Editor', which allows you to chose how your drives will be used for FreeBSD. If you're dedicating an entire drive to FreeBSD, the `A' command is probably all you need to type here, otherwise move to a partition marked `Unused' (or delete an existing one) and use the `C' command to create a FreeBSD partition in its place. o Next, with the `Label Editor', you can specify how the space in any FreeBSD partitions should be used by FreeBSD. You can also mount any non-FreeBSD partitions (such as DOS) in this screen. If you want the standard layout, simply type `A' for the defaults. o Next, the `Distributions' menu allows you to specify how much of FreeBSD you'd like to load. A good choice is the "User" distribution for a small system or the "Developer" distribution for someone wanting a more programmer-oriented configuration. If none of the existing collections seem applicable, select Custom to choose the component distributions yourself. o Next, the `Media' menu allows you to specify what kind of media you wish to install from. If a given media type requires extra information, such as networking information for an FTP or NFS install, it will also be asked for at this point. o Finally, you'll be prompted to commit all of these actions at once (nothing has been written to your disk so far, nor will it until you give the final confirmation). All new or changed partition information will be written out, file systems will be created and/or non-destructively labelled (depending on how you set their newfs flags in the Label Editor) and all selected distributions will be extracted. o After the system is fully installed, you'll then have the option to configure the system in various ways, install a WEB server, etc. At this point, you're generally done with the sysinstall utility and can reboot the system. If you elected to install the boot manager, you should now see a small boot menu with an `F?' prompt. Press the function key corresponding to the BSD partition and you should boot up into FreeBSD off the hard disk. If this fails to happen for some reason, see the Q & A section of the Hardware Guide for possible clues! The most likely problem is a mis-matched disk geometry, which will have to be corrected with a second pass through the install, using the (G) command in the fdisk menu to properly set the geometry the next time. Should you wish to re-enter this installation later, you will find it under /stand/sysinstall on the installed system. Good luck! If you really get stuck, you may send mail to our support mailing list - questions@FreeBSD.org. We'll do our best to help you! 3.1 Repairing an existing FreeBSD installation. --- ------------------------------------------- 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. To invoke fixit, simply boot the boot floppy, chose the "Fixit" item and insert the fixit floppy when asked. You will then be placed into a shell with a wide variety of commands available (in the /stand and /mnt2/stand directories) for checking, repairing and examining file systems and their contents. Some UNIX administration experience *is* required to use the fixit option! 3.2 Upgrading from FreeBSD 2.1 --- ---------------------------- It must first be said that this upgrade DOES NOT take a particularly sophisticated approach to the upgrade problem, it being more a question of providing what seemed "good enough" at the time. A truly polished upgrade that deals properly with the broad spectrum of installed 2.1 systems would be nice to have, but until that gets written what you get is this - the brute-force approach! What this upgrade will attempt to do is best summarized thusly: 1. fsck and mount all file systems chosen in the label editor. 2. Ask for a location to preserve your /etc directory into and do so. 3. Extract all selected distributions on top of your existing system. 4. Copy certain obvious files back from the preserved /etc, leaving the rest of the /etc file merge up to the user. 5. Drop user in a shell so that they may perform that merge before rebooting into the new system. And that's it! This "upgrade" is not going to hold your hand in all major respects, it's simply provided to make one PART of the upgrade easier. IMPORTANT NOTE: What this upgrade procedure may also do, in fact, is completely destroy your system (though much more quickly than you would have been able to destroy it yourself). It is simply impossible to guarantee that this procedure's crude form of upgrade automation will work in all cases and if you do this upgrade without proper BACKUPS for any important data then you really must like living life close to the edge, that's all we can say! NOTE to 2.0 users: We're sorry, but the "slice" changes that were added in FreeBSD 2.0.5 made automated upgrades pretty difficult due to the fact that a complete reinstall is pretty much called for. Things may still *work* after a 2.2 upgrade, but you will also no doubt receive many warnings at boot time about non-aligned slices and such; we really do recommend a fresh installation for 2.0 systems! (But back up your user data first :-). Jordan ---- End of Installation Guide --- Index: stable/2.1/release/sysinstall/install.c =================================================================== --- stable/2.1/release/sysinstall/install.c (revision 15974) +++ stable/2.1/release/sysinstall/install.c (revision 15975) @@ -1,915 +1,849 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.97 1996/05/16 11:47:30 jkh Exp $ + * $Id: install.c,v 1.71.2.90 1996/05/24 06:08:41 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * 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 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS 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) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "sysinstall.h" #include #include #include #include #include #include #include #define MSDOSFS #include #undef MSDOSFS #include #include #include static void create_termcap(void); #define TERMCAP_FILE "/usr/share/misc/termcap" static void installConfigure(void); static Boolean checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev) { Device **devs; Boolean status; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev; int i; status = TRUE; *rdev = *sdev = *udev = rootdev = swapdev = usrdev = NULL; devs = deviceFind(NULL, DEVICE_TYPE_DISK); /* First verify that we have a root device */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; msgDebug("Scanning disk %s for root filesystem\n", disk->name); if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { 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."); continue; } rootdev = c2; if (isDebug()) msgDebug("Found rootdev at %s!\n", rootdev->name); } 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."); continue; } usrdev = c2; if (isDebug()) msgDebug("Found usrdev at %s!\n", usrdev->name); } } } } } } swapdev = NULL; /* Now check for swap devices */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; msgDebug("Scanning disk %s for swap partitions\n", disk->name); if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype == FS_SWAP && !swapdev) { swapdev = c2; if (isDebug()) msgDebug("Found swapdev at %s!\n", swapdev->name); break; } } } } } *rdev = rootdev; if (!rootdev) { msgConfirm("No root device found - you must label a partition as /\n" "in the label editor."); status = FALSE; } *sdev = swapdev; if (!swapdev) { msgConfirm("No swap devices found - you must create at least one\n" "swap partition."); status = FALSE; } *udev = usrdev; if (!usrdev) { 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!"); } return status; } static int installInitial(void) { static Boolean alreadyDone = FALSE; if (alreadyDone) return DITEM_SUCCESS; if (!variable_get(DISK_LABELLED)) { msgConfirm("You need to assign disk labels before you can proceed with\n" "the installation."); return DITEM_FAILURE; } /* If it's labelled, assume it's also partitioned */ if (!variable_get(DISK_PARTITIONED)) variable_set2(DISK_PARTITIONED, "yes"); /* If we refuse to proceed, bail. */ dialog_clear(); 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!")) return DITEM_FAILURE | DITEM_RESTORE; if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) { msgConfirm("Couldn't make filesystems properly. Aborting."); return DITEM_FAILURE; } else if (isDebug()) msgDebug("installInitial: Scribbled successfully on the disk(s)\n"); if (!copySelf()) { msgConfirm("Couldn't clone the boot floppy onto the root file system.\n" "Aborting."); return DITEM_FAILURE; } if (chroot("/mnt") == -1) { msgConfirm("Unable to chroot to /mnt - this is bad!"); return DITEM_FAILURE; } chdir("/"); variable_set2(RUNNING_ON_ROOT, "yes"); /* stick a helpful shell over on the 4th VTY */ systemCreateHoloshell(); alreadyDone = TRUE; return DITEM_SUCCESS; } int installFixitCDROM(dialogMenuItem *self) { msgConfirm("Sorry, this feature is currently unimplemented but will,\n" "at some point in the future, support the use of the live\n" "filesystem CD (CD 2) in fixing your system."); return DITEM_SUCCESS; } int installFixitFloppy(dialogMenuItem *self) { struct ufs_args args; pid_t child; int waitstatus; variable_set2(SYSTEM_STATE, "fixit"); memset(&args, 0, sizeof(args)); args.fspec = "/dev/fd0"; Mkdir("/mnt2", NULL); while (1) { 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?")) return DITEM_FAILURE; } dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; if (!directory_exists("/tmp")) (void)symlink("/mnt2/tmp", "/tmp"); if (!directory_exists("/var/tmp/vi.recover")) { if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) { msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n" "vi will kvetch and moan about it as a result but should still\n" "be essentially usable."); } } /* Link the spwd.db file */ if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS) msgConfirm("Unable to create an /etc directory! Things are weird on this floppy.."); else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1) msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this.."); if (!file_readable(TERMCAP_FILE)) create_termcap(); if (!(child = fork())) { struct termios foo; signal(SIGTTOU, SIG_IGN); if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(0, TCSANOW, &foo) == -1) msgDebug("fixit shell: Unable to set erase character.\n"); } else msgDebug("fixit shell: Unable to get terminal attributes!\n"); printf("When you're finished with this shell, please type exit.\n"); printf("The fixit floppy itself is mounted as /mnt2\n"); setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/stand:/mnt2/stand", 1); execlp("sh", "-sh", 0); msgDebug("fixit shell: Failed to execute shell!\n"); return -1; } else (void)waitpid(child, &waitstatus, 0); DialogActive = TRUE; clear(); dialog_clear(); dialog_update(); unmount("/mnt2", MNT_FORCE); msgConfirm("Please remove the fixit floppy now."); return DITEM_SUCCESS; } int installExpress(dialogMenuItem *self) { int i; variable_set2(SYSTEM_STATE, "express"); if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; if (!Dists) { dialog_clear(); if (!dmenuOpenSimple(&MenuDistributions) && !Dists) return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; } if (!mediaDevice) { dialog_clear(); if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice) return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; } if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Give user the option of one last configuration spree */ installConfigure(); /* Now write out any changes .. */ configResolv(); configSysconfig(); } return i | DITEM_RESTORE | DITEM_RECREATE; } /* Novice mode installation */ int installNovice(dialogMenuItem *self) { int i; extern int cdromMounted; variable_set2(SYSTEM_STATE, "novice"); dialog_clear(); 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" "then use the (A)ll command to select the default partitioning scheme followed\n" "by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n" "partition marked \"unused\" and use the (C)reate command."); if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; dialog_clear(); 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" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" "manual layout."); 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) { if (!dmenuOpenSimple(&MenuDistributions) && !Dists) return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; if (Dists || !msgYesNo("No distributions selected. Are you sure you wish to continue?")) break; } if (!mediaDevice) { dialog_clear(); msgConfirm("Finally, you must specify an installation medium."); if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice) return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; } if (DITEM_STATUS((i = installCommit(self))) == 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. You can also chose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); return i | DITEM_RESTORE | DITEM_RECREATE; } else msgConfirm("Congradulations! 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("Would you like to configure this machine's network interfaces?")) { Device *save = mediaDevice; /* This will also set the media device, which we don't want */ tcpDeviceSelect(); mediaDevice = save; dialog_clear(); } } 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); if (!msgYesNo("Will this machine be an IP gateway (e.g. will it forward packets\n" "between interfaces)?")) variable_set2("gateway", "YES"); if (!msgYesNo("Do you want to allow anonymous FTP connections to this machine?")) configAnonFTP(self); if (!msgYesNo("Do you want to configure this machine as an NFS server?")) configNFSServer(self); if (!msgYesNo("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client", "YES"); if (!msgYesNo("Do you want to configure this machine as a WEB server?")) configApache(self); if (!msgYesNo("Would you like to customize your system console settings?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuSyscons); restorescr(w); } if (!msgYesNo("Would you like to set this machine's time zone now?")) { WINDOW *w = savescr(); dialog_clear(); systemExecute("rm -f /etc/wall_cmos_clock /etc/localtime; tzsetup"); restorescr(w); } if (!msgYesNo("Does this system have a mouse attached to it?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuMouse); restorescr(w); } if (directory_exists("/usr/X11R6")) { 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 300 ready-to-run\n" + if (!msgYesNo("The FreeBSD package collection is a collection of over 450 ready-to-run\n" "applications, from text editors to games to WEB servers. Would you like\n" "to browse the collection now?")) configPackages(self); /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */ /* Give user the option of one last configuration spree */ installConfigure(); /* Now write out any changes .. */ configResolv(); configSysconfig(); return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE; } /* The version of commit we call from the Install Custom menu */ int installCustomCommit(dialogMenuItem *self) { int i; i = installCommit(self); if (DITEM_STATUS(i) == DITEM_SUCCESS) { /* Give user the option of one last configuration spree */ installConfigure(); /* Now write out any changes .. */ configResolv(); configSysconfig(); return i; } else msgConfirm("The commit operation completed with errors. Not\n" "updating /etc files."); return i; } /* * What happens when we finally decide to going ahead with the installation. * * This is broken into multiple stages so that the user can do a full * installation but come back here again to load more distributions, * perhaps from a different media type. This would allow, for * example, the user to load the majority of the system from CDROM and * then use ftp to load just the DES dist. */ int installCommit(dialogMenuItem *self) { int i; char *str; if (!mediaVerify()) return DITEM_FAILURE; str = variable_get(SYSTEM_STATE); if (isDebug()) msgDebug("installCommit: System state is `%s'\n", str); if (RunningAsInit) { /* Do things we wouldn't do to a multi-user system */ if (DITEM_STATUS((i = installInitial())) == DITEM_FAILURE) return i; if (DITEM_STATUS((i = configFstab())) == DITEM_FAILURE) return i; - if (!rootExtract()) { - msgConfirm("Failed to load the ROOT distribution. Please correct\n" - "this problem and try again."); - return DITEM_FAILURE; - } } i = distExtractAll(self); if (DITEM_STATUS(i) == DITEM_FAILURE) (void)installFixup(self); else 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_RESTORE | DITEM_RECREATE; } static void installConfigure(void) { /* Final menu of last resort */ if (!msgYesNo("Visit the general configuration menu for a chance to set\n" "any last options?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuConfigure); restorescr(w); } } int installFixup(dialogMenuItem *self) { Device **devs; int i; if (!file_readable("/kernel")) { if (file_readable("/kernel.GENERIC")) { if (vsystem("cp -p /kernel.GENERIC /kernel")) { msgConfirm("Unable to link /kernel into place!"); return DITEM_FAILURE; } } else { msgConfirm("Can't find a kernel image to link to on the root file system!\n" "You're going to have a hard time getting this system to\n" "boot from the hard disk, I'm afraid!"); return DITEM_FAILURE; } } /* Resurrect /dev after bin distribution screws it up */ if (RunningAsInit) { msgNotify("Remaking all devices.. Please wait!"); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE; } msgNotify("Resurrecting /dev entries for slices.."); devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) msgFatal("Couldn't get a disk device list!"); /* Resurrect the slices that the former clobbered */ for (i = 0; devs[i]; i++) { Disk *disk = (Disk *)devs[i]->private; Chunk *c1; if (!devs[i]->enabled) continue; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { msgNotify("Making slice entries for %s", c1->name); if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name)) { msgConfirm("Unable to make slice entries for %s!", c1->name); return DITEM_FAILURE; } } } } /* XXX Do all the last ugly work-arounds here which we'll try and excise someday right?? XXX */ msgNotify("Fixing permissions.."); /* BOGON #1: XFree86 extracting /usr/X11R6 with root-only perms */ if (directory_exists("/usr/X11R6")) { vsystem("chmod -R a+r /usr/X11R6"); vsystem("find /usr/X11R6 -type d | xargs chmod a+x"); } /* BOGON #2: We leave /etc in a bad state */ chmod("/etc", 0755); /* BOGON #3: No /var/db/mountdtab complains */ Mkdir("/var/db", NULL); creat("/var/db/mountdtab", 0644); /* Now run all the mtree stuff to fix things up */ vsystem("mtree -deU -f /etc/mtree/BSD.root.dist -p /"); vsystem("mtree -deU -f /etc/mtree/BSD.var.dist -p /var"); vsystem("mtree -deU -f /etc/mtree/BSD.usr.dist -p /usr"); } return DITEM_SUCCESS; } /* Go newfs and/or mount all the filesystems we've been asked to */ int installFilesystems(dialogMenuItem *self) { int i; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev; Device **devs; PartInfo *root; char dname[80], *str; extern int MakeDevChunk(Chunk *c, char *n); Boolean upgrade = FALSE; str = variable_get(SYSTEM_STATE); if (!checkLabels(&rootdev, &swapdev, &usrdev)) return DITEM_FAILURE; root = (PartInfo *)rootdev->private_data; command_clear(); upgrade = str && !strcmp(str, "upgrade"); /* As the very first thing, try to get ourselves some swap space */ sprintf(dname, "/dev/%s", swapdev->name); if (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname)) { msgConfirm("Unable to make device node for %s in /dev!\n" "The creation of filesystems will be aborted.", dname); return DITEM_FAILURE; } if (!swapon(dname)) msgNotify("Added %s as initial swap device", dname); else msgConfirm("WARNING! Unable to swap to %s: %s\n" "This may cause the installation to fail at some point\n" "if you don't have a lot of memory.", dname, strerror(errno)); /* Next, create and/or mount the root device */ sprintf(dname, "/dev/r%sa", rootdev->disk->name); if (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname)) { msgConfirm("Unable to make device node for %s in /dev!\n" "The creation of filesystems will be aborted.", dname); return DITEM_FAILURE; } if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint); if (root->newfs) { int i; msgNotify("Making a new root filesystem on %s", dname); i = vsystem("%s %s", root->newfs_cmd, dname); if (i) { msgConfirm("Unable to make new root filesystem on %s!\n" "Command returned status %d", dname, i); return DITEM_FAILURE; } } else { if (!upgrade) { msgConfirm("Warning: Root device is selected read-only. It will be assumed\n" "that you have the appropriate device entries already in /dev."); } msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck -y %s", dname); if (i) msgConfirm("Warning: fsck returned status of %d for %s.\n" "This partition may be unsafe to use.", i, dname); } /* Switch to block device */ sprintf(dname, "/dev/%sa", rootdev->disk->name); if (Mount("/mnt", dname)) { msgConfirm("Unable to mount the root file system on %s! Giving up.", dname); return DITEM_FAILURE; } /* Now buzz through the rest of the partitions and mount them too */ devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; if (!disk->chunks) { msgConfirm("No chunk list found for %s!", disk->name); return DITEM_FAILURE; } if (root->newfs || upgrade) { Mkdir("/mnt/dev", NULL); MakeDevDisk(disk, "/mnt/dev"); } for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { PartInfo *tmp = (PartInfo *)c2->private_data; /* Already did root */ if (c2 == rootdev) continue; if (tmp->newfs) command_shell_add(tmp->mountpoint, "%s /mnt/dev/r%s", tmp->newfs_cmd, c2->name); else command_shell_add(tmp->mountpoint, "fsck -y /mnt/dev/r%s", c2->name); command_func_add(tmp->mountpoint, Mount, c2->name); } else if (c2->type == part && c2->subtype == FS_SWAP) { char fname[80]; int i; if (c2 == swapdev) continue; sprintf(fname, "/mnt/dev/%s", c2->name); i = swapon(fname); if (!i) msgNotify("Added %s as an additional swap device", fname); else msgConfirm("Unable to add %s as a swap device: %s", fname, strerror(errno)); } } } else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) { char name[FILENAME_MAX]; sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint); Mkdir(name, NULL); } } } msgNotify("Copying initial device files.."); /* Copy the boot floppy's dev files */ if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio %s -pdum /mnt", cpioVerbosity())) { msgConfirm("Couldn't clone the /dev files!"); return DITEM_FAILURE; } command_sort(); command_execute(); return DITEM_SUCCESS; } /* Initialize various user-settable values to their defaults */ int installVarDefaults(dialogMenuItem *self) { /* Set default startup options */ variable_set2(VAR_ROUTEDFLAGS, "-q"); variable_set2(VAR_RELNAME, RELEASE_NAME); variable_set2(VAR_CPIO_VERBOSITY, "high"); variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE); variable_set2(VAR_EDITOR, RunningAsInit ? "/stand/ee" : "/usr/bin/ee"); variable_set2(VAR_FTP_USER, "ftp"); variable_set2(VAR_BROWSER_PACKAGE, "lynx-2.4fm"); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx"); variable_set2(VAR_CONFIG_FILE, "freebsd.cfg"); variable_set2(VAR_FTP_STATE, "passive"); variable_set2(VAR_FTP_ONERROR, "abort"); variable_set2(VAR_FTP_RETRIES, MAX_FTP_RETRIES); if (getpid() != 1) variable_set2(SYSTEM_STATE, "update"); else variable_set2(SYSTEM_STATE, "init"); return DITEM_SUCCESS; } /* Copy the boot floppy contents into /stand */ Boolean copySelf(void) { int i; msgWeHaveOutput("Copying the boot floppy to /stand on root filesystem"); i = vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); if (i) { msgConfirm("Copy returned error status of %d!", i); return FALSE; } /* Copy the /etc files into their rightful place */ if (vsystem("cd /mnt/stand; find etc | cpio %s -pdum /mnt", cpioVerbosity())) { msgConfirm("Couldn't copy up the /etc files!"); return TRUE; } return TRUE; -} - -static Boolean loop_on_root_floppy(void); - -Boolean -rootExtract(void) -{ - int fd; - static Boolean alreadyExtracted = FALSE; - - if (alreadyExtracted) - return TRUE; - - if (mediaDevice) { - if (isDebug()) - msgDebug("Attempting to extract root image from %s\n", mediaDevice->name); - switch(mediaDevice->type) { - - case DEVICE_TYPE_FLOPPY: - alreadyExtracted = loop_on_root_floppy(); - break; - - default: - if (!mediaDevice->init(mediaDevice)) - break; - fd = mediaDevice->get(mediaDevice, "floppies/root.flp", FALSE); - if (fd < 0) { - msgConfirm("Couldn't get root image from %s!\n" - "Will try to get it from floppy.", mediaDevice->name); - mediaDevice->shutdown(mediaDevice); - alreadyExtracted = loop_on_root_floppy(); - } - else { - msgNotify("Loading root image from:\n%s", mediaDevice->name); - alreadyExtracted = mediaExtractDist("/", fd); - mediaDevice->close(mediaDevice, fd); - } - break; - } - } - else - alreadyExtracted = loop_on_root_floppy(); - return alreadyExtracted; -} - -static Boolean -loop_on_root_floppy(void) -{ - int fd; - int status = FALSE; - - while (1) { - fd = getRootFloppy(); - if (fd != -1) { - msgNotify("Extracting root floppy.."); - status = mediaExtractDist("/", fd); - close(fd); - break; - } - } - return status; } static void create_termcap(void) { FILE *fp; const char *caps[] = { termcap_vt100, termcap_cons25, termcap_cons25_m, termcap_cons25r, termcap_cons25r_m, termcap_cons25l1, termcap_cons25l1_m, NULL, }; const char **cp; if (!file_readable(TERMCAP_FILE)) { Mkdir("/usr/share/misc", NULL); fp = fopen(TERMCAP_FILE, "w"); if (!fp) { msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work."); return; } cp = caps; while (*cp) fprintf(fp, "%s\n", *(cp++)); fclose(fp); } } Index: stable/2.1/release/sysinstall/sysinstall.h =================================================================== --- stable/2.1/release/sysinstall/sysinstall.h (revision 15974) +++ stable/2.1/release/sysinstall/sysinstall.h (revision 15975) @@ -1,610 +1,609 @@ /* * The new sysinstall program. * * 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.56 1996/05/16 11:47:44 jkh Exp $ + * $Id: sysinstall.h,v 1.42.2.52 1996/05/24 06:09:02 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * 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 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS 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) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef _SYSINSTALL_H_INCLUDE #define _SYSINSTALL_H_INCLUDE #include #include #include #include #include #include #include #include "libdisk.h" #include "dist.h" #include "version.h" /*** Defines ***/ /* variable limits */ #define VAR_NAME_MAX 128 #define VAR_VALUE_MAX 1024 /* device limits */ #define DEV_NAME_MAX 64 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */ #define MAX_FTP_RETRIES "4" /* How many times to beat our heads against the wall */ /* * I make some pretty gross assumptions about having a max of 50 chunks * total - 8 slices and 42 partitions. I can't easily display many more * than that on the screen at once! * * For 2.1 I'll revisit this and try to make it more dynamic, but since * this will catch 99.99% of all possible cases, I'm not too worried. */ #define MAX_CHUNKS 40 /* Internal environment variable names */ #define DISK_PARTITIONED "_diskPartitioned" #define DISK_LABELLED "_diskLabelled" #define DISK_SELECTED "_diskSelected" #define SYSTEM_STATE "_systemState" #define RUNNING_ON_ROOT "_runningOnRoot" #define TCP_CONFIGURED "_tcpConfigured" /* Ones that can be tweaked from config files */ #define VAR_BLANKTIME "blanktime" #define VAR_BOOTMGR "bootManager" #define VAR_BROWSER_BINARY "browserBinary" #define VAR_BROWSER_PACKAGE "browserPackage" #define VAR_CONFIG_FILE "configFile" #define VAR_CPIO_VERBOSITY "cpioVerbose" #define VAR_DEBUG "debug" #define VAR_DISK "disk" #define VAR_DISKSPACE "diskSpace" #define VAR_DOMAINNAME "domainname" #define VAR_EDITOR "editor" #define VAR_EXTRAS "ifconfig_" #define VAR_FTP_ONERROR "ftpOnError" #define VAR_FTP_PASS "ftpPass" #define VAR_FTP_PATH "ftp" #define VAR_FTP_RETRIES "ftpRetryCount" #define VAR_FTP_STATE "ftpState" #define VAR_FTP_USER "ftpUser" #define VAR_GATEWAY "defaultrouter" #define VAR_GEOMETRY "geometry" #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INTERFACES "network_interfaces" #define VAR_IPADDR "ipaddr" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_MEDIA_TYPE "mediaType" #define VAR_NAMESERVER "nameserver" #define VAR_NETMASK "netmask" #define VAR_NFS_PATH "nfs" #define VAR_NFS_SECURE "nfsSecure" #define VAR_NO_CONFIRM "noConfirm" #define VAR_NTPDATE "ntpDate" #define VAR_PORTS_PATH "ports" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTEDFLAGS "routedflags" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" #define VAR_SERIAL_SPEED "serialSpeed" #define DEFAULT_TAPE_BLOCKSIZE "20" /* One MB worth of blocks */ #define ONE_MEG 2048 /*** Types ***/ typedef unsigned int Boolean; typedef struct disk Disk; typedef struct chunk Chunk; /* Bitfields for menu options */ #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */ #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ typedef struct _dmenu { int type; /* What sort of menu we are */ char *title; /* Our title */ char *prompt; /* Our prompt */ char *helpline; /* Line of help at bottom */ char *helpfile; /* Help file for "F1" */ dialogMenuItem items[0]; /* Array of menu items */ } DMenu; /* A sysconfig variable */ typedef struct _variable { struct _variable *next; char name[VAR_NAME_MAX]; char value[VAR_VALUE_MAX]; } Variable; /* For attribs */ #define MAX_ATTRIBS 200 #define MAX_NAME 64 #define MAX_VALUE 256 typedef struct _attribs { char name[MAX_NAME]; char value[MAX_VALUE]; } Attribs; typedef enum { DEVICE_TYPE_NONE, DEVICE_TYPE_DISK, DEVICE_TYPE_FLOPPY, DEVICE_TYPE_FTP, DEVICE_TYPE_NETWORK, DEVICE_TYPE_CDROM, DEVICE_TYPE_TAPE, DEVICE_TYPE_DOS, DEVICE_TYPE_UFS, DEVICE_TYPE_NFS, DEVICE_TYPE_ANY, } DeviceType; /* A "device" from sysinstall's point of view */ typedef struct _device { char name[DEV_NAME_MAX]; char *description; char *devname; DeviceType type; Boolean enabled; Boolean (*init)(struct _device *dev); int (*get)(struct _device *dev, char *file, Boolean probe); Boolean (*close)(struct _device *dev, int fd); void (*shutdown)(struct _device *dev); void *private; unsigned int flags; } Device; /* Some internal representations of partitions */ typedef enum { PART_NONE, PART_SLICE, PART_SWAP, PART_FILESYSTEM, PART_FAT, } PartType; /* The longest newfs command we'll hand to system() */ #define NEWFS_CMD_MAX 256 typedef struct _part_info { Boolean newfs; char mountpoint[FILENAME_MAX]; char newfs_cmd[NEWFS_CMD_MAX]; } PartInfo; /* An option */ typedef struct _opt { char *name; char *desc; enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; void *data; void *aux; char *(*check)(); } Option; /* Weird index nodey things we use for keeping track of package information */ typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */ typedef struct _pkgnode { /* A node in the reconstructed hierarchy */ struct _pkgnode *next; /* My next sibling */ node_type type; /* What am I? */ char *name; /* My name */ char *desc; /* My description (Hook) */ struct _pkgnode *kids; /* My little children */ void *data; /* A place to hang my data */ } PkgNode; typedef PkgNode *PkgNodePtr; /* A single package */ typedef struct _indexEntry { /* A single entry in an INDEX file */ char *name; /* name */ char *path; /* full path to port */ char *prefix; /* port prefix */ char *comment; /* one line description */ char *descrfile; /* path to description file */ char *deps; /* packages this depends on */ char *maintainer; /* maintainer */ } IndexEntry; typedef IndexEntry *IndexEntryPtr; typedef int (*commandFunc)(char *key, void *data); #define HOSTNAME_FIELD_LEN 128 #define IPADDR_FIELD_LEN 16 #define EXTRAS_FIELD_LEN 128 /* This is the structure that Network devices carry around in their private, erm, structures */ typedef struct _devPriv { char ipaddr[IPADDR_FIELD_LEN]; char netmask[IPADDR_FIELD_LEN]; char extras[EXTRAS_FIELD_LEN]; } DevInfo; /*** Externs ***/ extern int DebugFD; /* Where diagnostic output goes */ extern Boolean Fake; /* Don't actually modify anything - testing */ extern Boolean SystemWasInstalled; /* Did we install it? */ extern Boolean RunningAsInit; /* Are we running stand-alone? */ extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ extern unsigned int DESDists; /* Which naughty distributions we want */ extern unsigned int SrcDists; /* Which src distributions we want */ 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 DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuFixit; /* Fixit repair menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ extern DMenu MenuConfigure; /* Final configuration menu */ extern DMenu MenuDocumentation; /* Documentation menu */ extern DMenu MenuFTPOptions; /* FTP Installation options */ extern DMenu MenuOptions; /* Installation options */ extern DMenu MenuOptionsLanguage; /* Language options menu */ extern DMenu MenuMedia; /* Media type menu */ extern DMenu MenuMouse; /* Mouse type menu */ extern DMenu MenuMediaCDROM; /* CDROM media menu */ extern DMenu MenuMediaDOS; /* DOS media menu */ extern DMenu MenuMediaFloppy; /* Floppy media menu */ extern DMenu MenuMediaFTP; /* FTP media menu */ extern DMenu MenuMediaTape; /* Tape media menu */ extern DMenu MenuNetworkDevice; /* Network device menu */ extern DMenu MenuNTP; /* NTP time server menu */ extern DMenu MenuSyscons; /* System console configuration menu */ extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */ extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */ extern DMenu MenuSysconsSaver; /* System console saver configuration menu */ extern DMenu MenuNetworking; /* Network configuration menu */ extern DMenu MenuInstallCustom; /* Custom Installation menu */ extern DMenu MenuDistributions; /* Distribution menu */ extern DMenu MenuSubDistributions; /* Custom distribution menu */ extern DMenu MenuDESDistributions; /* DES distribution menu */ extern DMenu MenuSrcDistributions; /* Source distribution menu */ extern DMenu MenuXF86; /* XFree86 main menu */ extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ extern DMenu MenuDiskDevices; /* Disk devices menu */ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */ /*** Prototypes ***/ /* apache.c */ extern int configApache(dialogMenuItem *self); /* anonFTP.c */ extern int configAnonFTP(dialogMenuItem *self); /* attrs.c */ extern char *attr_match(Attribs *attr, char *name); extern int attr_parse_file(Attribs *attr, char *file); extern int attr_parse(Attribs *attr, int fd); /* cdrom.c */ extern Boolean mediaInitCDROM(Device *dev); extern int mediaGetCDROM(Device *dev, char *file, Boolean probe); extern void mediaShutdownCDROM(Device *dev); /* command.c */ extern void command_clear(void); extern void command_sort(void); extern void command_execute(void); extern void command_shell_add(char *key, char *fmt, ...); extern void command_func_add(char *key, commandFunc func, void *data); /* config.c */ extern int configFstab(void); extern void configSysconfig(void); extern void configResolv(void); extern int configPorts(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); extern int configXFree86(dialogMenuItem *self); extern int configRoutedFlags(dialogMenuItem *self); /* crc.c */ extern int crc(int, unsigned long *, unsigned long *); /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern Device **deviceFind(char *name, DeviceType type); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Boolean probe), Boolean (*close)(Device *mediadev, int fd), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); extern int dummyGet(Device *dev, char *dist, Boolean probe); extern Boolean dummyClose(Device *dev, int fd); extern void dummyShutdown(Device *dev); /* disks.c */ extern int diskPartitionEditor(dialogMenuItem *self); extern int diskPartitionWrite(dialogMenuItem *self); extern void diskPartition(Device *dev, Disk *d); /* dispatch.c */ extern int dispatchCommand(char *command); /* dist.c */ extern int distReset(dialogMenuItem *self); extern int distSetCustom(char *str); extern int distSetDeveloper(dialogMenuItem *self); extern int distSetXDeveloper(dialogMenuItem *self); extern int distSetKernDeveloper(dialogMenuItem *self); extern int distSetUser(dialogMenuItem *self); extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int distSetDES(dialogMenuItem *self); extern int distSetSrc(dialogMenuItem *self); extern int distSetXF86(dialogMenuItem *self); extern int distExtractAll(dialogMenuItem *self); /* dmenu.c */ extern int dmenuDisplayFile(dialogMenuItem *tmp); extern int dmenuSubmenu(dialogMenuItem *tmp); extern int dmenuSystemCommand(dialogMenuItem *tmp); extern int dmenuSystemCommandBox(dialogMenuItem *tmp); extern int dmenuExit(dialogMenuItem *tmp); extern int dmenuSetVariable(dialogMenuItem *tmp); extern int dmenuSetFlag(dialogMenuItem *tmp); extern int dmenuSetValue(dialogMenuItem *tmp); extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max); extern Boolean dmenuOpenSimple(DMenu *menu); extern int dmenuVarCheck(dialogMenuItem *item); extern int dmenuFlagCheck(dialogMenuItem *item); extern int dmenuRadioCheck(dialogMenuItem *item); /* doc.c */ extern int docBrowser(dialogMenuItem *self); extern int docShowDocument(dialogMenuItem *self); /* dos.c */ extern Boolean mediaInitDOS(Device *dev); extern int mediaGetDOS(Device *dev, char *file, Boolean probe); extern void mediaShutdownDOS(Device *dev); /* floppy.c */ extern int getRootFloppy(void); extern Boolean mediaInitFloppy(Device *dev); extern int mediaGetFloppy(Device *dev, char *file, Boolean probe); extern void mediaShutdownFloppy(Device *dev); /* ftp_strat.c */ extern Boolean mediaCloseFTP(Device *dev, int fd); extern Boolean mediaInitFTP(Device *dev); extern int mediaGetFTP(Device *dev, char *file, Boolean probe); extern void mediaShutdownFTP(Device *dev); /* globals.c */ extern void globalsInit(void); /* index.c */ int index_get(char *fname, PkgNodePtr papa); int index_read(int fd, PkgNodePtr papa); int index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); /* install.c */ extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); extern int installNovice(dialogMenuItem *self); extern int installFixitCDROM(dialogMenuItem *self); extern int installFixitFloppy(dialogMenuItem *self); extern int installFixup(dialogMenuItem *self); extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern Boolean copySelf(void); -extern Boolean rootExtract(void); /* installFinal.c */ extern int configGated(dialogMenuItem *self); extern int configSamba(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); /* label.c */ extern int diskLabelEditor(dialogMenuItem *self); extern int diskLabelCommit(dialogMenuItem *self); /* lndir.c */ extern int lndir(char *from, char *to); /* makedevs.c (auto-generated) */ extern const char termcap_vt100[]; extern const char termcap_cons25[]; extern const char termcap_cons25_m[]; extern const char termcap_cons25r[]; extern const char termcap_cons25r_m[]; extern const char termcap_cons25l1[]; extern const char termcap_cons25l1_m[]; extern const u_char font_iso_8x16[]; extern const u_char font_cp850_8x16[]; extern const u_char font_cp866_8x16[]; extern const u_char koi8_r2cp866[]; extern u_char default_scrnmap[]; /* media.c */ extern char *cpioVerbosity(void); extern int mediaSetCDROM(dialogMenuItem *self); extern int mediaSetFloppy(dialogMenuItem *self); extern int mediaSetDOS(dialogMenuItem *self); extern int mediaSetTape(dialogMenuItem *self); extern int mediaSetFTP(dialogMenuItem *self); extern int mediaSetFTPActive(dialogMenuItem *self); extern int mediaSetFTPPassive(dialogMenuItem *self); extern int mediaSetUFS(dialogMenuItem *self); extern int mediaSetNFS(dialogMenuItem *self); extern int mediaSetFtpOnError(dialogMenuItem *self); extern int mediaSetFtpUserPass(dialogMenuItem *self); extern int mediaSetCPIOVerbosity(dialogMenuItem *self); extern int mediaGetType(dialogMenuItem *self); extern Boolean mediaExtractDist(char *dir, int fd); extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic); extern Boolean mediaExtractDistEnd(int zpid, int cpid); extern Boolean mediaVerify(void); /* misc.c */ extern Boolean file_readable(char *fname); extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); extern char *string_concat(char *p1, char *p2); extern char *string_concat3(char *p1, char *p2, char *p3); extern char *string_prune(char *str); extern char *string_skipwhite(char *str); extern char *string_copy(char *s1, char *s2); extern char *pathBaseName(const char *path); extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); extern void *safe_realloc(void *orig, size_t size); extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *, void *data); extern int Mount(char *, void *data); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); /* msg.c */ extern Boolean isDebug(void); extern void msgInfo(char *fmt, ...); extern void msgYap(char *fmt, ...); extern void msgWarn(char *fmt, ...); extern void msgDebug(char *fmt, ...); extern void msgError(char *fmt, ...); extern void msgFatal(char *fmt, ...); extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); /* network.c */ extern Boolean mediaInitNetwork(Device *dev); extern void mediaShutdownNetwork(Device *dev); /* nfs.c */ extern Boolean mediaInitNFS(Device *dev); extern int mediaGetNFS(Device *dev, char *file, Boolean probe); extern void mediaShutdownNFS(Device *dev); /* options.c */ extern int optionsEditor(dialogMenuItem *self); /* package.c */ extern int package_add(char *name); extern int package_extract(Device *dev, char *name, Boolean depended); extern Boolean package_exists(char *name); /* system.c */ extern void systemInitialize(int argc, char **argv); extern void systemShutdown(int status); extern int execExecute(char *cmd, char *name); extern int systemExecute(char *cmd); extern int systemDisplayHelp(char *file); extern char *systemHelpFile(char *file, char *buf); extern void systemChangeFont(const u_char font[]); extern void systemChangeLang(char *lang); extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]); extern void systemChangeScreenmap(const u_char newmap[]); extern void systemCreateHoloshell(void); extern int vsystem(char *fmt, ...); /* tape.c */ extern char *mediaTapeBlocksize(void); extern Boolean mediaInitTape(Device *dev); extern int mediaGetTape(Device *dev, char *file, Boolean probe); extern void mediaShutdownTape(Device *dev); /* tcpip.c */ extern int tcpOpenDialog(Device *dev); extern int tcpMenuSelect(dialogMenuItem *self); extern int tcpInstallDevice(char *str); extern Boolean tcpDeviceSelect(void); /* termcap.c */ extern int set_termcap(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); extern int mediaGetUFS(Device *dev, char *file, Boolean probe); /* variable.c */ extern void variable_set(char *var); extern void variable_set2(char *name, char *value); extern char *variable_get(char *var); extern void variable_unset(char *var); extern char *variable_get_value(char *var, char *prompt); /* wizard.c */ extern void slice_wizard(Disk *d); #endif /* _SYSINSTALL_H_INCLUDE */