Solved Building with release.sh on -STABLE

I have a question. What do I end up with if I build with /usr/src/release/release.sh on a -FreeBSD 12 -STABLE box?
Does it built a 12 -STABLE image or 12 -RELEASE?
 
Unless you set it otherwise:
Code:
        # The default svn checkout server, and svn branches for src/, doc/,
        # and ports/.
        SVNROOT="svn://svn.FreeBSD.org/"
        SRCBRANCH="base/head@rHEAD"
        DOCBRANCH="doc/head@rHEAD"
        PORTBRANCH="ports/head@rHEAD"

But I rarely use release.sh script. I just fire off make release with the right options:
make -DNOPORTS -DNODOC -DNOPKGS KERNCONF="GENERIC VBOX" release
Followed by a
make -DNOPORTS -DNODOC -DNOPKGS KERNCONF="GENERIC VBOX" DESTDIR=/storage/release/12-stable install

This installs the CD, memdisk and an FTP install directory:
Code:
root@molly:/usr/src/release # ll /storage/release/12-stable/
total 2478125
-rw-r--r--  1 root  wheel        462 May 24 08:14 CHECKSUM.SHA256
-rw-r--r--  1 root  wheel        718 May 24 08:13 CHECKSUM.SHA512
-rw-r--r--  1 root  wheel  347711488 May 23 22:58 FreeBSD-12.0-STABLE-amd64-bootonly.iso
-rw-r--r--  1 root  wheel  860823552 May 23 22:56 FreeBSD-12.0-STABLE-amd64-disc1.iso
-rw-r--r--  1 root  wheel  941793792 May 23 22:58 FreeBSD-12.0-STABLE-amd64-memstick.img
-rw-r--r--  1 root  wheel  387621376 May 23 22:58 FreeBSD-12.0-STABLE-amd64-mini-memstick.img
drwxr-xr-x  2 root  wheel         12 May 23 22:54 ftp/
Which is generally enough for me.
 
Friday night I fired off a build with release.sh. Took around 3 hours with 20 cores and NVMe.
Seemed a little high to me.
I do want to try again to only make a memstick build.

What was confusing me was release.sh building HEAD. I wonder why they do that.
Maybe its the generic @rHEAD that confused me. I would think each version of FreeBSD would build native.
Building HEAD on a RELEASE version by default seems like an odd choice.
My only guess the generic tag used now requires no intervention whereas with an actual release used it would need constant source maintenance with each release.
 
How about this question I had to guess about: Where are the actual 'tags' located for each version?
How do I know exactly what the tag is for each different FreeBSD version? Is it simply the svn directory name?
 
How do I know exactly what the tag is for each different FreeBSD version? Is it simply the svn directory name?
Yes, exactly. You can also checkout a specific revision number:
svn co https://svn.freebsd.org/base/stable/12@r348123 /usr/src
Which is the same as svn co -r 348123 https://svn.freebsd.org/base/stable/12 /usr/src
But you typically want to get the latest revision, i.e. @rHEAD or just leave it out. Note that this is a revision number, not HEAD aka -CURRENT.

I usually don't use release.sh as it does too much and I usually already have a completed buildworld I want to use.
 
I usually don't use release.sh as it does too much
Yes I see dramatically reduced times when I used some of your settings...
Code:
cd /usr/src
make -j20 buildworld -DNO_CLEAN
make -j20 buildkernel -DNO_CLEAN

cd /usr/src/release
make memstick -DNOSRC -DNODOCS -DNOPORTS

My only problem is this builds an FreeBSD memstick installer image.
I want something deployable. I thought I found a solution with the boot-only image but it is an ISO...

Any suggestions?
I want to build custom bhyve images

Another Question:
How to add extra_files to my build?
 
Last edited:
Well I figured out the FreeBSD memstick installer image structure by studying the medium.
I compiled WITHOUT=bsdinstall thinking that would be enough. The menu in the beginning still came up.
That was an rc.local script on the install medium.
fstab on the install medium also mounts RO and with a 'FreeBSD_Install' disk label used.
Still searching for when this gets written to the disk during the make phase.

I was always wondering where all the src.conf compiler options were.
Finally found them: /usr/src/tools/build/options/


Question:
Where does make distribution come to play here? Is it part of make release ?
Is this the step that copies rc.conf and fstab to disk?
 
I really didn't study /usr/src/release/Makefile enough. It was all right there:
Code:
# Set up installation environment
    ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
    echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
    echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
    echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
    cp ${.CURDIR}/rc.local ${.TARGET}/etc
    touch ${.TARGET}
 
One last fragment over here: /usr/src/release/amd64/make-memstick.sh
Code:
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
makefs -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${1}
 
Back
Top