3 # generate-release.sh: check out source trees, and build release components with
4 # totally clean, fresh trees.
6 # Usage: generate-release.sh svn-branch[@revision] scratch-dir
8 # Environment variables (default):
9 # SVNROOTBASE: SVN base URL to FreeBSD repository (svn://svn.freebsd.org)
10 # SVNROOTSRC: URL to FreeBSD src tree (${SVNROOTBASE}/base)
11 # SVNROOTDOC: URL to FreeBSD doc tree (${SVNROOTBASE}/doc)
12 # SVNROOTPORTS:URL to FreeBSD ports tree (${SVNROOTBASE}/ports)
13 # BRANCHSRC: branch name of src (svn-branch[@revision])
14 # BRANCHDOC: branch name of doc (release/9.1.0)
15 # BRANCHPORTS: branch name of ports (tags/RELEASE_9_1_0)
16 # WORLD_FLAGS: optional flags to pass to buildworld (e.g. -j)
17 # KERNEL_FLAGS: optional flags to pass to buildkernel (e.g. -j)
19 # Note: Since this requires a chroot, release cross-builds will not work!
26 echo "Usage: $0 svn-branch[@revision] scratch-dir" 2>&1
34 : ${SVNROOTBASE:=svn://svn.freebsd.org}
35 : ${SVNROOTSRC:=${SVNROOTBASE}/base}
36 : ${SVNROOTDOC:=${SVNROOTBASE}/doc}
37 : ${SVNROOTPORTS:=${SVNROOTBASE}/ports}
38 : ${SVNROOT:=${SVNROOTSRC}} # for backward compatibility
40 : ${BRANCHDOC:=release/9.1.0}
41 : ${BRANCHPORTS:=branches/RELENG_9_1_0}
42 : ${WORLD_FLAGS:=${MAKE_FLAGS}}
43 : ${KERNEL_FLAGS:=${MAKE_FLAGS}}
45 set -e # Everything must succeed
47 svn co ${SVNROOT}/${BRANCHSRC} $2/usr/src
48 svn co ${SVNROOTDOC}/${BRANCHDOC} $2/usr/doc
49 svn co ${SVNROOTPORTS}/${BRANCHPORTS} $2/usr/ports
52 make $WORLD_FLAGS buildworld
53 make installworld distribution DESTDIR=$2
54 mount -t devfs devfs $2/dev
55 trap "umount $2/dev" EXIT # Clean up devfs mount on exit
57 if [ -d $2/usr/doc ]; then
58 cp /etc/resolv.conf $2/etc/resolv.conf
60 # Install docproj to build release documentation
61 chroot $2 make -C /usr/ports/textproc/docproj install \
62 BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes
65 chroot $2 make -C /usr/src $WORLD_FLAGS buildworld
66 chroot $2 make -C /usr/src $KERNEL_FLAGS buildkernel
67 chroot $2 make -C /usr/src/release release
68 chroot $2 make -C /usr/src/release install DESTDIR=/R