tech-install archive

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

Making install CDs contain the full sets



Izumi Tsutsui recently mentioned, in a side note to some other discussion,
that our USB images have much simpler makefiles than the slightly tricky
install CD ones, by just using the contents of full sets instead of
cherry-picked individual directories or binaries.

I did a test, and indeed the code is a lot easier (patch below), but
unfortunately sizes grow (significantly).

VAX grows from:
-r--r--r--  1 611  611  220M Jun 25 22:40 NetBSD-6.99.44-vax.iso

to:
-rw-r--r--  1 martin  wheel  513M Jun 30 17:39 NetBSD-6.99.44-vax.iso

which may be compressed down to:
-rw-r--r--  1 martin  wheel  434M Jun 30 21:39 NetBSD-6.99.44-vax.iso.bz2
-rw-r--r--  1 martin  wheel  436M Jun 30 21:36 NetBSD-6.99.44-vax.iso.gz
-rw-r--r--  1 martin  wheel  417M Jun 30 21:52 NetBSD-6.99.44-vax.iso.xz

(I would vote for .zip compression (same size as .gz) if pigz is available.)

Others, however, slightly explode:
-r--r--r--  1 root  wheel  936M Jul  1 01:08 NetBSD-6.99.44-sparc64.iso

So, this is not a CD image anymore, and this kills the idea (even if we
could strip off ~ 6 MB by not expanding modules.tgz on sparc64 for now).


Any obvious tricks I'm overlooking?


Martin
Index: amd64/cdroms/Makefile.cdrom
===================================================================
RCS file: /cvsroot/src/distrib/amd64/cdroms/Makefile.cdrom,v
retrieving revision 1.9
diff -u -r1.9 Makefile.cdrom
--- amd64/cdroms/Makefile.cdrom 18 May 2014 13:06:12 -0000      1.9
+++ amd64/cdroms/Makefile.cdrom 1 Jul 2014 08:17:19 -0000
@@ -11,61 +11,11 @@
 CDKERNELS=     netbsd-GENERIC.gz       netbsd
 CDRELEASE_NOISOS=      true
 
-CDRUNTIME+=    ./bin
-CDRUNTIME+=    ./dev/MAKEDEV
-CDRUNTIME+=    ./etc
-CDRUNTIME+=    ./lib
-CDRUNTIME+=    ./libdata
-CDRUNTIME+=    ./libexec/ld.elf_so
-CDRUNTIME+=    ./libexec/lfs_cleanerd
-CDRUNTIME+=    ./libexec/dhcpcd-run-hooks
-CDRUNTIME+=    ./libexec/resolvconf/
-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
-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/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/libexec/dhcpcd-hooks
        ${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf 
cdrom/libexec/dhcpcd-hooks
        ${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst 
cdrom/libexec/dhcpcd-hooks
-       ${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
Index: common/Makefile.bootcd
===================================================================
RCS file: /cvsroot/src/distrib/common/Makefile.bootcd,v
retrieving revision 1.25
diff -u -r1.25 Makefile.bootcd
--- common/Makefile.bootcd      31 May 2014 10:18:47 -0000      1.25
+++ common/Makefile.bootcd      1 Jul 2014 08:17:19 -0000
@@ -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,6 +59,9 @@
 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
 
@@ -81,10 +87,12 @@
 .else
 CDIMAGE=       NetBSD-${DISTRIBVER}-${CDBASE:S/cd$//}.iso
 .endif
+WORKSPEC=      fs.spec
+CDMAKEFSEXTRAOPTS+=-F ${WORKSPEC}
 
 CLEANFILES+=   ${CDIMAGE}
 CLEANFILES+=   bootxx.${MACHINE}
-
+CLEANFILES+=   ${WORKSPEC}
 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
@@ -205,8 +213,33 @@
                        cd $$curdir;                                    \
                done;                                                   \
        fi
+.for set in ${CD_SETS}
+       @if [ ! -f ${SETS_DIR}/${set}.tgz ]; then               \
+               echo "Missing ${SETS_DIR}/${set}.tgz, aborting"; \
+               false;                                          \
+       fi
+       @echo Extracting ${set}.tgz ...
+       @(cd cdrom; ${TOOL_PAX} -rnz -f ${SETS_DIR}/${set}.tgz .)
+.endfor
 
 image:
+       @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} -t cd9660 ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} 
${CDIMAGE} cdrom
 
 .if ${CDRELEASE} == false
Index: i386/cdroms/Makefile.cdrom
===================================================================
RCS file: /cvsroot/src/distrib/i386/cdroms/Makefile.cdrom,v
retrieving revision 1.29
diff -u -r1.29 Makefile.cdrom
--- i386/cdroms/Makefile.cdrom  18 May 2014 13:06:12 -0000      1.29
+++ i386/cdroms/Makefile.cdrom  1 Jul 2014 08:17:19 -0000
@@ -11,61 +11,11 @@
 CDKERNELS=     netbsd-GENERIC.gz       netbsd
 CDRELEASE_NOISOS=      true
 
-CDRUNTIME+=    ./bin
-CDRUNTIME+=    ./dev/MAKEDEV
-CDRUNTIME+=    ./etc
-CDRUNTIME+=    ./lib
-CDRUNTIME+=    ./libdata
-CDRUNTIME+=    ./libexec/ld.elf_so
-CDRUNTIME+=    ./libexec/lfs_cleanerd
-CDRUNTIME+=    ./libexec/dhcpcd-run-hooks
-CDRUNTIME+=    ./libexec/resolvconf/
-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
-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/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/libexec/dhcpcd-hooks
        ${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf 
cdrom/libexec/dhcpcd-hooks
        ${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst 
cdrom/libexec/dhcpcd-hooks
-       ${MKDIR} cdrom/etc
+       ${RM} -f cdrom/etc/gettytab cdrom/etc/ttys cdrom/etc/rc cdrom/install.sh
        ${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
        ${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys
        ${INSTALL} ${COPY} ${.CURDIR}/../etc.rc cdrom/etc/rc
Index: sparc64/cdroms/installcd/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/sparc64/cdroms/installcd/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- sparc64/cdroms/installcd/Makefile   18 May 2014 13:06:12 -0000      1.17
+++ sparc64/cdroms/installcd/Makefile   1 Jul 2014 08:17:19 -0000
@@ -1,6 +1,7 @@
 #      $NetBSD: Makefile,v 1.17 2014/05/18 13:06:12 martin Exp $
 CDBASE=                sparc64cd               # gives ${CDBASE}.iso
 CDRELEASE=     true                    # include $RELEASEDIR/$MACHINE
+CDKERNELS=     ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-GENERIC.gz        
netbsd
 
 # for PRINTOBJDIR
 .include <bsd.own.mk>
@@ -12,63 +13,11 @@
 CDBOOTIMAGE=    ${CDBOOTIMAGEDIR}/boot.fs
 SUN_BOOT_ARGS:=  - - - - ${CDBOOTIMAGE}
 
-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/getopt
-CDRUNTIME+=    ./usr/bin/gunzip
-CDRUNTIME+=    ./usr/bin/gzcat
-CDRUNTIME+=    ./usr/bin/gzip
-CDRUNTIME+=    ./usr/bin/grep
-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
-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/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/chat
-CDRUNTIME+=    ./usr/sbin/chroot
-CDRUNTIME+=    ./usr/sbin/installboot
-CDRUNTIME+=    ./usr/sbin/pppd
-CDRUNTIME+=    ./usr/sbin/wiconfig
-CDRUNTIME+=    ./usr/share/misc/terminfo.cdb
-CDRUNTIME+=    ./usr/share/locale
-
 image_md_pre:
        ${RM} -rf cdrom/libexec/dhcpcd-hooks/*
        ${CP} ${.CURDIR}/../../../common/10-resolv.conf 
cdrom/libexec/dhcpcd-hooks
        ${CP} ${.CURDIR}/../../../common/99-print-sysinst 
cdrom/libexec/dhcpcd-hooks
-       ${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
@@ -78,14 +27,10 @@
        for f in ${SYSINSTDIR}/sysinstmsgs.??; do \
                ${INSTALL} ${COPY} $$f cdrom; \
        done
-       ${MKDIR} cdrom/var
-       ${MKDIR} cdrom/kern
-       ${CP} ${RELEASEDIR}/sparc64/binary/kernel/netbsd-GENERIC.gz cdrom/netbsd
 
 image_md_post:
        SUNLABEL=${TOOL_SUNLABEL:Q} \
                ${HOST_SH} ${NETBSDSRCDIR}/distrib/common/sunbootcd.sh \
                ${CDIMAGE} ${SUN_BOOT_ARGS}
-       
 
 .include "${.CURDIR}/../../../common/Makefile.bootcd"
Index: vax/cdroms/installcd/Makefile
===================================================================
RCS file: /cvsroot/src/distrib/vax/cdroms/installcd/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- vax/cdroms/installcd/Makefile       4 Jun 2014 19:31:57 -0000       1.7
+++ vax/cdroms/installcd/Makefile       1 Jul 2014 08:17:21 -0000
@@ -3,9 +3,7 @@
 CDRELEASE=     true                    # include $RELEASEDIR/$MACHINE
 CDKERNELS=     ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-GENERIC.gz        
netbsd.gz
 CDRELEASE_NOISOS=true
-CDMAKEFSEXTRAOPTS+=-F ./fs.spec
-
-CLEANFILES+= fs.spec
+CD_SETS=       base etc        # no modules for VAX
 
 # for PRINTOBJDIR
 .include <bsd.own.mk>
@@ -21,7 +19,7 @@
        ${MKDIR} -p cdrom/libexec/dhcpcd-hooks
        ${CP} ${.CURDIR}/../../../common/10-resolv.conf 
cdrom/libexec/dhcpcd-hooks
        ${CP} ${.CURDIR}/../../../common/99-print-sysinst 
cdrom/libexec/dhcpcd-hooks
-       ${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
@@ -32,66 +30,9 @@
                ${INSTALL} ${COPY} $$f cdrom; \
        done
        ${TOOL_GZIP} -d -f cdrom/netbsd.gz
-       echo '. type=dir optional' > ./fs.spec
-       echo './dev type=dir optional' >> ./fs.spec
-       ${HOST_SH} cdrom/dev/MAKEDEV -s all | ${TOOL_SED} -e '1d' -e 
's:^\./:./dev/:' >> ./fs.spec
-       ${MKDIR} cdrom/var
-       ${MKDIR} cdrom/kern
 
 # make the CD bootable
 image_md_post:
        ${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE}
 
-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/getopt
-CDRUNTIME+=    ./usr/bin/gunzip
-CDRUNTIME+=    ./usr/bin/gzcat
-CDRUNTIME+=    ./usr/bin/gzip
-CDRUNTIME+=    ./usr/bin/grep
-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
-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/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/chat
-CDRUNTIME+=    ./usr/sbin/chroot
-CDRUNTIME+=    ./usr/sbin/installboot
-CDRUNTIME+=    ./usr/sbin/pppd
-CDRUNTIME+=    ./usr/sbin/wiconfig
-CDRUNTIME+=    ./usr/share/misc/terminfo.cdb
-CDRUNTIME+=    ./usr/share/locale
-
 .include "${.CURDIR}/../../../common/Makefile.bootcd"


Home | Main Index | Thread Index | Old Index