# $FreeBSD: releng/11.0/tools/tools/nanobsd/embedded/rpi.cfg 291930 2015-12-07 10:24:40Z imp $ #- # Copyright (c) 2017 Felix J. Ogris. All Rights Reserved. # Copyright (c) 2015 Warner Losh. All Rights Reserved. # Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL iXsystems, Inc. OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # 1. Put this file into /usr/src/tools/tools/nanobsd/embedded # 2. Install sysutils/u-boot-rpi and emulators/mtools # 3. cd /usr/src/tools/tools/nanobsd/embedded # 4. Edit the file called "common": In line 281 (std-embedded branch of "case ${NANO_LAYOUT}") replace: # mkimg -a 3 ... # by: # mkimg ... # (or install mkimg from -CURRENT) # 5. sh ../nanobsd.sh -c nanobsd-rasp-11.0.cfg # (...long coffee break...) # 6. dd the image from /usr/embedded/images to your sd card. NANO_ARCH=armv6 NANO_KERNEL=RPI-B NANO_DRIVE=mmcsd0 NANO_NAME=rpi-b NANO_BOOT_PKG=u-boot-rpi NANO_CPUTYPE=arm1176jzf-s . common # Pull in common definitions, keep last # 2 GB SD card NANO_MEDIASIZE=$((2*1000*1000*1000/512)) # 20 MiB /cfg NANO_CONFSIZE=$((20*1024*1024/512)) # 10 MiB /etc NANO_RAM_ETCSIZE=$((10*1024*1024/512)) # 48 MiB /tmp + /var NANO_RAM_TMPVARSIZE=$((48*1024*1024/512)) NANO_SLICE_DATA=s5 NANO_ROOT=s3a NANO_ALTROOT=s4a cust_local ( ) ( # enable gettys on console sed -i "" 's%xterm offifconsole%xterm on%' ${NANO_WORLDDIR}/etc/ttys # give it a hostname echo 'hostname="raspberry.local"' >>${NANO_WORLDDIR}/etc/rc.conf # allow ssh login using my key echo 'sshd_enable="YES"' >>${NANO_WORLDDIR}/etc/rc.conf mkdir -p -m 0700 ${NANO_WORLDDIR}/root/.ssh cp -av ~/.ssh/authorized_keys ${NANO_WORLDDIR}/root/.ssh/ ) last_orders ( ) ( local out out=${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME} mdconfig -a -t vnode -u 11 ${out} gpart set -a active -i 3 md11 mdconfig -d -u 11 ) customize_cmd cust_pkgng customize_cmd cust_allow_ssh_root customize_cmd cust_local