Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <callout type="warning"> **Transition to Git is in progress** As of r364891 the release script only supports Git and subsequently rendering the following instructions not working as intended however some functionality is still not implemented therefore this page wont be updated until they are. </callout> A tutorial on how to build images for arm devices using %%FreeBSD%%'s release building infrastructure. ==== Download source ==== <code> svnlite checkout https://svn.freebsd.org/base/head /usr/src </code> **Note:** it's **preferred** that you keep ''%%/usr/src%%'' and the version you're trying to build **in sync**. To checkout a specific revision use ''%%-rXXX%%'' where XXX is the revision \\ **Requirement:** The host **needs** to run a version **equal** or greater to what you're building. ==== Remove debugging, profiling and tests (optional) ==== Create a directory which will contain ''%%make.conf%%'' and ''%%src.conf%%'' <code> mkdir /etc/release-confs </code> Populate ''%%/etc/release-confs/make.conf%%'' <code> WITHOUT_DEBUG=YES MK_PROFILE=no </code> See [[https://man.freebsd.org/make.conf/5|man 5 make.conf]] and [[https://svnweb.freebsd.org/ports/head/UPDATING?view=markup|/usr/src/UPDATING]] for more information Populate ''%%/etc/release-confs/src.conf%%'' <code> WITHOUT_DEBUG_FILES=1 WITHOUT_KERNEL_SYMBOLS=yes WITHOUT_TESTS=yes WITHOUT_PROFILE=yes WITHOUT_LLVM_ASSERTIONS=yes WITH_MALLOC_PRODUCTION=yes </code> By removing symbols and debugging information you're limiting the ability to debug crashes **severely**. See [[https://man.freebsd.org/src.conf/|man 5 src.conf]] for more information These files needs to be referenced in the configuration file for your target using the variables ''%%MAKE_CONF%%'' and ''%%SRC_CONF%%'' as mentioned in [[https://www.freebsd.org/cgi/man.cgi?release(7)|man 7 release]]. ==== Add board specific configuration (if needed) ==== This example is for [[https://linux-sunxi.org/Orange_Pi_PC|Orange Pi PC]] as this board has support but doesn't have a configuration. In many cases you can use another board's configuration as template as long as it uses the same %%SoC%%. Copy ''%%BANANAPI.conf%%'' to a new location <code> cd /usr/src/release cp -Rp arm/BANANAPI.conf arm/ORANGEPI-PC.conf </code> Change ''%%EMBEDDEDPORTS%%'' path to corresponding u-boot port <code> EMBEDDEDPORTS="sysutils/u-boot-bananapi" --> EMBEDDEDPORTS="sysutils/u-boot-orangepi-pc" </code> Change kernel to ''%%GENERIC-NODEBUG%%'' **if** you want to **disable** kernel debugging <code> KERNEL="GENERIC" --> KERNEL="GENERIC-NODEBUG" </code> ''%%BOARDNAME%%'' variable sets filename of generated image file. <code> export BOARDNAME="BANANAPI" --> export BOARDNAME="ORANGEPI-PC" </code> Add ''%%SRCBRANCH="base/head@rXXX"%%'' where XXX is the revision number (optional) <code> SRCBRANCH="base/head@r349025" </code> Change ''%%UBOOT_DIR%%'' to corresponding u-boot install path (u-boot-orangepi-pc) <code> UBOOT_DIR="/usr/local/share/u-boot/u-boot-bananapi" --> UBOOT_DIR="/usr/local/share/u-boot/u-boot-orangepi-pc" </code> ==== Begin compilation ==== <code> sh release.sh -c arm/ORANGEPI-PC.conf </code> The release script will automatically set amount of jobs (see [[https://www.freebsd.org/cgi/man.cgi?release(7)|man 7 release]] for more information). The compiled image will be placed in ''%%/scratch/R%%'' . ==== Sanitize image ==== If you want to distribute your image after doing modifications and/or installing packages on a "live" system you first need to clear out system specific files. Mount your / partition, remove the following directories and files before making a copy and don't forget to touch /firstboot . * /etc/hostid * All key files in /etc/ssh * /var/db/entropy (clean directory) * /boot/entropy * touch /firstboot ==== See also ==== [[arm/Build_image_notes|notes about the prebuilt images]] ---- {{tag>HowTo}} arm/build_image_using_release_building_infrastructure.txt Last modified: 2021/03/22 06:57by DanielEngberg