diff options
author | grog <grog@FreeBSD.org> | 1999-04-07 09:28:03 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-04-07 09:28:03 +0000 |
commit | 23a589f45ba719ddb3d051d5c71098c19b10c4df (patch) | |
tree | 89b714bfc94b5697e0e0889c16dbdba2b16e229b /sys/conf | |
parent | 68437b1a0e8b58742a74cd819278c2cd5f520bb3 (diff) | |
download | FreeBSD-src-23a589f45ba719ddb3d051d5c71098c19b10c4df.zip FreeBSD-src-23a589f45ba719ddb3d051d5c71098c19b10c4df.tar.gz |
1. Modify config to issue different code for debugging.
2. Config complains if you use -g:
Debugging is enabled by default, there is no ned to specify the -g option
3. Config warns you if you don't use -s:
Building kernel with full debugging symbols. Do
"config -s BSD" for historic partial symbolic support.
To install the debugging kernel, do make install.debug
(BSD was the name of the config file I used; I print out the same
name).
4. Modify Makefile.i386, Makefile.alpha, Makefile.pc98 and config to
work if a kernel name other than 'kernel' is specified. This is
not absolutely necessary, but useful, and it was relatively easy.
I now have a kernel called /crapshit :-)
5. Modify Makefile.i386, Makefile.alpha, Makefile.pc98 "clean" target
to remove both the debug and normal kernel.
6. Modify all to install the stripped kernel by default and the debug
kernel if you enter "make install.debug".
7. Update version number of Makefiles and config.
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/Makefile.alpha | 46 | ||||
-rw-r--r-- | sys/conf/Makefile.i386 | 56 | ||||
-rw-r--r-- | sys/conf/Makefile.pc98 | 56 | ||||
-rw-r--r-- | sys/conf/Makefile.powerpc | 56 |
4 files changed, 162 insertions, 52 deletions
diff --git a/sys/conf/Makefile.alpha b/sys/conf/Makefile.alpha index e2ccd56..0253ae3 100644 --- a/sys/conf/Makefile.alpha +++ b/sys/conf/Makefile.alpha @@ -1,7 +1,7 @@ # Makefile.alpha -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.alpha 7.1 5/10/91 -# $Id: Makefile.alpha,v 1.17 1999/02/02 18:34:23 dfr Exp $ +# $Id: Makefile.alpha,v 1.18 1999/02/14 13:56:15 des Exp $ # # Makefile for FreeBSD # @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300009 +%VERSREQ= 300010 BINFORMAT?= elf @@ -103,9 +103,9 @@ ${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h} .endif clean: - rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ - makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ - vers.c vnode_if.c vnode_if.h ${CLEAN} + rm -f *.o *.s eddep errs genassym gensetdefs ${KERNEL} ${FULLKERNEL} \ + linterrs makelinks param.c setdefs.h symbols.exclude \ + symbols.sort tags vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ @@ -245,23 +245,43 @@ links: tags: @echo "see $S/kern/Makefile for tags" -install: - @if [ ! -f kernel ] ; then \ +.if defined(DEBUG) +install: ${KERNEL} +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +.endif + PATH=$${PATH}:/sbin:/usr/sbin; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ + if [ -f /var/db/kvm_kernel.db ] ; then \ + mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ + fi \ + fi + install -c -m 555 -o root -g wheel -fschg ${KERNEL} ${DESTDIR}/ + +${KERNEL}: ${KERNEL}.debug + objcopy --strip-debug ${KERNEL}.debug ${KERNEL} + +.endif + +${INSTALL}: + @if [ ! -f ${FULLKERNEL} ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi -.if exists(${DESTDIR}/kernel) - -chflags noschg ${DESTDIR}/kernel - mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ - if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ - sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi - install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ + install -c -m 555 -o root -g wheel -fschg ${FULLKERNEL} ${DESTDIR}/${KERNEL} ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h ${CC} -c ${CFLAGS} ioconf.c diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index 36b9790..6e1b831 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -1,7 +1,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.140 1999/03/01 09:54:51 dt Exp $ +# $Id: Makefile.i386,v 1.141 1999/03/11 18:28:41 dg Exp $ # # Makefile for FreeBSD # @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300009 +%VERSREQ= 300010 KERNFORMAT?= elf @@ -123,8 +123,8 @@ ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} clean: rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \ - kernel linterrs makelinks param.c setdef[01].c setdefs.h \ - symbols.exclude symbols.sort tags \ + ${KERNEL} ${FULLKERNEL} linterrs makelinks param.c \ + setdef[01].c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c @@ -204,13 +204,43 @@ links: tags: @echo "see $S/kern/Makefile for tags" -install: - @if [ ! -f kernel ] ; then \ +.if defined(DEBUG) +install: ${KERNEL} +.if ${KERNFORMAT} == "elf" && !defined(FORCE) + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ + echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ + echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ + echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ + echo "http://www.freebsd.org/~peter/elfday.html for information." ; \ + echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \ + exit 1 ; \ + fi +.endif +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +.endif + PATH=$${PATH}:/sbin:/usr/sbin; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ + if [ -f /var/db/kvm_kernel.db ] ; then \ + mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ + fi \ + fi + install -c -m 555 -o root -g wheel -fschg ${KERNEL} ${DESTDIR}/ + +${KERNEL}: ${KERNEL}.debug + objcopy --strip-debug ${KERNEL}.debug ${KERNEL} + +.endif + +${INSTALL}: + @if [ ! -f ${FULLKERNEL} ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi .if ${KERNFORMAT} == "elf" && !defined(FORCE) - @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \ + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ @@ -219,18 +249,18 @@ install: exit 1 ; \ fi .endif -.if exists(${DESTDIR}/kernel) - -chflags noschg ${DESTDIR}/kernel - mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ - if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ - sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi - install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ + install -c -m 555 -o root -g wheel -fschg ${FULLKERNEL} ${DESTDIR}/${KERNEL} config.o: ${NORMAL_C} diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98 index d427328..a90547d 100644 --- a/sys/conf/Makefile.pc98 +++ b/sys/conf/Makefile.pc98 @@ -3,7 +3,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.pc98,v 1.56 1999/03/02 14:01:33 kato Exp $ +# $Id: Makefile.pc98,v 1.57 1999/03/13 13:18:00 kato Exp $ # # Makefile for FreeBSD # @@ -19,7 +19,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300009 +%VERSREQ= 300010 KERNFORMAT?= elf @@ -126,8 +126,8 @@ ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} clean: rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \ - kernel linterrs makelinks param.c setdef[01].c setdefs.h \ - symbols.exclude symbols.sort tags \ + ${KERNEL} ${FULLKERNEL} linterrs makelinks param.c \ + setdef[01].c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c @@ -208,13 +208,43 @@ links: tags: @echo "see $S/kern/Makefile for tags" -install: - @if [ ! -f kernel ] ; then \ +.if defined(DEBUG) +install: ${KERNEL} +.if ${KERNFORMAT} == "elf" && !defined(FORCE) + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ + echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ + echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ + echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ + echo "http://www.freebsd.org/~peter/elfday.html for information." ; \ + echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \ + exit 1 ; \ + fi +.endif +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +.endif + PATH=$${PATH}:/sbin:/usr/sbin; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ + if [ -f /var/db/kvm_kernel.db ] ; then \ + mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ + fi \ + fi + install -c -m 555 -o root -g wheel -fschg ${KERNEL} ${DESTDIR}/ + +${KERNEL}: ${KERNEL}.debug + objcopy --strip-debug ${KERNEL}.debug ${KERNEL} + +.endif + +${INSTALL}: + @if [ ! -f ${FULLKERNEL} ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi .if ${KERNFORMAT} == "elf" && !defined(FORCE) - @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \ + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ @@ -223,18 +253,18 @@ install: exit 1 ; \ fi .endif -.if exists(${DESTDIR}/kernel) - -chflags noschg ${DESTDIR}/kernel - mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ - if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ - sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi - install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ + install -c -m 555 -o root -g wheel -fschg ${FULLKERNEL} ${DESTDIR}/${KERNEL} config.o: ${NORMAL_C} diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index 36b9790..6e1b831 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -1,7 +1,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.140 1999/03/01 09:54:51 dt Exp $ +# $Id: Makefile.i386,v 1.141 1999/03/11 18:28:41 dg Exp $ # # Makefile for FreeBSD # @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300009 +%VERSREQ= 300010 KERNFORMAT?= elf @@ -123,8 +123,8 @@ ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} clean: rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \ - kernel linterrs makelinks param.c setdef[01].c setdefs.h \ - symbols.exclude symbols.sort tags \ + ${KERNEL} ${FULLKERNEL} linterrs makelinks param.c \ + setdef[01].c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c @@ -204,13 +204,43 @@ links: tags: @echo "see $S/kern/Makefile for tags" -install: - @if [ ! -f kernel ] ; then \ +.if defined(DEBUG) +install: ${KERNEL} +.if ${KERNFORMAT} == "elf" && !defined(FORCE) + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ + echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ + echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ + echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ + echo "http://www.freebsd.org/~peter/elfday.html for information." ; \ + echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \ + exit 1 ; \ + fi +.endif +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +.endif + PATH=$${PATH}:/sbin:/usr/sbin; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ + if [ -f /var/db/kvm_kernel.db ] ; then \ + mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ + fi \ + fi + install -c -m 555 -o root -g wheel -fschg ${KERNEL} ${DESTDIR}/ + +${KERNEL}: ${KERNEL}.debug + objcopy --strip-debug ${KERNEL}.debug ${KERNEL} + +.endif + +${INSTALL}: + @if [ ! -f ${FULLKERNEL} ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi .if ${KERNFORMAT} == "elf" && !defined(FORCE) - @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \ + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ @@ -219,18 +249,18 @@ install: exit 1 ; \ fi .endif -.if exists(${DESTDIR}/kernel) - -chflags noschg ${DESTDIR}/kernel - mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ - if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ - sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi - install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ + install -c -m 555 -o root -g wheel -fschg ${FULLKERNEL} ${DESTDIR}/${KERNEL} config.o: ${NORMAL_C} |