Date: Thu, 8 Aug 2002 18:32:40 +0200 (SAT) From: John Hay <jhay@icomtek.csir.co.za> To: current@freebsd.org Cc: ru@freebsd.org, jhb@freebsd.org Subject: 3 floppy system for -current releases Message-ID: <200208081632.g78GWeq61331@zibbi.icomtek.csir.co.za>
next in thread | raw e-mail | index | archive | help
Here is a try at a 3 floppy system. Most people should be able to install with the first 2 floppies (kern.flp and mfsroot.flp). Just those that need a driver on the third floppy (drivers.flp) will need it. If this idea is acceptable, we should probably tweak what should go on the second floppy and what is used the least and put that on the last one. To load drivers from the drivers floppy, go to "Configure" and then the last option there is "Load KLD". The last 2 files in the diff (bld-ko.sh and driver-list.awk) are not really needed. That is part of my attempt to create a single .ko to save space on mfsroot.flp. But I can't get internal dependancies to work yet. Most drivers depend on miibus and that don't get loaded first. John -- John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org Index: usr.sbin/sysinstall/system.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/sysinstall/system.c,v retrieving revision 1.119 diff -u -r1.119 system.c --- usr.sbin/sysinstall/system.c 1 Nov 2001 23:32:46 -0000 1.119 +++ usr.sbin/sysinstall/system.c 8 Aug 2002 09:17:01 -0000 @@ -348,7 +348,13 @@ snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) return expand(buf); + snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); + if (file_readable(buf)) + return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT.gz", file); + if (file_readable(buf)) + return expand(buf); + snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.hlp", file); Index: release/Makefile =================================================================== RCS file: /home/ncvs/src/release/Makefile,v retrieving revision 1.698 diff -u -r1.698 Makefile --- release/Makefile 5 Aug 2002 16:57:43 -0000 1.698 +++ release/Makefile 8 Aug 2002 15:40:27 -0000 @@ -518,7 +518,8 @@ .endif cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean cd ${.CURDIR}/..; ${TMAKE} build-tools - cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk all + cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk \ + CFLAGS="-Os -pipe" -DNO_CPU_CFLAGS all mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j} .endfor touch release.5 @@ -654,15 +655,15 @@ > ${RD}/mfsfd/stand/etc/services ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig - gzip -9c ${RD}/trees/base/COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz + cat ${RD}/trees/base/COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp .if !defined(NODOC) @for i in ${DIST_DOCS_ARCH_INDEP}; do \ - gzip -9c ${RND}/${RELNOTES_LANG}/$$i/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \ + cat ${RND}/${RELNOTES_LANG}/$$i/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ done @for i in ${DIST_DOCS_ARCH_DEP}; do \ - gzip -9c ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT.gz; \ + cat ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt > ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \ done - @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT.gz ${RD}/mfsfd/stand/help/INSTALL.TXT.gz + @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT ${RD}/mfsfd/stand/help/INSTALL.TXT .endif -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd @mkdir -p ${RD}/mfsfd/boot @@ -674,16 +675,28 @@ @echo "Making the regular boot floppy." @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \ tar xf - -C ${RD}/mfsfd/stand - @echo "Compressing doc files..." - @gzip -9 ${RD}/mfsfd/stand/help/*.hlp .if ${TARGET_ARCH} == "alpha" rm -rf ${RD}/mfsfd/stand/help/* .endif .if exists(${.CURDIR}/${TARGET}/drivers.conf) @mkdir -p ${RD}/mfsfd/stand/modules - @awk -f ${.CURDIR}/scripts/driver-copy2.awk \ +.if !defined(SINGLE_MODULE) + @awk -f ${.CURDIR}/scripts/driver-copy2.awk 2 \ ${.CURDIR}/${TARGET}/drivers.conf \ - ${RD}/trees/base/boot/kernel ${RD}/mfsfd/stand/modules + ${RD}/trees/base/boot/kernel ${RD}/mfsfd/stand/modules/ +.else + sh -e ${.CURDIR}/scripts/bld-ko.sh ${RD}/mfsfd/stand/modules \ + `awk -f ${.CURDIR}/scripts/driver-list.awk 2 \ + ${.CURDIR}/${TARGET}/drivers.conf` +.endif + @kldxref ${RD}/mfsfd/stand/modules/ + rm -rf ${RD}/driverfd + mkdir ${RD}/driverfd + @awk -f ${.CURDIR}/scripts/driver-copy2.awk 3 \ + ${.CURDIR}/${TARGET}/drivers.conf \ + ${RD}/trees/base/boot/kernel ${RD}/driverfd/ + @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/drivers.flp \ + ${RD} ${MNT} ${BOOTSIZE} ${RD}/driverfd ${BOOTINODE} ${BOOTLABEL} .endif sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \ ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} @@ -832,7 +845,7 @@ fbsd_livefs ${CD}/disc2.iso ${CD_DISC2}; \ if [ "x${CD_EXTRA_BITS}" != "x" ]; then \ sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ - fbsd_boot ${CD}/disc1.iso ${CD_DISC1} ${CD_EXTRA_BITS}; \ + fbsd_boot ${CD}/disc1.iso ${CD_DISC1} ${CD_EXTRA_BITS} \ && false; \ fi \ else \ @@ -963,7 +976,8 @@ cd ${.CURDIR}/..; \ KERNEL_KO=BOOTMFS KODIR= \ ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES -DNO_KERNELCLEAN \ - KERNCONF=BOOTMFS buildkernel reinstallkernel \ + KERNCONF=BOOTMFS COPTFLAGS="-Os -pipe" -DNO_CPU_COPTFLAGS \ + buildkernel reinstallkernel \ DESTDIR=${RD}/kernels [ -r ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ] && \ cp ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ${RD}/kernels @@ -995,6 +1009,7 @@ .endif @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc @echo "set hint.acpi.0.disable=1" >> ${RD}/image.${FSIMAGE}/boot/loader.rc + @echo "set module_path=\"/stand/modules;/dist\"" >> ${RD}/image.${FSIMAGE}/boot/loader.rc @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT} Index: release/i386/dokern.sh =================================================================== RCS file: /home/ncvs/src/release/i386/dokern.sh,v retrieving revision 1.59 diff -u -r1.59 dokern.sh --- release/i386/dokern.sh 4 Aug 2002 18:35:02 -0000 1.59 +++ release/i386/dokern.sh 8 Aug 2002 09:17:01 -0000 @@ -21,6 +21,7 @@ -e '/ random /d' \ -e '/ splash$/d' \ -e '/PROCFS/d' \ + -e '/PSEUDOFS/d' \ -e '/KTRACE/d' \ -e '/SYSV/d' \ -e '/SOFTUPDATES/d' \ @@ -83,6 +84,7 @@ -e '/ random /d' \ -e '/ splash$/d' \ -e '/PROCFS/d' \ + -e '/PSEUDOFS/d' \ -e '/KTRACE/d' \ -e '/SYSV/d' \ -e '/SOFTUPDATES/d' \ @@ -109,6 +111,7 @@ -e '/ ulpt /d' \ -e '/ urio /d' \ -e '/ uscanner /d' \ + -e '/ ses /d' \ -e '/maxusers/d' \ -e 's/ident.*GENERIC/ident BOOTMFS/g' Index: release/i386/drivers.conf =================================================================== RCS file: /home/ncvs/src/release/i386/drivers.conf,v retrieving revision 1.7 diff -u -r1.7 drivers.conf --- release/i386/drivers.conf 25 Jul 2002 14:04:38 -0000 1.7 +++ release/i386/drivers.conf 8 Aug 2002 12:58:49 -0000 @@ -39,9 +39,9 @@ aue if_aue 2 network "ADMtek USB ethernet adapter" cue if_cue 2 network "CATC USB ethernet adapter" dc if_dc 2 network "DEC/Intel 21143 (and clones) PCI fast ethernet card" -de if_de 2 network "DEC DE435 PCI NIC or other DC21040-AA based card" +de if_de 3 network "DEC DE435 PCI NIC or other DC21040-AA based card" ed if_ed 2 network "NE[12]000, SMC Ultra, 3c503, DS8390 ISA ethernet cards" -em if_em 2 network "Intel Pro/1000 PCI gigabit ethernet card" +em if_em 3 network "Intel Pro/1000 PCI gigabit ethernet card" fe if_fe 2 network "Fujitsu MB8696x based cards" fxp if_fxp 2 network "Intel EtherExpress Pro/100B PCI Fast Ethernet card" kue if_kue 2 network "Kawasaki LSI USB ethernet adapter" @@ -51,11 +51,11 @@ rl if_rl 2 network "RealTek 8129/8139 PCI ethernet card" sf if_sf 2 network "Adaptec AIC-6915 PCI ethernet card" sis if_sis 2 network "SiS 900/SiS 7016 PCI ethernet card" -sk if_sk 2 network "SysKonnect PCI gigabit ethernet card" -sn if_sn 2 network "SMC's 9000 series of ethernet chips" +sk if_sk 3 network "SysKonnect PCI gigabit ethernet card" +sn if_sn 3 network "SMC's 9000 series of ethernet chips" ste if_ste 2 network "Sundance ST201 PCI ethernet card" -ti if_ti 2 network "Alteon Networks PCI gigabit ethernet card" -tl if_tl 2 network "Texas Instruments ThunderLAN PCI ethernet card" +ti if_ti 3 network "Alteon Networks PCI gigabit ethernet card" +tl if_tl 3 network "Texas Instruments ThunderLAN PCI ethernet card" tx if_tx 2 network "SMC 9432TX ethernet card" vr if_vr 2 network "VIA VT3043/VT86C100A Rhine PCI ethernet card" vx if_vx 2 network "3Com 3c590/3c595 PCI ethernet card" @@ -63,6 +63,9 @@ wi if_wi 2 network "Lucent WaveLAN/IEEE 802.11 PCMCIA card" xe if_xe 2 network "Xircom pccard ethernet" xl if_xl 2 network "3COM 3c90x / 3c90xB PCI ethernet card" +CD9660 cd9660 3 options "ISO 9660 Filesystem" +MSDOSFS msdosfs 3 options "MSDOS filsystem" +NFSCLIENT nfsclient 3 options "Network Filesystem Client" SYSVSHM sysvshm 2 options "SYSV-style shared memory" SYSVMSG sysvmsg 2 options "SYSV-style message queues" SYSVSEM sysvsem 2 options "SYSV-style semaphores" Index: release/scripts/driver-copy2.awk =================================================================== RCS file: /home/ncvs/src/release/scripts/driver-copy2.awk,v retrieving revision 1.2 diff -u -r1.2 driver-copy2.awk --- release/scripts/driver-copy2.awk 25 May 2002 10:37:00 -0000 1.2 +++ release/scripts/driver-copy2.awk 8 Aug 2002 09:17:01 -0000 @@ -30,7 +30,7 @@ function usage() { - print "usage: driver-copy2.awk config_file src_ko_dir dst_ko_dir" > "/dev/stderr"; + print "usage: driver-copy2.awk flop_num config_file src_ko_dir dst_ko_dir" > "/dev/stderr"; exit 1; } @@ -62,12 +62,13 @@ } BEGIN { - if (ARGC != 4) + if (ARGC != 5) usage(); - config = ARGV[1]; - srcdir = ARGV[2]; - dstdir = ARGV[3]; + fnum = ARGV[1]; + config = ARGV[2]; + srcdir = ARGV[3]; + dstdir = ARGV[4]; readconfig(); @@ -77,20 +78,15 @@ err(1, "cannot find %s directory", dstdir); for (f in flp) { - if (flp[f] == 1) { - print f ": There's nothing to do with driver on first floppy." > "/dev/stderr"; - } else if (flp[f] == 2) { - srcfile = srcdir "/" f ".ko"; - dstfile = dstdir "/" f ".ko"; - dscfile = dstdir "/" f ".dsc"; - print "Copying " f ".ko to " dstdir > "/dev/stderr"; - if (system("cp " srcfile " " dstfile) != 0) - exit 1; - printf "%s", dsc[f] > dscfile; - close(dscfile); - } else if (flp[f] == 3) { - # third driver floppy (not yet implemented) - err(1, "%s: 3rd driver floppy support is not implemented", f); - } + if (flp[f] != fnum) + continue; + srcfile = srcdir "/" f ".ko"; + dstfile = dstdir "/" f ".ko"; + dscfile = dstdir "/" f ".dsc"; + print "Copying " f ".ko to " dstdir > "/dev/stderr"; + if (system("cp " srcfile " " dstfile) != 0) + exit 1; + printf "%s", dsc[f] > dscfile; + close(dscfile); } } --- /dev/null Thu Aug 8 17:33:00 2002 +++ release/scripts/bld-ko.sh Thu Aug 8 14:25:14 2002 @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ $# -lt 2 ]; then + echo "usage: bld-ko dst_ko_dir driver_name ..." + exit 1 +fi + +mdir="/usr/obj/usr/src/sys/GENERIC/modules/usr/src/sys/modules" +blddir="/usr/obj/usr/src/release/modules" +dstdir=$1 +shift + +dlist="" + +if [ -d ${blddir} ]; then + rm -rf ${blddir} +fi +mkdir ${blddir} +cd ${blddir} + +for a in $*; do + noif=`echo $a | sed -e s/if_//g` + if [ -f ${mdir}/${a}/${a}.kld ]; then + cp ${mdir}/${a}/${a}.kld . + dlist="$dlist ${a}.kld" + elif [ -f ${mdir}/${noif}/${a}.kld ]; then + cp ${mdir}/${noif}/${a}.kld . + dlist="$dlist ${a}.kld" + elif [ ${a} = "miibus" ]; then + cp ${mdir}/mii/${a}.kld . + dlist="$dlist ${a}.kld" + elif [ -f ${mdir}/sysvipc/${a}/${a}.kld ]; then + cp ${mdir}/sysvipc/${a}/${a}.kld . + dlist="$dlist ${a}.kld" + else + echo "Cannot find ${a}.kld" + fi +done + +set -x +ld -r -d -o drivers.kld ${dlist} +ld -Bshareable -d -warn-common -o drivers.ko.debug drivers.kld +objcopy --strip-debug drivers.ko.debug drivers.ko +cp drivers.ko ${dstdir}/ +echo "Various device drivers" > ${dstdir}/drivers.dsc --- /dev/null Thu Aug 8 17:33:00 2002 +++ release/scripts/driver-list.awk Thu Aug 8 14:22:31 2002 @@ -0,0 +1,85 @@ +#!/usr/bin/awk -f +# +# Copyright (c) 2000 "HOSOKAWA, Tatsumi" <hosokawa@FreeBSD.org> +# Copyright (c) 2002 Ruslan Ermilov <ru@FreeBSD.org> +# 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. +# 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 THE AUTHOR AND CONTRIBUTORS ``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 THE AUTHOR OR CONTRIBUTORS 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, 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. +# +# $FreeBSD: src/release/scripts/driver-copy2.awk,v 1.2 2002/05/25 10:37:00 ru Exp $ +# + +function usage() +{ + print "usage: driver-copy2.awk floppy_number config_file" > "/dev/stderr"; + exit 1; +} + +function err(eval, fmt, what) +{ + printf "driver-copy2.awk: " fmt "\n", what > "/dev/stderr"; + exit eval; +} + +function readconfig() +{ + while ((r = (getline < config)) > 0) { + sub("#.*$", ""); + if (sub(/^[[:alnum:]_]+[ \t]+[[:alnum:]_]+[ \t]+[0-9]+[ \t]+[[:alnum:]_]+[ \t]+\".*\"[ \t]*$/, "&")) { + sub(/[ \t]+/, "#"); + sub(/[ \t]+/, "#"); + sub(/[ \t]+/, "#"); + sub(/[ \t]+/, "#"); + sub(/\"/, ""); + sub(/\"/, ""); + split($0, arg, "#"); + flp[arg[2]] = arg[3]; + dsc[arg[2]] = arg[5]; + } + } + if (r == -1) + err(1, "error reading %s", config); + close(config); +} + +BEGIN { + if (ARGC != 3) + usage(); + + fnum = ARGV[1]; + config = ARGV[2]; + + readconfig(); + + dlist = ""; + for (f in flp) { + if (flp[f] != fnum) + continue; + if (f == "miibus") + miibus = 1; + else + dlist = dlist " " f; + } + if (miibus == 1) + dlist = "miibus " dlist; + print dlist; +} To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208081632.g78GWeq61331>