178b6117dSBaptiste Daroussin#!/bin/sh 278b6117dSBaptiste Daroussin 378b6117dSBaptiste Daroussin# Should be enough for base image, image can be resized in needed 478b6117dSBaptiste Daroussinexport VMSIZE=5g 578b6117dSBaptiste Daroussin 678b6117dSBaptiste Daroussin# 1M config drive should be enough in most cases 778b6117dSBaptiste Daroussinexport CONFIG_DRIVE=YES 878b6117dSBaptiste Daroussinexport CONFIG_DRIVE_SIZE=1M 978b6117dSBaptiste Daroussin 1012074022SJose Luis Duran# Packages to install into the image we're creating. 1112074022SJose Luis Duran# * firstboot-freebsd-update, to install security updates at first boot. 1212074022SJose Luis Duranexport VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-freebsd-update" 1312074022SJose Luis Duran 1478b6117dSBaptiste Daroussin# Set to a list of third-party software to enable in rc.conf(5). 1512074022SJose Luis Duranexport VM_RC_LIST="${VM_RC_LIST} firstboot_freebsd_update growfs sshd nuageinit" 1678b6117dSBaptiste Daroussin 1778b6117dSBaptiste Daroussinvm_extra_pre_umount() { 1878b6117dSBaptiste Daroussin cat << EOF >> ${DESTDIR}/etc/rc.conf 1978b6117dSBaptiste Daroussindumpdev="AUTO" 2012074022SJose Luis Duranifconfig_DEFAULT="SYNCDHCP accept_rtadv" 21*b22be3bbSBaptiste Daroussin# RSA host keys are obsolete and also very slow to generate 22*b22be3bbSBaptiste Daroussinsshd_rsa_enable="NO" 2378b6117dSBaptiste DaroussinEOF 2478b6117dSBaptiste Daroussin 2578b6117dSBaptiste Daroussin cat << EOF >> ${DESTDIR}/boot/loader.conf 2678b6117dSBaptiste Daroussinautoboot_delay="-1" 2778b6117dSBaptiste Daroussinbeastie_disable="YES" 2878b6117dSBaptiste Daroussinloader_logo="none" 2978b6117dSBaptiste Daroussinconsole="comconsole,vidconsole" 3078b6117dSBaptiste DaroussinEOF 3112074022SJose Luis Duran 3278b6117dSBaptiste Daroussin cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config 3378b6117dSBaptiste DaroussinPasswordAuthentication yes 3478b6117dSBaptiste DaroussinUsePAM no 3578b6117dSBaptiste DaroussinEOF 3678b6117dSBaptiste Daroussin 3778b6117dSBaptiste Daroussin touch ${DESTDIR}/firstboot 3878b6117dSBaptiste Daroussin 3978b6117dSBaptiste Daroussin return 0 4078b6117dSBaptiste Daroussin} 41