From 42a54e7909b80bc7c6c1ed6e9d5c9ce2b3ddb72a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 24 Oct 2010 00:00:59 -0700 Subject: [PATCH] nrelease - Release build adjustments * Add GITHOST override to Makefile.usr * For now checkout 2010Q3 by default in master, this will be changed to 'master' in a month or two but for now we want to match the release. * Add GITHOST feature to the nrelease Makefile, defaulting to git.dragonflybsd.org. This allows developers who do release builds to specify a more local clone/mirror/copy of the pkgsrcv2.git and dragonfly.git repos. nrelease pulls from these repos so this can save a bunch of time. * nrelease now installs each kernel into its own kernel.XXX directory in /boot, with a complete set of modules for each kernel. This is instead of installing all kernels into /boot/kernel/ and naming them differently inside /boot/kernel/. This is to conform to the recent dloader work and very recent new menu features. * All kernels+modules are installed with INSTALLSTRIPPEDMODULES so the ISO comes in at a reasonable size. * The release ISO now contains both a UP and a SMP kernel, selectable at boot time. * Do not try to include pkgsrc in the release ISO/IMG (at 1G+ it is too big). We continue to include system sources. There isn't enough room for full sources in the ISO/IMG. Note that GUI builds will include a full pkgsrc and full sources, including a .git base for them. * nrelease now supports a IMGSIZE override on the make line (in sectors), for the usb image. * nrelease now autosizes the IMG file (when not overriden by IMGSIZE) to the nearest base-10 gigabyte to ensure that it fits on the USB stick and provide a bit of extra space for messing around. --- etc/Makefile.usr | 11 ++++++---- nrelease/Makefile | 54 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/etc/Makefile.usr b/etc/Makefile.usr index fff0d54d4c..8b7c43d271 100644 --- a/etc/Makefile.usr +++ b/etc/Makefile.usr @@ -2,6 +2,8 @@ # # Provides simple targets to download and maintain /usr/src, /usr/pkgsrc etc. +GITHOST?=git.dragonflybsd.org + help all: @echo "HELP:" @echo "" @@ -51,14 +53,15 @@ pkgsrc-create: mkdir -p ${.CURDIR}/pkgsrc cd ${.CURDIR}/pkgsrc && git init cd ${.CURDIR}/pkgsrc && \ - git remote add origin git://git.dragonflybsd.org/pkgsrcv2.git + git remote add origin git://${GITHOST}/pkgsrcv2.git cd ${.CURDIR}/pkgsrc && git fetch origin cd ${.CURDIR}/pkgsrc && git branch master origin/master - cd ${.CURDIR}/pkgsrc && git checkout master + cd ${.CURDIR}/pkgsrc && git branch pkgsrc-2010Q3 origin/pkgsrc-2010Q3 + cd ${.CURDIR}/pkgsrc && git checkout pkgsrc-2010Q3 cd ${.CURDIR}/pkgsrc && git pull pkgsrc-checkout: - cd ${.CURDIR}/pkgsrc && git checkout master + cd ${.CURDIR}/pkgsrc && git checkout pkgsrc-2010Q3 pkgsrc-update: cd ${.CURDIR}/pkgsrc && git pull @@ -69,7 +72,7 @@ src-create: mkdir -p ${.CURDIR}/src cd ${.CURDIR}/src && git init cd ${.CURDIR}/src && \ - git remote add origin git://git.dragonflybsd.org/dragonfly.git + git remote add origin git://${GITHOST}/dragonfly.git cd ${.CURDIR}/src && git fetch origin cd ${.CURDIR}/src && git branch master origin/master cd ${.CURDIR}/src && git checkout master diff --git a/nrelease/Makefile b/nrelease/Makefile index ff6ea49de0..86f83193ad 100644 --- a/nrelease/Makefile +++ b/nrelease/Makefile @@ -17,6 +17,7 @@ gui installer img: ISODIR?= /usr/release ISOROOT?= ${ISODIR}/root OBJSYS= ${.OBJDIR}/../sys +GITHOST?= git.dragonflybsd.org MAKE_JOBS?= $$(sysctl -n hw.ncpu) @@ -29,9 +30,9 @@ MACHINE_ARCH= x86_64 # XXX makeshift fix to build the right kernel for the (target) architecture # We should configure this in the platform files somehow .if ${MACHINE_ARCH} == "i386" -KERNCONF ?= GENERIC VKERNEL +KERNCONF ?= GENERIC GENERIC_SMP .else -KERNCONF ?= X86_64_GENERIC VKERNEL64 +KERNCONF ?= X86_64_GENERIC X86_64_GENERIC_SMP .endif PKGSRC_PREFIX?= /usr/pkg @@ -212,7 +213,6 @@ buildkernel1 buildkernel2: ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \ make -j ${MAKE_JOBS} ${.TARGET:C/build(.*)2/quick\1/:C/1//} \ KERNCONF=$${kernconf} \ - $${first:+-DNO_MODULES}; \ first=done; \ done @@ -224,6 +224,9 @@ buildkernel1 buildkernel2: # Unconditionally clean out /usr/release/root so a previous img build # does not blow up a future quick iso build # +# We install with INSTALLSTRIPPEDMODULES to make things fit into the ISO. +# We leave the kernel's debug variables intact. +# buildiso: -rm -rf ${ISOROOT} -chflags -R noschg ${ISOROOT} @@ -237,29 +240,35 @@ buildiso: cd ${.CURDIR}/..; \ first=; \ for kernconf in ${KERNCONF}; do \ - make DESTDIR=${ISOROOT} \ - installkernel KERNCONF=$${kernconf} \ - $${first:+DESTKERNNAME=kernel.$${kernconf}} \ - $${first:+-DNO_MODULES}; \ + make DESTDIR=${ISOROOT} installkernel \ + KERNCONF=$${kernconf} \ + DESTKERNDIR=/boot/kernel.$${kernconf} \ + INSTALLSTRIPPEDMODULES=y; \ + ln -s kernel ${ISOROOT}/boot/kernel.$${kernconf}/kernel.BOOTP; \ + rm -rf ${ISOROOT}/boot/kernel.$${kernconf}.old; \ first=done; \ done - ln -s kernel ${ISOROOT}/boot/kernel.BOOTP mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/ mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev -# Release CD: Kernel sources (~16M) and the full pkgsrc tree (~27M) -# Release DVD: Full sources (~90M) and the full pkgsrc tree (~27M) +# The GUI build includes the pkgsrc tree (~1G+) while the nominal release +# build does not. +# +# The GUI build includes full sources while the nominal release build +# only includes kernel sources (~27MB). # srcs: .if !defined(WITHOUT_SRCS) - cd ${ISOROOT}/usr && make pkgsrc-create .if make(gui) - cd ${ISOROOT}/usr && make src-create + cd ${ISOROOT}/usr && make pkgsrc-create GITHOST=${GITHOST} + cd ${ISOROOT}/usr && make src-create GITHOST=${GITHOST} .else rm -f ${ISOROOT}/usr/src-sys.tgz + rm -f ${ISOROOT}/usr/src-sys.tar.bz2 cd ${.CURDIR}/.. && tar --exclude .git -s '/^\./src/' \ - -czf ${ISOROOT}/usr/src-sys.tgz ./Makefile ./Makefile.inc1 ./sys + -cf - ./Makefile ./Makefile.inc1 ./sys | \ + bzip2 -9 > ${ISOROOT}/usr/src-sys.tar.bz2 .endif .endif @@ -373,10 +382,19 @@ mkimg: if [ ! -d ${IMGMNT} ]; then mkdir -p ${IMGMNT}; fi -if [ -f ${ISODIR}/vn.which ]; then umount ${IMGMNT}; \ vnconfig -u `cat ${ISODIR}/vn.which`; fi - @echo "STEP: determine required image size" +.ifdef IMGSIZE + @echo "STEP: use an image size of ${IMGSIZE} 512-byte sectors" + rm -f ${IMGFILE} + sz=`bc -e "((${IMGSIZE}) * 512)" -equit`; truncate -s $${sz} ${IMGFILE} +.else + @echo "STEP: determine required image size in 1GB steps" sz=`du -ck ${ISOROOT} | tail -n 1 | cut -f 1`; \ - sz=`bc -e "(($${sz}) / 1024) * 1.15" -equit | cut -f1 -d.`; \ - dd if=/dev/zero of=${IMGFILE} bs=1m count=$${sz}; + sz=`bc -e "(($${sz}) * 1.15 + 999999999) / 1000000000" -equit | \ + cut -f1 -d.`; \ + sz=`bc -e "(($${sz}) * 976)" -equit | cut -f1 -d.`; \ + rm -f ${IMGFILE}; \ + truncate -s $${sz}M ${IMGFILE}; +.endif fdisk -IB -p ${IMGFILE} @echo "STEP: determine free vn device" vnconfig -l | grep "not in use" | head -n 1 | \ @@ -450,7 +468,9 @@ help all: @echo "make [gui] realquick - attempt to restart after world & kernel" @echo "make [gui] restartpkgs - attempt to restart at the pkg building stage" @echo "" - @echo "Extra packages may be specified with PKGSRC_EXTRA_PACKAGES" + @echo "PKGSRC_EXTRA_PACKAGES may be used to add additional pkgs" + @echo "GITHOST may be used to override git.dragonflybsd.org" + @echo "IMGSIZE may be used to override the .img (in 512-byte sectors)" .PHONY: release quickrel realquickrel .PHONY: installer -- 2.41.0