diff options
author | jkh <jkh@FreeBSD.org> | 1996-10-05 10:44:07 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-10-05 10:44:07 +0000 |
commit | 92667e33135001f59f3590f348b0cd033239741f (patch) | |
tree | de7e4e803c641c7c615731e96f5087efaa04949e /release | |
parent | 89c99ff0c67746646e3d101221de4812c4368afb (diff) | |
download | FreeBSD-src-92667e33135001f59f3590f348b0cd033239741f.zip FreeBSD-src-92667e33135001f59f3590f348b0cd033239741f.tar.gz |
Multiple changes stacked as one commit since they all depend on one another.
First, change sysinstall and the Makefile rules to not build the kernel
nlist directly into sysinstall now. Instead, spit it out as an ascii
file in /stand and parse it from sysinstall later. This solves the chicken-n-
egg problem of building sysinstall into the fsimage before BOOTMFS is built
and can have its symbols extracted. Now we generate the symbol file in
release.8.
Second, add Poul-Henning's USERCONFIG_BOOT changes. These have two
effects:
1. Userconfig is always entered, rather than only after a -c
(don't scream yet, it's not as bad as it sounds).
2. Userconfig reads a message string which can optionally be
written just past the boot blocks. This string "preloads"
the userconfig input buffer and is parsed as user input.
If the first command is not "USERCONFIG", userconfig will
treat this as an implied "quit" (which is why you don't need
to scream - you never even know you went through userconfig
and back out again if you don't specifically ask for it),
otherwise it will read and execute the following commands
until a "quit" is seen or the end is reached, in which case
the normal userconfig command prompt will then be presented.
How to create your own startup sequences, using any boot.flp image
from the next snap forward (not yet, but soon):
% dd of=/dev/rfd0 seek=1 bs=512 count=1 conv=sync <<WAKKA_WAKKA_DOO
USERCONFIG
irq ed0 10
iomem ed0 0xcc000
disable ed1
quit
WAKKA_WAKKA_DOO
Third, add an intro screen to UserConfig so that users aren't just thrown
into this strange screen if userconfig is auto-launched. The default
boot.flp startup sequence is now, in fact, this:
USERCONFIG
intro
visual
(Since visual never returns, we don't need a following "quit").
Submitted-By: phk & jkh
Diffstat (limited to 'release')
-rw-r--r-- | release/Makefile | 44 | ||||
-rw-r--r-- | release/dumpnlist.c (renamed from release/sysinstall/dumpnlist.c) | 10 | ||||
-rw-r--r-- | release/sysinstall/Makefile | 9 | ||||
-rw-r--r-- | release/sysinstall/install.c | 8 | ||||
-rw-r--r-- | release/sysinstall/uc_main.c | 56 |
5 files changed, 78 insertions, 49 deletions
diff --git a/release/Makefile b/release/Makefile index 8f4ad75..f4ff850 100644 --- a/release/Makefile +++ b/release/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.241 1996/10/05 06:10:58 jkh Exp $ +# $Id: Makefile,v 1.242 1996/10/05 07:46:54 jkh Exp $ # # How to roll a release: # @@ -200,8 +200,7 @@ release.3: # You are not supposed to like this :-) release.4: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR - cd ${.CURDIR}/sysinstall && make depend all \ - KERNEL_NAME=${RD}/kernels/BOOTMFS.std + cd ${.CURDIR}/sysinstall && make depend all rm -rf ${RD}/crunch mkdir -p ${RD}/crunch for j in ${WHICH_CRUNCH} ; do \ @@ -357,7 +356,7 @@ release.7: # +-----------------------------------------+ # -release.8: write_mfs_in_kernel +release.8: write_mfs_in_kernel dumpnlist @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR rm -rf ${RD}/mfsfd mkdir ${RD}/mfsfd @@ -378,6 +377,7 @@ release.8: write_mfs_in_kernel echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services gzip -c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd + ./dumpnlist ${RD}/kernels/BOOTMFS.std > ${RD}/mfsfd/stand/symbols # make the small bootfd @echo "Making the small 4MB boot floppy." sh -e ${.CURDIR}/doFS.sh ${RD} ${MNT} ${BOOTMFSSIZE} ${RD}/mfsfd \ @@ -505,6 +505,9 @@ fixit.flp: write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c +dumpnlist: ${.CURDIR}/dumpnlist.c + ${CC} ${CFLAGS} -o dumpnlist ${.CURDIR}/dumpnlist.c + ckRELEASEDIR: .if !defined(RELEASEDIR) @echo "To make a release RELEASEDIR must be defined" && false @@ -550,9 +553,9 @@ doKERNEL: # doMFSKERN: @cd ${.CURDIR} && $(MAKE) ckRELEASEDIR - rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} - rm -f /sys/compile/BOOTMFS/mfs_vfsops.o - cd ${.CURDIR}/../sys/i386/conf && \ + @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} + @rm -f /sys/compile/BOOTMFS/mfs_vfsops.o + @cd ${.CURDIR}/../sys/i386/conf && \ sed -e '/SYSV/d' \ -e '/pty/d' \ -e '/PROCFS/d' \ @@ -561,22 +564,29 @@ doMFSKERN: -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \ echo "options MFS" >> BOOTMFS && \ echo "options NFS_NOSERVER" >> BOOTMFS && \ - echo 'options "MAXCONS=4"' >> BOOTMFS - echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \ + echo 'options "MAXCONS=4"' >> BOOTMFS && \ + echo "options USERCONFIG_BOOT" >> BOOTMFS + @echo "options \"MFS_ROOT=`cat fs-image.${FSIMAGE}.size`\"" >> \ ${.CURDIR}/../sys/i386/conf/BOOTMFS cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS - rm -rf ${RD}/boot.${FSIMAGE} - mkdir ${RD}/boot.${FSIMAGE} - mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} - cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel + @rm -rf ${RD}/boot.${FSIMAGE} + @mkdir ${RD}/boot.${FSIMAGE} + @mv ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} + @cp ${RD}/kernels/BOOTMFS.${FSIMAGE} ${RD}/boot.${FSIMAGE}/kernel ./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 + @mv ${RD}/boot.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE} + @mv ${RD}/boot.${FSIMAGE}/kernel.kz ${RD}/boot.${FSIMAGE}/kernel + @ls -l ${RD}/boot.${FSIMAGE}/kernel + @rm -f ${RD}/floppies/boot${FSIMAGE}.flp cat /usr/mdec/rawboot ${RD}/boot.${FSIMAGE}/kernel | \ dd conv=sync of=${RD}/floppies/boot${FSIMAGE}.flp + @echo 'USERCONFIG' > startup_foo + @echo 'intro' >> startup_foo + @echo 'visual' >> startup_foo + dd if=startup_foo of=${RD}/floppies/boot${FSIMAGE}.flp \ + seek=1 bs=512 count=1 conv=sync + @rm -f startup_foo .include <bsd.prog.mk> diff --git a/release/sysinstall/dumpnlist.c b/release/dumpnlist.c index d78c5c5..31f25c1 100644 --- a/release/sysinstall/dumpnlist.c +++ b/release/dumpnlist.c @@ -4,7 +4,6 @@ #include <stdlib.h> #include <nlist.h> #include <stdio.h> -#include "uc_main.h" struct nlist nl[] = { {"_isa_devtab_bio"}, @@ -35,12 +34,11 @@ main(int ac, char **av) perror("nlist"); return 1; } - fprintf(stdout, "struct nlist nl[] = {\n"); + printf("%d\n", sizeof(nl) / sizeof(struct nlist)); for (i = 0; nl[i].n_name; i++) { - fprintf(stdout, "\t{ \"%s\", %d, %d, %d, %ld },\n", - nl[i].n_name, nl[i].n_type, nl[i].n_other, - nl[i].n_desc, nl[i].n_value); + printf("%s\n", nl[i].n_name); + printf("%d %d %d %ld\n", + nl[i].n_type, nl[i].n_other, nl[i].n_desc, nl[i].n_value); } - fprintf(stdout, "};\n"); return 0; } diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile index 3ec6943..7105795 100644 --- a/release/sysinstall/Makefile +++ b/release/sysinstall/Makefile @@ -1,6 +1,6 @@ PROG= sysinstall NOMAN= yes -CLEANFILES+= makedevs.c rtermcap dumpnlist kern-nlist.h +CLEANFILES+= makedevs.c rtermcap dumpnlist .PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum @@ -22,7 +22,7 @@ DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk -makedevs.c: Makefile rtermcap dumpnlist +makedevs.c: Makefile rtermcap rm -f makedevs.tmp echo '#include <sys/types.h>' > makedevs.tmp ./rtermcap cons25 | \ @@ -47,11 +47,6 @@ makedevs.c: Makefile rtermcap dumpnlist file2c 'const char termcap_vt100[] = {' ',0};' \ >> makedevs.tmp mv makedevs.tmp makedevs.c -.if defined(KERNEL_NAME) - dumpnlist ${KERNEL_NAME} > kern-nlist.h -.else - dumpnlist /kernel > kern-nlist.h -.endif rtermcap: ${.CURDIR}/rtermcap.c ${CC} -o rtermcap ${.CURDIR}/rtermcap.c -ltermcap diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 83f762f..88ec852 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.127 1996/10/04 13:33:43 jkh Exp $ + * $Id: install.c,v 1.128 1996/10/04 14:53:50 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -920,14 +920,12 @@ save_userconfig_to_kernel(char *kern) struct list *c_isa, *c_dev, *b_dev; int i, d; - core = uc_open("-incore"); - if (core < 0) { + if ((core = uc_open("-incore")) == NULL) { msgDebug("Can't read in-core information for kernel.\n"); return; } - boot = uc_open(kern); - if (boot < 0) { + if ((boot = uc_open(kern)) == NULL) { msgDebug("Can't read device information for kernel image %s\n", kern); return; } diff --git a/release/sysinstall/uc_main.c b/release/sysinstall/uc_main.c index 4c8b66c..4ec0810 100644 --- a/release/sysinstall/uc_main.c +++ b/release/sysinstall/uc_main.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * library functions for userconfig library * - * $Id: uc_main.c,v 1.5 1996/10/05 02:12:35 jkh Exp $ + * $Id: uc_main.c,v 1.6 1996/10/05 05:51:12 jkh Exp $ */ #include <sys/types.h> @@ -43,10 +43,7 @@ extern int isDebug(void); extern void msgDebug(char *fmt, ...); -#ifdef KERN_NO_SYMBOLS -#include "kern-nlist.h" -#else -static struct nlist nl[] = { +static struct nlist _nl[] = { {"_isa_devtab_bio"}, {"_isa_devtab_tty"}, {"_isa_devtab_net"}, @@ -63,7 +60,6 @@ static struct nlist nl[] = { {"_scsi_tinit"}, {""}, }; -#endif struct kernel * uc_open(char *name){ @@ -71,12 +67,13 @@ uc_open(char *name){ struct kernel *kern; struct stat sb; char kname[80]; - int i = 0; - + int size, i = 0; + struct nlist *nl = _nl; + if (strcmp(name, "-incore") == 0) incore = 1; else - incore=0; + incore = 0; if (incore || (strcmp(name,"-bootfile") == 0)) strncpy(kname, getbootfile(), 79); @@ -86,11 +83,42 @@ uc_open(char *name){ if (isDebug()) msgDebug("uc_open: kernel name is %s, incore = %d\n", kname, incore); - kern=(struct kernel *)malloc(sizeof(struct kernel)); - + kern = (struct kernel *)malloc(sizeof(struct kernel)); + #ifdef KERN_NO_SYMBOLS if (incore) { - kern->nl = nl; + FILE *fp; + + fp = fopen("/stand/symbols", "r"); + if (!fp) { + msgDebug("Couldn't open /stand/symbols file! Punting.\n"); + free(kern); + return NULL; + } + if (fscanf(fp, "%d\n", &size) != 1) { + msgDebug("Unable to get # of name list entries from symbol file.\n"); + free(kern); + return NULL; + } + nl = (struct nlist *)malloc((size + 1) * sizeof(struct nlist)); + for (i = 0; i < size; i++) { + char name[255]; + + if (fgets(name, 255, fp) == NULL) { + msgDebug("Unable to read symbol name from symbol file.\n"); + free(kern); + return NULL; + } + nl[i].n_name = strdup(name); + if (fscanf(fp, "%d %d %d %ld\n", + &(nl[i].n_type), &(nl[i].n_other), &(nl[i].n_desc), &(nl[i].n_value)) != 4) { + msgDebug("Unable to read symbol detail fields from symbol file, entry = %d\n", i); + free(kern); + return NULL; + } + } + fclose(fp); + kern->nl = nl; i = 0; } else @@ -98,8 +126,8 @@ uc_open(char *name){ i = nlist(kname, nl); if (i == -1) { msgDebug("uc_open: kernel %s does not contain symbols.\n", kname); - kern = (struct kernel *)-5; - return kern; + free(kern); + return NULL; } #ifdef KERN_NO_SYMBOLS if (!incore) { |