Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sysinst installs .bin kernel



On Thu, Dec 14, 2017 at 03:32:37PM +0100, Harold Gutch wrote:
> On Thu, Dec 14, 2017 at 02:13:39PM +0000, Nick Hudson wrote:
> > On 14/12/2017 14:07, Harold Gutch wrote:
> > >Also, can the .bin kernel even be removed completely?  I suppose
> > >having the ELF kernel in / might be useful, but right now
> > >kern-RPI*.tgz contains three kernels (.bin, .img, ELF) and I am not
> > >sure if there still is a point at all in keeping the .bin kernel
> > >around after the corresponding .img is built.
> > 
> > Pretty sure the .bin can die - it's a build step only now.
> 
> OK, so perhaps something as simple as a
> 
>   && ${RM} ${.TARGET:R}.bin
> 
> (untested!) in src/distrib/evbarm/instkernel/instkernel at the end of
> the create-img definition would already do.

The attached patch seems to work (tested with a source tree from
Dec 14), the .bin files are removed directly after creating the .img
files and only the .img and the ELF kernel are kept.


  Harold
--- src/distrib/evbarm/instkernel/instkernel/Makefile	14 Dec 2017 06:29:15 -0000
+++ src/distrib/evbarm/instkernel/instkernel/Makefile	20 Dec 2017 09:05:43 -0000
@@ -14,7 +14,7 @@
 .for i in ${BUILD_KERNELS:M*_INSTALL}
 .if ${i} == "RPI_INSTALL" || ${i} == "RPI2_INSTALL"
 MDSETTARGETS+=		${i}	${SSHRAMDISK}	netbsd-${i}
-MDSET_SUFFIXES.netbsd-${i}=	bin create-bin  img create-img
+MDSET_SUFFIXES.netbsd-${i}=	img create-img
 .else
 MDSETTARGETS+=		${i}	${RAMDISK}	-
 .endif
@@ -26,8 +26,10 @@
 create-srec=		${OBJCOPY} -O srec ${.TARGET:R} ${.TARGET}
 create-bin=		${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET}
 create-img=	\
+	${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET:R}.bin && \
 	${HOST_SH} ${NETBSDSRCDIR}/sys/arch/evbarm/compile/rpi-mkknlimg.sh \
-	${.TARGET:R}.bin ${.TARGET}
+	${.TARGET:R}.bin ${.TARGET} && \
+	rm ${.TARGET:R}.bin
 
 .include "${DISTRIBDIR}/common/Makefile.mdset"
 
--- src/sys/arch/evbarm/conf/mk.rpi	10 Dec 2017 21:38:26 -0000
+++ src/sys/arch/evbarm/conf/mk.rpi	19 Dec 2017 22:06:06 -0000
@@ -16,6 +16,8 @@
 	echo ${OBJCOPY} -S -O binary $@ $@.bin; \
 	${OBJCOPY} -S -O binary $@ $@.bin; \
 	echo ${MKKNLIMG} $@.bin $@.img; \
-	${HOST_SH} ${MKKNLIMG} $@.bin $@.img;
+	${HOST_SH} ${MKKNLIMG} $@.bin $@.img; \
+	echo rm $@.bin; \
+	rm $@.bin;
 
 EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.img@}


Home | Main Index | Thread Index | Old Index