Using Trueos to Boot-Strap Your Freebsd-Based Project
Total Page:16
File Type:pdf, Size:1020Kb
● ● ● ○ ○ ○ ● ● ● ● ● ● ● ● ● ○ ○ ○ ○ ● ● ● ○ ○ ○ ● ○ ○ ○ "base-packages": { "name-prefix":"TrueOS", "depends": { "runtime": { "uclcmd": { "origin": "devel/uclcmd", "version": ">0" } } } } "base-packages": { "name-prefix":"TrueOS", ← Changes PREFIX of base OS packages "depends": { ← Used for dependency injection "runtime": { "uclcmd": { "origin": "devel/uclcmd", "version": ">0" } } } } "base-packages": { "name-prefix":"TrueOS", "depends": { "runtime": { ← Selected {FreeBSD|TrueOS}-runtime "uclcmd": { ← Setup new dependency "origin": "devel/uclcmd", "version": ">0" } }, "runtime-development": { "llvm70": { "origin": "devel/llvm70", "version": ">0" } } "base-packages": { "world-flags":{ "default": [ "WITHOUT_SENDMAIL=yes", "WITHOUT_PORTSNAP=yes" ] } } "base-packages": { "world-flags":{ ← Flags to pass into buildworld "default": [ "WITHOUT_SENDMAIL=yes", "WITHOUT_PORTSNAP=yes" ] } } "base-packages": { "world-flags":{ ← Flags to pass into buildworld "default": [ ← Conditional, “default” is special "WITHOUT_SENDMAIL=yes", "WITHOUT_PORTSNAP=yes" ] } } "base-packages": { "world-flags":{ ← Flags to pass into buildworld "default": [ ← Conditional, default always enabled "WITHOUT_SENDMAIL=yes", "WITHOUT_PORTSNAP=yes" ], "WITH_TRUENAS": [ ← Conditional, used if WITH_TRUENAS is set "WITHOUTH_BLUETOOTH=yes", ] } } "base-packages": { "kernel-flags":{ ← Flags to pass into buildkernel "default": [ "WITHOUT_AUTOFS=yes", “WITHOUT_CUSE=yes" ], "WITH_TRUENAS": [ "WITHOUT_IPFILTER=yes" ] } } "ports":{ "type":"git", "url":"https://github.com/trueos/trueos-ports", "branch":"trueos-master", "make.conf":{ "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", ← Where to get ports tree? Can be {git|svn|tar|null} "url":"https://github.com/trueos/trueos-ports", "branch":"trueos-master", "make.conf":{ "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", ← Where to get ports tree? Can be {git|svn|tar|null} "url":"https://github.com/trueos/trueos-ports", ← Git/SVN Location, Tar File, or Directory "branch":"trueos-master", "make.conf":{ "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", ← Where to get ports tree? Can be {git|svn|tar|null} "url":"https://github.com/trueos/trueos-ports", ← Git/SVN Location, Tar File, or Directory "branch":"trueos-master", ← Git/SVN Only "make.conf":{ "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", "url":"https://github.com/trueos/trueos-ports", "branch":"trueos-master", "make.conf":{ ← Port make options "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", "url":"https://github.com/trueos/trueos-ports", "branch":"trueos-master", "make.conf":{ ← Port make options "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", "url":"https://github.com/trueos/trueos-ports", "branch":"trueos-master", "make.conf":{ "default": [ ← Conditional - default always enabled "sysutils_tmux_UNSET=DOCS EXAMPLES" ], "WITH_TRUENAS":[ ← Conditional only used if WITH_TRUENAS is set "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "type":"git", "url":"https://github.com/trueos/trueos-ports", "branch":"trueos-master", "make.conf":{ "default": [ "sysutils_tmux_UNSET=DOCS EXAMPLES", "archivers_cabextract_UNSET=DOCS" ← Add new JSON string for each line ], "WITH_TRUENAS":[ "archivers_cabextract_UNSET=DOCS" ] } } "ports":{ "build-all":false, "build":{ "default":[ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, “local_source”:”/usr/project-source” } "ports":{ "build-all":false, ← Full Ports build "build":{ "default":[ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, “local_source”:”/usr/project-source” } "ports":{ "build-all":false, "build":{ ← Which ports to build or verify "default":[ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, “local_source”:”/usr/project-source” } "ports":{ "build-all":false, "build":{ "default":[ ← Conditional, default always enabled "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, “local_source”:”/usr/project-source” } "ports":{ "build-all":false, "build":{ "default":[ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, “local_source”:”/usr/project-source” ← Sources for inside poudriere build } .if exists(/usr/local_source/${PORTNAME}) PORTVERSION!= git -C /usr/local_source/${PORTNAME} log -1 --pretty=format:%ct EXTRACT_ONLY= WRKSRC= /usr/local_source/${PORTNAME} .else USE_GITHUB= yes GH_ACCOUNT= freenas GH_PROJECT= freenas GH_TAGNAME= 1ebae666066174638bb4d4f42cbec0f497b337ae .endif "iso":{ "file-name":"TrueOS-x64-%%TRUEOS_VERSION%%-%%GITHASH%%-%%DATE%%", "overlay":{ "type":"git", "url":"https://github.com/trueos/iso-overlay", "branch":"master" }, } "iso":{ "prune":{ "default": [ "/usr/local/share/examples", "/usr/local/include" ], "WITH_TRUENAS": [ "/usr/share/examples", "/usr/include" ] }, } "iso":{ "iso-packages":{ ← Packages to pre-install into ISO image "default": [ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, } "iso":{ “dist-packages":{ ← Package .txz files to have available on media "default": [ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS": [ "archivers/cabextract" ] }, } "iso":{ "auto-install-packages":{ ← When using TrueOS Installer - Packages to install "default": [ "sysutils/ipmitool", "sysutils/dmidecode", "sysutils/tmux" ], "WITH_TRUENAS”: [ "archivers/cabextract" ] }, } "iso":{ “install-script":"", ← Launch alternative installer "auto-install-script":"", "post-install-commands": [ { "chroot":true, "command":"touch /root/inside-chroot" }, { "chroot":false, "command":"touch /root/outside-chroot" } ] } "iso":{ “install-script":"", "auto-install-script":"", ← Use pc-sysinstall for fully unattended installation "post-install-commands": [ { "chroot":true, "command":"touch /root/inside-chroot" }, { "chroot":false, "command":"touch /root/outside-chroot" } ] } "iso":{ “install-script":"", "auto-install-script":"", "post-install-commands": [ ← When using TrueOS installer, commands to run at end { "chroot":true, "command":"touch /root/inside-chroot" }, { "chroot":false, "command":"touch /root/outside-chroot" } ] } "pkg-repo": { "url":"https://pkg.trueos.org/pkg/unstable/${ABI}/latest", "pubKey": [ "-----BEGIN PUBLIC KEY-----", “......”, “......” ] } /usr/obj/usr/src/amd64.amd64/pkgset/ /usr/obj/usr/src/amd64.amd64/release/ ● ● ● ● The majority of changes were centered around the following files: ○ Makefile.inc1 ■ Changes mostly to package creation target, injecting dependencies ■ Target added which runs poudriere and combines resulting packages back into single repo for signing ○ release/release-trueos.sh ■ Helper script ■ Contains logic for poudriere setup and execution ■ JSON parsing routines and logic ■ ISO directory creation and manipulation ○ release/Makefile ■ New “make iso” target to build TrueOS image, bypassing dist-files and focus primarily on pkg-base driven image ○ release/packages/*.ucl ■ Hard-coded a few packages depends, such as pkg, jq and uclcmd. ● In 2018 CI testing shouldn’t be an afterthought ● With TrueOS - Jenkins is our current CI system ● TrueOS ships with pre-defined “Pipelines” for a variety of CI jobs ● Pipelines all exist in the Jenkins/ subdirectory of world sources ● Pipelines are broken into the following stages ○ Checkout ○ Nullfs ○ World ○ Kernel ○ Base Packages ○ ISO ○ Dist ○ Artifact ○ Publish ● Keys / Publish settings will need to change to your specific needs ● Once modified, you can import these pipeline files into any Jenkins Git or MultiBranch job ● With ports / packages all being “equal” there are more opportunities to slim the base system today ● Some of the following may be good candidates to remove in favor of port versions ○ sendmail ○ svnlite ○ ntpd ○ ssh ○ <gasp> clang ○ Probably much more! ● Additional ISO customization options ○ Ability to control installation dialog options via JSON ○ Custom install logic? ● Base package “sets” for host / jails ○ Beyond Runtime/Development/Debug ○ User-defined via JSON? ● Further enhancements to compiler-bootstrap ○ /etc/ knobs for setting default? ● Integration into VM / LiveCD build targets A very special Thank-You! Martin Wilke Joe Maloney Ken Moore Eric Turgeon Thank You! References: https://github.com/trueos/trueos/ https://github.com/trueos/trueos/release/trueos-manifest.json.