Source-Changes-HG archive

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

[src/trunk]: src/distrib 2nd try: make amd64, i386, sparc64 and vax iso image...



details:   https://anonhg.NetBSD.org/src/rev/80fe2fb3037a
branches:  trunk
changeset: 338455:80fe2fb3037a
user:      martin <martin%NetBSD.org@localhost>
date:      Mon May 25 15:38:33 2015 +0000

description:
2nd try: make amd64, i386, sparc64 and vax iso images use full sets.
While there fix an old bug that makefs used the build hosts /etc/group
and passwd information when creating the image.
Thanks to Andreas Gustafsson for extensive testing.

diffstat:

 distrib/amd64/cdroms/Makefile.cdrom       |   55 +--------------
 distrib/common/Makefile.bootcd            |  109 ++++++++++++++++++++++++-----
 distrib/i386/cdroms/Makefile.cdrom        |   55 +--------------
 distrib/sparc64/cdroms/installcd/Makefile |   66 +-----------------
 distrib/vax/cdroms/installcd/Makefile     |   69 +------------------
 5 files changed, 101 insertions(+), 253 deletions(-)

diffs (truncated from 558 to 300 lines):

diff -r c0e7dcee461b -r 80fe2fb3037a distrib/amd64/cdroms/Makefile.cdrom
--- a/distrib/amd64/cdroms/Makefile.cdrom       Mon May 25 15:04:01 2015 +0000
+++ b/distrib/amd64/cdroms/Makefile.cdrom       Mon May 25 15:38:33 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.16 2015/05/24 09:33:20 martin Exp $
+# $NetBSD: Makefile.cdrom,v 1.17 2015/05/25 15:38:33 martin Exp $
 
 .include <bsd.own.mk>
 
@@ -11,59 +11,8 @@
 CDKERNELS=     netbsd-GENERIC.gz       netbsd
 CDRELEASE_NOISOS=      true
 
-CDRUNTIME+=    ./bin
-CDRUNTIME+=    ./dev/MAKEDEV
-CDRUNTIME+=    ./etc
-CDRUNTIME+=    ./lib
-CDRUNTIME+=    ./libdata
-CDRUNTIME+=    ./libexec
-CDRUNTIME+=    ./mnt
-CDRUNTIME+=    ./sbin
-CDRUNTIME+=    ./stand
-CDRUNTIME+=    ./tmp
-CDRUNTIME+=    ./usr/bin/ftp
-CDRUNTIME+=    ./usr/bin/grep
-CDRUNTIME+=    ./usr/bin/gzip
-CDRUNTIME+=    ./usr/bin/less
-CDRUNTIME+=    ./usr/bin/more
-CDRUNTIME+=    ./usr/bin/netstat
-CDRUNTIME+=    ./usr/bin/progress
-CDRUNTIME+=    ./usr/bin/sed
-CDRUNTIME+=    ./usr/bin/sort
-CDRUNTIME+=    ./usr/bin/tip
-CDRUNTIME+=    ./usr/bin/tput
-CDRUNTIME+=    ./usr/bin/vi
-CDRUNTIME+=    ./usr/bin/vmstat
-.if ${MKBSDTAR} != "no"
-CDRUNTIME+=    ./usr/lib/libarchive.so*
-.endif
-CDRUNTIME+=    ./usr/lib/libbz2.so*
-CDRUNTIME+=    ./usr/lib/libc.so*
-CDRUNTIME+=    ./usr/lib/libcurses.so*
-CDRUNTIME+=    ./usr/lib/libedit.so*
-CDRUNTIME+=    ./usr/lib/libgcc_s.so*
-CDRUNTIME+=    ./usr/lib/libintl.so*
-CDRUNTIME+=    ./usr/lib/libkvm.so*
-CDRUNTIME+=    ./usr/lib/liblzma.so*
-CDRUNTIME+=    ./usr/lib/libpthread.so*
-CDRUNTIME+=    ./usr/lib/libterminfo.so*
-CDRUNTIME+=    ./usr/lib/libutil.so*
-CDRUNTIME+=    ./usr/lib/libz.so*
-.if (${MKCRYPTO} != "no")
-CDRUNTIME+=    ./usr/lib/libcrypto.so*
-CDRUNTIME+=    ./usr/lib/libssl.so*
-.endif
-CDRUNTIME+=    ./usr/libexec/ld.elf_so
-CDRUNTIME+=    ./usr/libexec/getty
-CDRUNTIME+=    ./usr/mdec
-CDRUNTIME+=    ./usr/sbin/chroot
-CDRUNTIME+=    ./usr/sbin/installboot
-CDRUNTIME+=    ./usr/sbin/wiconfig
-CDRUNTIME+=    ./usr/share/misc/terminfo.cdb
-CDRUNTIME+=    ./usr/share/locale
-
 image_md_pre:
-       ${MKDIR} cdrom/etc
+       ${RM} -f cdrom/etc/gettytab cdrom/etc/ttys cdrom/etc/rc
        ${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
        ${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys
        ${INSTALL} ${COPY} ${.CURDIR}/../etc.rc cdrom/etc/rc
diff -r c0e7dcee461b -r 80fe2fb3037a distrib/common/Makefile.bootcd
--- a/distrib/common/Makefile.bootcd    Mon May 25 15:04:01 2015 +0000
+++ b/distrib/common/Makefile.bootcd    Mon May 25 15:38:33 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.bootcd,v 1.27 2015/05/19 06:58:52 martin Exp $
+#      $NetBSD: Makefile.bootcd,v 1.28 2015/05/25 15:38:33 martin Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -31,6 +31,9 @@
 #      CDKERNELS       couples of the form:
 #                              source  name_on_cd
 #      CDRUNTIME       files/directories to copy from $DESTDIR onto the CD
+#      CD_SETS         sets to be extracted onto the CD
+#                      (default: base modules etc)
+#      SETS_DIR        where the CD_SETS are found (default provided)
 # source kernels are copied from ${CDINSTKERNEL} (or its obj dir)
 # note that as of yet, bootxx_cd9660 can't load kernel names of more than
 # 8 chars (though they can be in a sub-directory meaning the pathname is
@@ -56,11 +59,15 @@
 CDRELEASE_EXCLUDE+=    -s ',./installation/installimage.*,,gp'
 .endif
 
+CD_SETS?=      base modules etc
+SETS_DIR?=     ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
+
 .include <bsd.own.mk>          # For PRINTOBJDIR
 .include <bsd.kernobj.mk>      # For KERNSRCDIR
 
 DISTRIBVER!=   ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh
 DISTRIBREV!=   ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s
+CUROBJDIR!=    cd ${.CURDIR} && ${PRINTOBJDIR}
 ISO_VOLID!=    echo NETBSD_${DISTRIBREV} | tr a-z A-Z
 PUBLISHER?= The_NetBSD_Project
 .if defined(CDMAKEFSOPTIONS)
@@ -69,6 +76,12 @@
 _CDMAKEFSOPTIONS=      rockridge,label=${ISO_VOLID},publisher=${PUBLISHER}
 .endif
 
+.if ${MKUNPRIVED} == "no"
+CD_METALOG.unpriv=
+.else
+CD_METALOG.unpriv=-M ${METALOG}.sanitised
+.endif
+
 # Stuff that should come from elsewhere - XXX where? - HF
 CP?=           cp
 RM?=           rm
@@ -81,10 +94,37 @@
 .else
 CDIMAGE=       NetBSD-${DISTRIBVER}-${CDBASE:S/cd$//}.iso
 .endif
+WORKSPEC=      fs.spec
+CDMAKEFSEXTRAOPTS+=-F ${WORKSPEC}
 
 CLEANFILES+=   ${CDIMAGE}
 CLEANFILES+=   bootxx.${MACHINE}
+CLEANFILES+=   ${WORKSPEC}
 
+CDSETSENV=     DESTDIR=${DESTDIR:Q} \
+               MACHINE=${MACHINE:Q} \
+               MACHINE_ARCH=${MACHINE_ARCH:Q} \
+               AWK=${TOOL_AWK:Q} \
+               CKSUM=${TOOL_CKSUM:Q} \
+               DB=${TOOL_DB:Q} \
+               HOST_SH=${HOST_SH:Q} \
+               MAKE=${MAKE:Q} \
+               MKTEMP=${TOOL_MKTEMP:Q} \
+               MTREE=${TOOL_MTREE:Q} \
+               PAX=${TOOL_PAX:Q} \
+               COMPRESS_PROGRAM=${COMPRESS_PROGRAM:Q} \
+               GZIP=${GZIP_FLAGS:Q} \
+               PKG_CREATE=${TOOL_PKG_CREATE:Q} \
+               SED=${TOOL_SED:Q} \
+               TSORT=${TSORT:Q} \
+               MKRUMP=no \
+               MKCOMPAT=no \
+               MKDEBUG=no \
+               MKDEBUGLIB=no
+
+CDSETSCMD=     cd ${NETBSDSRCDIR}/distrib/sets && \
+               ${CDSETSENV} \
+               ${HOST_SH}
 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
@@ -100,7 +140,7 @@
 .endif
 
 prepare:
-       ${MKDIR} cdrom
+       ${MKDIR} "${CUROBJDIR}/cdrom"
 .if defined(CDKERNELS)
 .for kernel target in ${CDKERNELS}
        ${CP} ${_INSTKERNELNOBJDIR}/${kernel} cdrom/${target}
@@ -131,38 +171,35 @@
 copy-releasedir:
        ${RM} -f ${RELEASEDIR}/${CDROMS_RELEASEDIR}/${CDIMAGE}
        if ${CDRELEASE}; then                                           \
-               if [ ! -d ${RELEASEDIR}/${RELEASEMACHINEDIR} ]; then            \
+               if [ ! -d ${RELEASEDIR}/${RELEASEMACHINEDIR} ]; then    \
                        echo "Missing ${RELEASEDIR}/${RELEASEMACHINEDIR}, aborting"; \
                        exit 1;                                         \
                fi;                                                     \
-               ${MKDIR} cdrom/${MACHINE};                              \
-               curdir=$$(pwd);                                         \
-               release_destdir=$$(pwd)/cdrom/${MACHINE};               \
+               ${MKDIR} "${CUROBJDIR}/cdrom/${MACHINE}";               \
+               release_destdir="${CUROBJDIR}/cdrom/${MACHINE}";        \
                cd ${RELEASEDIR}/${RELEASEMACHINEDIR};                  \
                echo Copying $$(pwd) to $$release_destdir ...;          \
                ${TOOL_PAX}                                             \
                        -rw -pe ${PAX_v}                                \
                        ${CDRELEASE_EXCLUDE}                            \
                        . $$release_destdir;                            \
-               cd $$curdir;                                            \
+               cd "${CUROBJDIR}";                                      \
        fi
        if ${CDSOURCE}; then                                            \
                if [ ! -d ${RELEASEDIR}/source ]; then                  \
                        echo "Missing ${RELEASEDIR}/source, aborting";  \
                        exit 1;                                         \
                fi;                                                     \
-               ${MKDIR} cdrom/source;                                  \
-               curdir=$$(pwd);                                         \
-               release_destdir=$$(pwd)/cdrom/source;                   \
+               ${MKDIR} "${CUROBJDIR}/cdrom/source";                   \
+               release_destdir="${CUROBJDIR}/cdrom/source";            \
                cd ${RELEASEDIR}/source;                                \
                echo Copying $$(pwd) to $$release_destdir ...;          \
                ${TOOL_PAX}                                             \
                        -rw -pe ${PAX_v}                                \
                        . $$release_destdir;                            \
-               cd $$curdir;                                            \
+               cd "${CUROBJDIR}";                                      \
        fi
-       if [ "X${CDRUNTIME}}" != "X" ]; then                            \
-               curdir=$$(pwd);                                         \
+       if [ "X${CDRUNTIME}" != "X" ]; then                             \
                release_destdir=$${curdir}/cdrom;                       \
                cd $$release_destdir;                                   \
                cd ${DESTDIR};                                          \
@@ -170,10 +207,9 @@
                do                                                      \
                        ${TOOL_PAX} -rw -pp ${PAX_v} $${cde} $$release_destdir;\
                done;                                                   \
-               cd $$curdir;                                            \
+               cd "${CUROBJDIR}";                                      \
        fi
        if [ "X${CDEXTRA}${CDBUILDEXTRA}" != "X" ]; then                \
-               curdir=`pwd`;                                           \
                skipflag="";                                            \
                cdextra_skip="${CDEXTRA_SKIP}";                         \
                if [ "X$${cdextra_skip}" != "X" ]; then                 \
@@ -182,13 +218,13 @@
                        do                                              \
                                echo $${skip} >> cdskip;                \
                        done;                                           \
-                       skipflag="-X $${curdir}/cdskip";                \
+                       skipflag="-X ${CUROBJDIR:Q}/cdskip";            \
                fi;                                                     \
                cdextra="${CDEXTRA}";                                   \
                cdbuildextra="${CDBUILDEXTRA}";                         \
                for cde in $${cdextra} $${cdbuildextra};                \
                do                                                      \
-                       release_destdir=$${curdir}/cdrom;               \
+                       release_destdir="${CUROBJDIR}/cdrom";           \
                        if [ -f $${cde} ]; then                         \
                                echo Copying $${cde} to $$release_destdir ...;  \
                                ${CP} $${cde} $${release_destdir};      \
@@ -202,12 +238,44 @@
                                echo "Missing $${cde}, aborting";       \
                                exit 1;                                 \
                        fi;                                             \
-                       cd $$curdir;                                    \
+                       cd "${CUROBJDIR}";                              \
                done;                                                   \
        fi
+.if !empty(CD_SETS)
+       ${MKDIR} "${CUROBJDIR}/cdrom/etc/mtree"
+.for set in ${CD_SETS}
+       if [ -f ${CUROBJDIR:Q}/cdrom/etc/mtree/set.${set} ]; then       \
+               ${CHMOD} +w ${CUROBJDIR:Q}/cdrom/etc/mtree/set.${set};  \
+       fi;                                                             \
+       ${CDSETSCMD} ./maketars -i "${CUROBJDIR}/cdrom"                 \
+           ${CD_METALOG.unpriv} -N ${NETBSDSRCDIR}/etc                 \
+           -F "${CUROBJDIR}/cdrom/etc/mtree"                           \
+           -d "${DESTDIR:S,^$,/,}" ${set}
+.endfor
+       if [ -d "${CUROBJDIR}/cdrom/var/spool/ftp/hidden" ]; then       \
+               ${CHMOD} +r "${CUROBJDIR}/cdrom/var/spool/ftp/hidden";  \
+       fi
+.endif
 
 image:
-       ${TOOL_MAKEFS} -t cd9660 ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom
+       @echo Preparing spec files for makefs...
+       ${RM} -f ${WORKSPEC}
+       cat cdrom/etc/mtree/* |                                 \
+           ${TOOL_SED} -e 's/ size=[0-9]*//'                           \
+            -e '/^\.\/etc\/gettytab/d' > ${WORKSPEC}
+       ${HOST_SH} cdrom/dev/MAKEDEV -s all |                   \
+           ${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' >> ${WORKSPEC}
+.if defined(SPEC_IN)
+       cat ${SPEC_IN} >> ${WORKSPEC}
+.endif
+.if defined(SECONDARY_BOOT)
+       echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \
+           >> ${WORKSPEC}
+.endif
+.if defined(SPEC_EXTRA)
+       cat ${SPEC_EXTRA} >> ${WORKSPEC}
+.endif
+       ${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom
 
 .if ${CDRELEASE} == false
 release: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post
@@ -224,6 +292,9 @@
 .endif
 
 clean:
+       @if [ -d cdrom/var/spool/ftp/hidden ]; then             \
+               ${CHMOD} +r cdrom/var/spool/ftp/hidden;         \
+       fi      # XXX
        ${RM} -fr cdrom
 
 prepare_md_post: .PHONY
diff -r c0e7dcee461b -r 80fe2fb3037a distrib/i386/cdroms/Makefile.cdrom
--- a/distrib/i386/cdroms/Makefile.cdrom        Mon May 25 15:04:01 2015 +0000
+++ b/distrib/i386/cdroms/Makefile.cdrom        Mon May 25 15:38:33 2015 +0000



Home | Main Index | Thread Index | Old Index