This commit integrates mfsBSD into the release/Makefile.
Test Results
Tested under 15.0-CURRENT. Completes without any error and produces
mfsbsd-se.img and mfsbsd-se.iso at /usr/obj/usr/src/${ARCH}/release/.
Two ways of building mfsBSD have been implemented. The first use case is
intended for most use cases, while the second is intended only for
release engineering purposes -- e.g. creating all of the FreeBSD
installation media for distribution purposes.
First Use Case
cd /usr/src/release && make mfsbsd-se.img mfsbsd-se.iso
Basically, it's very similar to mfsBSD's own make process with the
CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1 flags. What this means is that
this process invokes cd /usr/src && make buildworld buildkernel
internally and uses those object files to create mfsBSD images.
Second Use Case
cd /usr/src/ && make buildworld buildkernel -j12 && cd release && make release WITH_MFSBSD=1
The mfsBSD build process is the same for both the first use case and
the second use case. However, the second use case also build all the
release artifacts and all of the FreeBSD installation media, such as
cdrom, dvdrom, memstick, and mini-memstick. The first use case only
builds mfsBSD itself, and thus is intended for most use cases, while
the second use case's purpose is to build all release media.
Testing
I've used two of my amd64 machines for testing. Here's the script I used
for testing and verifying this code:
#!/bin/sh alias DATE="date '+%Y%m%d_%H%M'" mkdir -p /logs_mfsbsd # # TESTING USE CASE 1 # cd /usr/src/release make mfsbsd-se.img mfsbsd-se.iso \ > /logs_mfsbsd/interface1_build_$(DATE).log 2>&1 echo "--------------------------------------------------------------" echo "> Type: mfsBSD build" echo "> Completed Time: $(DATE)" echo "--------------------------------------------------------------" ls -lh /usr/obj/usr/src/amd64.amd64/release/mfsbsd* # # Clean up. # make clean > /dev/null cd /usr/src && make clean > /dev/null # # TESTING USE CASE 2 # cd /usr/src time make buildworld -j12 \ > /logs_mfsbsd/interface2_buildWorld_$(DATE).log 2>&1 time make buildkernel -j6 \ > /logs_mfsbsd/interface2_buildKernel_$(DATE).log 2>&1 cd ./release COUNT=0 while [ $COUNT -lt 10 ] do time make release WITH_MFSBSD=1 \ > /logs_mfsbsd/interface2_release_$(DATE).log 2>&1 mkdir -p ./images make install WITH_MFSBSD=1 DESTDIR=/usr/src/release/images \ > /logs_mfsbsd/interface2_install_$(DATE).log 2>&1 echo "--------------------------------------------------------------" echo "> Type: mfsBSD build alongside all release artifacts" echo "> Completed Time: $(DATE)" echo "--------------------------------------------------------------" ls -lh /usr/src/release/images/mfsbsdimages/ make mfsbsd-clean > /dev/null COUNT=$(expr $COUNT + 1) done
Note that the testing script above iterates the build process 10 times.
It was because I had a bug in which the build process fails every other
time. Now it's fixed, but I just wanted to ensure that the bug is gone
and the build process completes successfully now.
Extra Testing
Coincidentally, one of the two machines used for testing did not have
internet access because there's no driver for the AQC113C ethernet
chipset available yet, but thanks to this, this showed me that the code
works equally well even without internet access.
In addition, this code was tested to ensure its compatibility with
release/release.sh as well. Here's my testing script for release.sh:
#!/bin/sh alias DATE="date '+%Y%m%d_%H%M'" mkdir -p /logs_mfsbsd # # TESTING COMPATIBILITY WITH release.sh # cd /usr/src/release cat ./release.conf.sample | sed \ -e 's/GITROOT="https:\/\/git.freebsd.org\/"/GITROOT="https:\/\/github.com\/soobinrho\/"/g' \ -e 's/GITSRC="src.git"/GITSRC="freebsd-src.git"/g' \ -e 's/GITPORTS="ports.git"/GITPORTS="freebsd-ports.git"/g' \ -e 's/SRCBRANCH="main"/SRCBRANCH="integrate-mfsBSD-building"/g' \ -e 's/#WITH_MFSBSD=/WITH_MFSBSD=1/g' \ > ./release.conf ./release.sh -c ./release.conf \ > /logs_mfsbsd/release_sh_build_$(DATE).log 2>&1 echo "--------------------------------------------------------------" echo "> Type: mfsBSD build (release.sh)" echo "> Completed Time: $(DATE)" echo "--------------------------------------------------------------" ls -lh /scratch/R/mfsbsdimages
Acknowledgement
This series of commits was produced as a part of the mfsBSD integration
project, a Google Summer of Code 2023 project as described here:
https://wiki.freebsd.org/SummerOfCode2023Projects/IntegrateMfsBSDIntoTheReleaseBuildingTools
Sponsored by: Google, Inc. (GSoC 2023)
Signed-off-by: Soobin Rho <soobinrho@FreeBSD.org>