mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
Provide both zfs and ufs images which a 1MB partition reserved for the config drive wearing a GPT Label "config-drive" to allow consumer to know where they should push the config drive on the provided image. This has been tested on OVHCloud baremetal via "bring your own image" Also tested on openstack Reviewed by: emaste Sponsored by: OVHCloud Differential Revision: https://reviews.freebsd.org/D44369 (cherry picked from commit78b6117dac) (cherry picked from commita977444652)
36 lines
704 B
Bash
36 lines
704 B
Bash
#!/bin/sh
|
|
#
|
|
#
|
|
|
|
# Should be enough for base image, image can be resized in needed
|
|
export VMSIZE=5g
|
|
|
|
# 1M config drive should be enough in most cases
|
|
export CONFIG_DRIVE=YES
|
|
export CONFIG_DRIVE_SIZE=1M
|
|
|
|
# Set to a list of third-party software to enable in rc.conf(5).
|
|
export VM_RC_LIST="sshd growfs nuageinit"
|
|
|
|
vm_extra_pre_umount() {
|
|
cat << EOF >> ${DESTDIR}/etc/rc.conf
|
|
dumpdev="AUTO"
|
|
ifconfig_DEFAULT="DHCP"
|
|
sshd_enable="YES"
|
|
EOF
|
|
|
|
cat << EOF >> ${DESTDIR}/boot/loader.conf
|
|
autoboot_delay="-1"
|
|
beastie_disable="YES"
|
|
loader_logo="none"
|
|
console="comconsole,vidconsole"
|
|
EOF
|
|
cat <<EOF >> ${DESTDIR}/etc/ssh/sshd_config
|
|
PasswordAuthentication yes
|
|
UsePAM no
|
|
EOF
|
|
|
|
touch ${DESTDIR}/firstboot
|
|
|
|
return 0
|
|
}
|