tech-toolchain archive

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

Re: Help with src/distrib



ad%NetBSD.org@localhost wrote:

> The part I am stuck with is hooking it into the build, so that the module
> gets built and put onto the root of the install CD-ROMs. The collection of
> Makefiles under src/distrib is impenetrable to me.. Does anyone have
> experience with this?

Like this? (a bit ugly though; maybe we should ask lukem)
---
Izumi Tsutsui


Index: common/Makefile.image
===================================================================
RCS file: /cvsroot/src/distrib/common/Makefile.image,v
retrieving revision 1.29
diff -u -r1.29 Makefile.image
--- common/Makefile.image       27 Jun 2005 19:10:32 -0000      1.29
+++ common/Makefile.image       2 May 2008 19:01:59 -0000
@@ -136,5 +136,30 @@
 
 .endif # ! defined(IMAGETAR)                                   # }
 
+.if defined(IMAGEKMOD)                                         # {
+
+MINIROOTKMODOBJDIR!=   cd ${NETBSDSRCDIR}/sys/modules/miniroot \
+                       && ${PRINTOBJDIR}
+MINIROOTKMOD=          ${MINIROOTKMODOBJDIR}/miniroot.kmod
+
+${IMAGEKMOD}: ${IMAGE}
+       ${_MKTARGET_CREATE}
+       -rm -f ${.TARGET}
+       ${OBJCOPY} --add-section miniroot=${IMAGE} \
+           --set-section-flags miniroot=alloc,contents,load,data \
+           ${MINIROOTKMOD} ${.TARGET}.tmp \
+       && mv ${.TARGET}.tmp ${.TARGET}
+
+realall: ${IMAGEKMOD}
+
+CLEANFILES+=   ${IMAGEKMOD} ${IMAGEKMOD}.tmp
+
+.if defined(IMAGEKMOD_RELEASEDIR)
+release:: check_RELEASEDIR .WAIT ${IMAGEKMOD}
+       ${RELEASE_INSTALL} ${IMAGEKMOD} \
+           ${RELEASEDIR}/${MACHINE}/${IMAGEKMOD_RELEASEDIR}
+.endif
+
+.endif # defined(IMAGEKMOD)                                    # }
 
 .endif # _MAKEFILE_IMAGE_
Index: i386/cdroms/Makefile.cdrom
===================================================================
RCS file: /cvsroot/src/distrib/i386/cdroms/Makefile.cdrom,v
retrieving revision 1.4
diff -u -r1.4 Makefile.cdrom
--- i386/cdroms/Makefile.cdrom  30 Apr 2008 15:29:11 -0000      1.4
+++ i386/cdroms/Makefile.cdrom  2 May 2008 19:01:59 -0000
@@ -1,5 +1,11 @@
 # $NetBSD: Makefile.cdrom,v 1.4 2008/04/30 15:29:11 ad Exp $
 
+.include <bsd.own.mk>
+
 CDMAKEFSOPTIONS= bootimage=i386;bootxx.${MACHINE},no-emul-boot
-CDINSTKERNEL= ../../instkernel
-CDKERNELS=     netbsd-INSTALL.gz       netbsd  # from ../instkernel
+CDINSTKERNEL=  ../../instkernel
+CDKERNELS=     netbsd-GENERIC.gz       netbsd
+
+MINIROOT=      ramdisk-big
+MINIROOTOBJ!=  cd ${.CURDIR}/../../ramdisks/${MINIROOT} && ${PRINTOBJDIR}
+MINIROOTKMOD=  ${MINIROOTOBJ}/${MINIROOT}.kmod
Index: i386/cdroms/bootcd/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/i386/cdroms/bootcd/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- i386/cdroms/bootcd/Makefile 23 Feb 2008 17:52:14 -0000      1.4
+++ i386/cdroms/bootcd/Makefile 2 May 2008 19:01:59 -0000
@@ -8,6 +8,9 @@
 CLEANFILES+=   boot.cfg
 
 prepare_md_post:
-       ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < ${.CURDIR}/boot.cfg.in > 
boot.cfg
+       ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < ${.CURDIR}/boot.cfg.in \
+           > boot.cfg
+       ${HOST_INSTALL_FILE} -m ${NONBINMODE} \
+           ${MINIROOTKMOD} cdrom/miniroot.kmod
 
 .include "${.CURDIR}/../../../common/Makefile.bootcd"
Index: i386/cdroms/bootcd-com/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/i386/cdroms/bootcd-com/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- i386/cdroms/bootcd-com/Makefile     23 Feb 2008 17:52:14 -0000      1.4
+++ i386/cdroms/bootcd-com/Makefile     2 May 2008 19:01:59 -0000
@@ -10,6 +10,9 @@
 CLEANFILES+=   boot.cfg
 
 prepare_md_post:
-       ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < 
${.CURDIR}/../bootcd/boot.cfg.in > boot.cfg
+       ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" \
+           < ${.CURDIR}/../bootcd/boot.cfg.in > boot.cfg
+       ${HOST_INSTALL_FILE} -m ${NONBINMODE} \
+           ${MINIROOTKMOD} cdrom/miniroot.kmod
 
 .include "${.CURDIR}/../../../common/Makefile.bootcd"
Index: i386/cdroms/installcd/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/i386/cdroms/installcd/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- i386/cdroms/installcd/Makefile      23 Nov 2007 16:21:22 -0000      1.4
+++ i386/cdroms/installcd/Makefile      2 May 2008 19:01:59 -0000
@@ -12,6 +12,9 @@
 CLEANFILES+=   boot.cfg
 
 prepare_md_post:
-       ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < ${.CURDIR}/boot.cfg.in > 
boot.cfg
+       ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" \
+           < ${.CURDIR}/boot.cfg.in > boot.cfg
+       ${HOST_INSTALL_FILE} -m ${NONBINMODE} \
+           ${MINIROOTKMOD} cdrom/miniroot.kmod
 
 .include "${.CURDIR}/../../../common/Makefile.bootcd"
Index: i386/instkernel/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/i386/instkernel/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- i386/instkernel/Makefile    30 Apr 2008 15:29:11 -0000      1.10
+++ i386/instkernel/Makefile    2 May 2008 19:01:59 -0000
@@ -41,4 +41,30 @@
 
 .include "${DISTRIBDIR}/common/Makefile.mdset"
 
+KERN_TARGETS=  GENERIC -
+
+.for _K _F in ${KERN_TARGETS}
+_KERNEL:=${_K}
+.if (${_KERNEL:M*/*} != "")
+_KERNNAME.${_K}.${_F}:= ${_K}
+.else
+_KERNNAME.${_K}.${_F}:=        ${KERNOBJDIR}/${_K}/netbsd
+.endif
+
+_FILENAME:=${_F}
+.if ${_FILENAME} == "-"
+_KERNEL.${_K}.${_F}:=   netbsd-${_K}
+.else
+_KERNEL.${_K}.${_F}:=   ${_F}
+.endif
+
+${_KERNEL.${_K}.${_F}}.gz: ${_KERNNAME.${_K}.${_F}}
+       ${_MKTARGET_CREATE}
+       -rm -f ${.TARGET}
+       gzip -9c ${.ALLSRC} > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}
+
+CLEANFILES+=    ${_KERNEL.${_K}.${_F}}.gz ${_KERNEL.${_K}.${_F}}.tmp
+
+.endfor
+
 .include <bsd.prog.mk>
Index: i386/ramdisks/ramdisk-big/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/i386/ramdisks/ramdisk-big/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- i386/ramdisks/ramdisk-big/Makefile  2 Jun 2006 22:11:07 -0000       1.1
+++ i386/ramdisks/ramdisk-big/Makefile  2 May 2008 19:01:59 -0000
@@ -2,6 +2,7 @@
 
 BOOTMODEL=     big
 IMAGE=         ramdisk-${BOOTMODEL}.fs
+IMAGEKMOD=     ramdisk-${BOOTMODEL}.kmod
 IMAGESIZE=     5000k
 IMAGEDEPENDS=  disktab.preinstall \
                ${NETBSDSRCDIR}/usr.sbin/dhcp/clientscript/dhclient-script

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index