Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2000 01:40:02 -0800 (PST)
From:      Johan Karlsson <k@numeri.campus.luth.se>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/17536: KERNEL used both by Makefile.inc1 and  Makefile.${MACHINE}
Message-ID:  <200003290940.BAA41550@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/17536; it has been noted by GNATS.

From: Johan Karlsson <k@numeri.campus.luth.se>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/17536: KERNEL used both by Makefile.inc1 and 
 Makefile.${MACHINE}
Date: Wed, 29 Mar 2000 11:34:08 +0200

 Hi
 
 I was asked to describe how the 'How-to-repeat' case bahaivs with my patch 
 aplied.
 
 I have run the build/install-kernel target w/o and w/ the patch.
 I have also run both targets with a new version of the patch that also alows 
 one to install multiple kernels (see patch below).
  
 
 And as one can see below:
 
 w/o the patch the two kernels are linked twice, one time for each name in 
 $KERNEL and the install fails.
 
 w/ the patch each kernel is linked only once with its proper name and the 
 first kernel is installed.
 
 w/ the new patch each kernel is linked only once and _both_ kernels are 
 installed.
 
 /Johan K
 
 
 w/o the patch
 ================
 numeri# make KERNEL='GENERIC NEWCARD' buildkernel > & org.build
 numeri# ls /GENERIC /NEWCARD
 ls: /GENERIC: No such file or directory
 ls: /NEWCARD: No such file or directory
 numeri# make KERNEL='GENERIC NEWCARD' installkernel > & org.inst
 numeri# ls /GENERIC /NEWCARD
 ls: /GENERIC: No such file or directory
 ls: /NEWCARD: No such file or directory
 numeri# cat org.build
 --------------------------------------------------------------
 >>> Rebuilding kernel(s)
 --------------------------------------------------------------
 ===> GENERIC
 
 [ CUT ]
 
 sh /usr/src/sys/conf/newvers.sh GENERIC 
 cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions 
 -ansi  -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/../include  -D_KERNEL 
 -include opt_global.h -elf  -mpreferred-stack-boundary=2  vers.c
 linking GENERIC
    text	   data	    bss	    dec	    hex	filename
 2197157	 161496	 126200	2484853	 25ea75	GENERIC
 linking NEWCARD
    text	   data	    bss	    dec	    hex	filename
 2197157	 161496	 126200	2484853	 25ea75	NEWCARD
 ===> NEWCARD
 
 [ CUT ]
 
 sh /usr/src/sys/conf/newvers.sh NEWCARD 
 cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions 
 -ansi  -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/../include  -D_KERNEL 
 -include opt_global.h -elf  -mpreferred-stack-boundary=2  vers.c
 linking GENERIC
    text	   data	    bss	    dec	    hex	filename
 2040750	 155408	 118776	2314934	 2352b6	GENERIC
 linking NEWCARD
    text	   data	    bss	    dec	    hex	filename
 2040750	 155408	 118776	2314934	 2352b6	NEWCARD
 numeri# cat org.inst 
 cd /usr/obj/usr/src/sys/GENERIC;  MAKEOBJDIRPREFIX=/usr/obj  
 COMPILER_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/obj/usr/src/i386/usr/bin  
 LIBRARY_PATH=/usr/obj/usr/src/i386/usr/lib:/usr/obj/usr/src/i386/usr/lib  
 OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec  PERL5LIB=/usr/obj/usr/src/i38
 6/usr/libdata/perl/5.00503 MACHINE=i386 make install
 [: NEWCARD: unexpected operator
 install -c -m 555 -o root -g wheel -fschg  GENERIC NEWCARD /GENERIC NEWCARD
 usage: install [-CcDpsv] [-f flags] [-g group] [-m mode] [-o owner] file1 file2
        install [-CcDpsv] [-f flags] [-g group] [-m mode] [-o owner] file1 ...
              fileN directory
        install -d [-v] [-g group] [-m mode] [-o owner] directory ...
 *** Error code 64
 
 Stop in /usr/obj/usr/src/sys/GENERIC.
 *** Error code 1
 
 Stop in /usr/src.
 *** Error code 1
 
 Stop in /usr/src.
 numeri#
 ================
 
 w/ the patch
 ================
 numeri# make KERNELS=GENERIC NEWCARD buildkernel >& new.build
 numeri# ls /GENERIC /NEWCARD
 ls: /GENERIC: No such file or directory
 ls: /NEWCARD: No such file or directory
 numeri# make KERNELS='GENERIC NEWCARD' installkernel > & new.inst
 numeri# ls /GENERIC /NEWCARD
 ls: /NEWCARD: No such file or directory
 /GENERIC
 numeri# cat new.build
 --------------------------------------------------------------
 >>> Rebuilding kernel(s)
 --------------------------------------------------------------
 ===> GENERIC
 
 [ CUT ]
 
 sh /usr/src/sys/conf/newvers.sh GENERIC 
 cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions 
 -ansi  -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/../include  -D_KERNEL 
 -include opt_global.h -elf  -mpreferred-stack-boundary=2  vers.c
 linking GENERIC
    text	   data	    bss	    dec	    hex	filename
 2197157	 161496	 126200	2484853	 25ea75	GENERIC
 ===> NEWCARD
 
 [ CUT ]
 
 sh /usr/src/sys/conf/newvers.sh NEWCARD 
 cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions 
 -ansi  -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/../include  -D_KERNEL 
 -include opt_global.h -elf  -mpreferred-stack-boundary=2  vers.c
 linking NEWCARD
    text	   data	    bss	    dec	    hex	filename
 2040750	 155408	 118776	2314934	 2352b6	NEWCARD
 numeri# cat new.inst
 cd /usr/obj/usr/src/sys/GENERIC;  MAKEOBJDIRPREFIX=/usr/obj  
 COMPILER_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/obj/usr/src/i386/usr/bin  
 LIBRARY_PATH=/usr/obj/usr/src/i386/usr/lib:/usr/obj/usr/src/i386/usr/lib  
 OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec  PERL5LIB=/usr/obj/usr/src/i38
 6/usr/libdata/perl/5.00503 MACHINE=i386 KERNEL=GENERIC  make install
 install -c -m 555 -o root -g wheel -fschg  GENERIC /GENERIC
 numeri#
 ================
 
 
 
 
 w/ new patch below
 ==================
 numeri# make KERNELS=GENERIC NEWCARD buildkernel >& new2.build
 numeri# ls /GENERIC /NEWCARD
 ls: /GENERIC: No such file or directory
 ls: /NEWCARD: No such file or directory
 numeri# make KERNELS='GENERIC NEWCARD' installkernel > & new2.inst
 numeri# ls /GENERIC /NEWCARD
 /GENERIC        /NEWCARD
 numeri# cat new2.build
 --------------------------------------------------------------
 >>> Rebuilding kernel(s)
 --------------------------------------------------------------
 ===> GENERIC
 
 [ CUT ]
 
 sh /usr/src/sys/conf/newvers.sh GENERIC 
 cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions 
 -ansi  -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/../include  -D_KERNEL 
 -include opt_global.h -elf  -mpreferred-stack-boundary=2  vers.c
 linking GENERIC
    text	   data	    bss	    dec	    hex	filename
 2197157	 161496	 126200	2484853	 25ea75	GENERIC
 ===> NEWCARD
 
 [ CUT ]
 
 sh /usr/src/sys/conf/newvers.sh NEWCARD 
 cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions 
 -ansi  -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/../include  -D_KERNEL 
 -include opt_global.h -elf  -mpreferred-stack-boundary=2  vers.c
 linking NEWCARD
    text	   data	    bss	    dec	    hex	filename
 2040750	 155408	 118776	2314934	 2352b6	NEWCARD
 numeri# cat new2.inst
 --------------------------------------------------------------
 >>> Installing kernel(s)
 --------------------------------------------------------------
 ===> GENERIC
 cd /usr/obj/usr/src/sys/GENERIC ; MAKEOBJDIRPREFIX=/usr/obj  
 COMPILER_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/obj/usr/src/i386/usr/bin  
 LIBRARY_PATH=/usr/obj/usr/src/i386/usr/lib:/usr/obj/usr/src/i386/usr/lib  
 OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec  PERL5LIB=/usr/obj/usr/src/i38
 6/usr/libdata/perl/5.00503 MACHINE=i386 KERNEL=GENERIC  make install
 install -c -m 555 -o root -g wheel -fschg  GENERIC /GENERIC
 ===> NEWCARD
 cd /usr/obj/usr/src/sys/NEWCARD ; MAKEOBJDIRPREFIX=/usr/obj  
 COMPILER_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/obj/usr/src/i386/usr/bin  
 LIBRARY_PATH=/usr/obj/usr/src/i386/usr/lib:/usr/obj/usr/src/i386/usr/lib  
 OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr/libexec  PERL5LIB=/usr/obj/usr/src/i38
 6/usr/libdata/perl/5.00503 MACHINE=i386 KERNEL=NEWCARD  make install
 install -c -m 555 -o root -g wheel -fschg  NEWCARD /NEWCARD
 numeri #
 ==================
 
 
 
 New patch
 ==================
 --- Makefile.inc1.orig	Thu Mar  9 07:28:19 2000
 +++ Makefile.inc1	Tue Mar 28 20:09:57 2000
 @@ -328,7 +328,7 @@
  # buildkernel and installkernel
  #
  # Which kernels to build and/or install is specified by setting
 -# KERNEL. If not defined a GENERIC kernel is built/installed.
 +# KERNELS. If not defined a GENERIC kernel is built/installed.
  # Only the existing (depending MACHINE) config files are used
  # for building kernels and only the first of these is designated
  # as the one being installed.
 @@ -338,7 +338,7 @@
  # be set to cross-build, we have to make sure MACHINE is set
  # properly.
  
 -KERNEL?=	GENERIC GENERIC98
 +KERNELS?=	GENERIC GENERIC98
  
  # The only exotic MACHINE_ARCH/MACHINE combination valid at this
  # time is i386/pc98. In all other cases set MACHINE equal to
 @@ -356,13 +356,11 @@
  .endif
  
  BUILDKERNELS=
 -INSTALLKERNEL=
 -.for _kernel in ${KERNEL}
 +INSTALLKERNELS=
 +.for _kernel in ${KERNELS}
  .if exists(${KRNLCONFDIR}/${_kernel})
  BUILDKERNELS+=	${_kernel}
 -.if empty(INSTALLKERNEL)
 -INSTALLKERNEL= ${_kernel}
 -.endif
 +INSTALLKERNELS+= ${_kernel}
  .endif
  .endfor
  
 @@ -384,8 +382,10 @@
  	cd ${KRNLOBJDIR}/${_kernel}; \
  		MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
  		    ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \
 -		${WMAKEENV} MACHINE=${MACHINE} ${MAKE} depend; \
 -		${WMAKEENV} MACHINE=${MACHINE} ${MAKE} all
 +		${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
 +		    ${MAKE} depend; \
 +		${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
 +		    ${MAKE} all
  .endfor
  
  #
 @@ -394,8 +394,16 @@
  # Install the kernel defined by INSTALLKERNEL
  #
  installkernel:
 -	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
 -		${IMAKEENV} MACHINE=${MACHINE} ${MAKE} install
 +	@echo
 +	@echo "--------------------------------------------------------------"
 +	@echo ">>> Installing kernel(s)"
 +	@echo "--------------------------------------------------------------"
 +.for _kernel in ${INSTALLKERNELS}
 +	@echo "===> ${_kernel}"
 +	cd ${KRNLOBJDIR}/${_kernel} ;\
 +		${IMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
 +		    ${MAKE} install
 +.endfor
  
  #
  # update
 ==================
 
 
 
 
 
 
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003290940.BAA41550>