Skip to content

Instantly share code, notes, and snippets.

@frankharvey
Created January 5, 2020 19:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankharvey/7f5c482704ab05f39c06d0777ad227da to your computer and use it in GitHub Desktop.
Save frankharvey/7f5c482704ab05f39c06d0777ad227da to your computer and use it in GitHub Desktop.
FreeBSD 12.1 NanoBSD build file
NANO_NAME="custom"
NANO_ARCH="amd64"
NANO_KERNEL=GENERIC
NANO_DRIVE="da0"
NANO_PMAKE="make -j $(sysctl -n hw.ncpu)"
NANO_MEDIASIZE=1500000
NANO_BOOTLOADER="boot/boot0"
NANO_IMGNAME="nanobsd_${NANO_NAME}_${NANO_DRIVE}.img"
NANO_IMAGES=2
NANO_MODULES=
NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
NANO_PACKAGE_LIST="*"
NANO_PKG_META_BASE=/var/db
# Options to put in make.conf during buildworld only
#CONF_BUILD=' '
# Options to put in make.conf during installworld only
CONF_INSTALL='
WITHOUT_ACCT=
WITHOUT_AMD=
WITHOUT_APM=
WITHOUT_ASSERT_DEBUG=
WITHOUT_AT=
WITHOUT_ATM=
WITHOUT_AUDIT=
WITHOUT_AUTHPF=
WITHOUT_AUTOFS=
WITHOUT_AUTO_OBJ=
WITHOUT_BHYVE=
WITHOUT_BINUTILS=
WITHOUT_BINUTILS_BOOTSTRAP=
WITHOUT_BLACKLIST_SUPPORT=
WITHOUT_BLUETOOTH=
WITHOUT_BMAKE=
WITHOUT_BOOTPARAMD=
WITHOUT_BOOTPD=
WITHOUT_BSDINSTALL=
WITHOUT_BSD_CPIO=
WITHOUT_BSNMP=
WITHOUT_BZIP2=
WITHOUT_BZIP2_SUPPORT=
WITHOUT_CALENDAR=
WITHOUT_CCD=
WITHOUT_CDDL=
WITHOUT_CLANG=
WITHOUT_CLANG_BOOTSTRAP=
WITHOUT_CLANG_FULL=
WITHOUT_CLANG_IS_CC=
WITHOUT_CPP=
WITHOUT_CROSS_COMPILER=
WITHOUT_CTM=
WITHOUT_CUSE=
WITHOUT_CVS=
WITHOUT_CXGBETOOL=
WITHOUT_DEBUG_FILES=
WITHOUT_DIALOG=
WITHOUT_DICT=
WITHOUT_DMAGENT=
WITHOUT_DOCCOMPRESS=
WITHOUT_DYNAMICROOT=
WITHOUT_ED_CRYPTO=
WITHOUT_ELFTOOLCHAIN_BOOTSTRAP=
WITHOUT_EXAMPLES=
WITHOUT_FDT=
WITHOUT_FINGER=
WITHOUT_FLOPPY=
WITHOUT_FMTREE=
WITHOUT_FORMAT_EXTENSIONS=
WITHOUT_FORTH=
WITHOUT_FP_LIBC=
WITHOUT_FREEBSD_UPDATE=
WITHOUT_FTP=
WITHOUT_GAMES=
WITHOUT_GCC=
WITHOUT_GCC_BOOTSTRAP=
WITHOUT_GCOV=
WITHOUT_GDB=
WITHOUT_GDB_LIBEXEC=
WITHOUT_GNUCXX=
WITHOUT_GNU_DIFF=
WITHOUT_GNU_GREP_COMPAT=
WITHOUT_GPIO=
WITHOUT_GPL_DTC=
WITHOUT_HAST=
WITHOUT_HTML=
WITHOUT_HYPERV=
WITHOUT_ICONV=
WITHOUT_INCLUDES=
WITHOUT_INET6=
WITHOUT_INET6_SUPPORT=
WITHOUT_INFO=
WITHOUT_INSTALLLIB=
WITHOUT_IPFILTER=
WITHOUT_IPFW=
WITHOUT_ISCSI=
WITHOUT_JAIL=
WITHOUT_KDUMP=
WITHOUT_KERNEL_RETPOLINE=
WITHOUT_KERNEL_SYMBOLS=
WITHOUT_KVM=
WITHOUT_KVM_SUPPORT=
WITHOUT_LIB32=
WITHOUT_LIBCPLUSPLUS=
WITHOUT_LLD=
WITHOUT_LLDB=
WITHOUT_LLD_BOOTSTRAP=
WITHOUT_LLD_IS_LD=
WITHOUT_LLVM_COV=
WITHOUT_LLVM_TARGET_AARCH64=
WITHOUT_LLVM_TARGET_ALL=
WITHOUT_LLVM_TARGET_ARM=
WITHOUT_LLVM_TARGET_MIPS=
WITHOUT_LLVM_TARGET_POWERPC=
WITHOUT_LLVM_TARGET_SPARC=
WITHOUT_LLVM_TARGET_X86=
WITHOUT_LOADER_GELI=
WITHOUT_LOADER_OFW=
WITHOUT_LOADER_UBOOT=
WITHOUT_LOCALES=
WITHOUT_LOCATE=
WITHOUT_LPR=
WITHOUT_LS_COLORS=
WITHOUT_LZMA_SUPPORT=
WITHOUT_MAIL=
WITHOUT_MAILWRAPPER=
WITHOUT_MAKE=
WITHOUT_MAKE_CHECK_USE_SANDBOX=
WITHOUT_MAN=
WITHOUT_MANCOMPRESS=
WITHOUT_MAN_UTILS=
WITHOUT_MLX5TOOL=
WITHOUT_MODULE_DRM=
WITHOUT_MODULE_DRM2=
WITHOUT_NAND=
WITHOUT_NCP=
WITHOUT_NDIS=
WITHOUT_NETCAT=
WITHOUT_NETGRAPH=
WITHOUT_NETGRAPH_SUPPORT=
WITHOUT_NLS=
WITHOUT_NLS_CATALOGS=
WITHOUT_NS_CACHING=
WITHOUT_NTP=
WITHOUT_PC_SYSINSTALL=
WITHOUT_PF=
WITHOUT_PMC=
WITHOUT_PORTSNAP=
WITHOUT_PPP=
WITHOUT_PROFILE=
WITHOUT_QUOTAS=
WITHOUT_RADIUS_SUPPORT=
WITHOUT_RBOOTD=
WITHOUT_REPRODUCIBLE_BUILD=
WITHOUT_RESCUE=
WITHOUT_ROUTED=
WITHOUT_SENDMAIL=
WITHOUT_SERVICESDB=
WITHOUT_SETUID_LOGIN=
WITHOUT_SHAREDOCS=
WITHOUT_SOURCELESS=
WITHOUT_SOURCELESS_HOST=
WITHOUT_SOURCELESS_UCODE=
WITHOUT_SSP=
WITHOUT_SVNLITE=
WITHOUT_SYMVER=
WITHOUT_SYSCONS=
WITHOUT_SYSTEM_COMPILER=
WITHOUT_SYSTEM_LINKER=
WITHOUT_TALK=
WITHOUT_TCP_WRAPPERS=
WITHOUT_TELNET=
WITHOUT_TESTS=
WITHOUT_TESTS_SUPPORT=
WITHOUT_TEXTPROC=
WITHOUT_TFTP=
WITHOUT_TIMED=
WITHOUT_TOOLCHAIN=
WITHOUT_UNBOUND=
WITHOUT_UNIFIED_OBJDIR=
WITHOUT_USB_GADGET_EXAMPLES=
WITHOUT_UTMPX=
WITHOUT_VI=
WITHOUT_WARNS=
WITHOUT_WIRELESS=
WITHOUT_WIRELESS_SUPPORT=
WITHOUT_WPA_SUPPLICANT_EAPOL=
WITHOUT_ZFS=
WITHOUT_ZONEINFO=
'
# Options to put in make.conf during both build- & installworld.
#CONF_WORLD=' '
cust_rootpasswd() (
echo 'freebsd' | pw -V ${NANO_WORLDDIR}/etc/ usermod root -h 0
)
cust_install_build_files ( ) (
cd "${NANO_TOOLS}/${NANO_NAME}/overlay"
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR}
if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then
CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE}
fi
)
#Customize Commands Here:
customize_cmd cust_allow_ssh_root
customize_cmd cust_rootpasswd
customize_cmd cust_install_build_files
customize_cmd cust_install_files
customize_cmd cust_pkgng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment