Having had some really good times with nanobsd – I chose to keep this as the platform for my timeservers.
But as we all now new releases are not without problems – and having landed on 10.0-RELEASE I foresaw some difficulties with the build.
The first thing to annoy me was seemingly simple :
It seems there is a new pkg management tool out, and it doesn’t accept the same commands.
To start off the nanobsd.sh script insisted that there were no packages in ./Pkg ??
This I discovered was because the nanobsd script was looking for .tbz files – and pkgng uses txz !
So I had first to edit the nanobsd.sh
line 716 : ‘ls Pkg/*tbz | xargs -n 200 pkg_add -F’ || true
changed to : ‘ls Pkg/*txz | xargs -n 200 pkg add ‘ || true
Then the script complained about “signature not found for package.
So once again into the manpages – not much about signatures here. But reading on I discovered the “repository” option – by which pkg creates a pkg-list file in whatever directory you specify. In my case the directory was /usr/tools/tools/nanobsd/Pkg so:
pkg repo /usr/tools/tools/nanobsd/Pkg
It didn’t work though so I gave up and googled – and at last I found this little gem on the net – full credit goes to Patrick M. Hausen :
cust_pkgng () (
# If the package directory doesn’t exist, we’re done.
if [ ! -d ${NANO_PACKAGE_DIR} ]; then
echo “DONE 0 packages”
return 0
fi
# Copy packages into chroot
mkdir -p ${NANO_WORLDDIR}/Pkg
(
cd ${NANO_PACKAGE_DIR}
find ${NANO_PACKAGE_LIST} -print |
cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
)
# Count & report how many we have to install
todo=`ls ${NANO_WORLDDIR}/Pkg | wc -l`
echo “=== TODO: $todo”
ls ${NANO_WORLDDIR}/Pkg
echo “===”
while true
do
# Record how many we have now
have=`pkg -c ${NANO_WORLDDIR} info | wc -l`
# Attempt to install more packages
# …but no more than one at a time – experienced sqlite errors
(cd ${NANO_WORLDDIR} && ls Pkg/*txz) | xargs -n 1 pkg -c ${NANO_WORLDDIR} add || true
# See what that got us
now=`pkg -c ${NANO_WORLDDIR} info | wc -l`
echo “=== NOW $now”
pkg -c ${NANO_WORLDDIR} info
echo “===”
if [ $now -eq $todo ] ; then
echo “DONE $now packages”
break
elif [ $now -eq $have ] ; then
echo “FAILED: Nothing happened on this pass”
exit 2
fi
done
rm -rf ${NANO_WORLDDIR}/Pkg
)
And robert was your mothers brother – or so I thought ! Not out of the woods yet – some trimming is needed to fix the somewhat cramped space I have – pretty sure I can cram it onto a 128Mb Flash – but the 32MB is not likely.
The kernel :
net4501pps�root@aengus:/usr/src/tools/tools/nanobsd
cpu I486_CPU
cpu I586_CPU
cpu I686_CPU
ident net4501pps
options SCHED_ULE
options PREEMPTION
options INET
options TCP_OFFLOAD
options SCTP
options FFS
options SOFTUPDATES
options UFS_ACL
options UFS_DIRHASH
options UFS_GJOURNAL
options QUOTA
options MD_ROOT
options NFSCL
options NFSD
options NFSLOCKD
options NFS_ROOT
options MSDOSFS
options CD9660
options PROCFS
options PSEUDOFS
options GEOM_PART_GPT
options GEOM_RAID
options GEOM_LABEL
options COMPAT_FREEBSD4
options COMPAT_FREEBSD5
options COMPAT_FREEBSD6
options COMPAT_FREEBSD7
options SCSI_DELAY=5000
options KTRACE
options STACK
options SYSVSHM
options SYSVMSG
options SYSVSEM
options _KPOSIX_PRIORITY_SCHEDULING
options PRINTF_BUFR_SIZE=128
options KBD_INSTALL_CDEV
options HWPMC_HOOKS
options AUDIT
options CAPABILITY_MODE
options CAPABILITIES
options PROCDESC
options MAC
options KDTRACE_HOOKS
options DDB_CTF
options INCLUDE_CONFIG_FILE
options KDB
device cpufreq
device acpi
device eisa
device pci
device ahci
device ata
options ATA_STATIC_ID
device mvs
device siis
device scbus
device ch
device da
device sa
device pass
device atkbdc
device atkbd
device kbdmux
device vga
device splash
device sc
options SC_PIXEL_MODE
device pmtimer
device uart
device ppc
device ppbus
device ppi
device miibus
device sis
device vr
device loop
device random
device padlock_rng
device rdrand_rng
device ether
device vlan
device tun
device md
device usb
device virtio
# Time specific entries
option CPU_ELAN
option CPU_ELAN_PPS
option CPU_ELAN_XTAL=1000
option CPU_GEODE
option CPU_SOEKRIS