Skip to content

Commit

Permalink
FreeBSD 14.0-RELEASE (#27)
Browse files Browse the repository at this point in the history
* FreeBSD 14.0-RELEASE
  • Loading branch information
jlduran committed Nov 23, 2023
1 parent fe352a3 commit 6738c6f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Packer
uses: hashicorp/setup-packer@main
Expand All @@ -33,7 +33,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize Packer
run: packer init .
Expand All @@ -52,7 +52,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize Packer
run: packer init .
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> [!WARNING]
> FreeBSD 14.0-RELEASE is currently failing to build on VirtualBox.
packer-FreeBSD
==============

Expand Down Expand Up @@ -30,15 +33,15 @@ To create a box:

$ packer init .

3. Build the box:
3. Build the box (`virtualbox-iso.freebsd` or `qemu.freebsd`):

$ packer build -only=virtualbox-iso.freebsd .

4. Add it to the list of Vagrant boxes. See
[Handling `.iso` and `.box` files](#handling-iso-and-box-files) for
more information.

$ vagrant box add builds/FreeBSD-13.2-RELEASE-amd64.box --name FreeBSD-13.2-RELEASE-amd64
$ vagrant box add builds/FreeBSD-14.0-RELEASE-amd64.box --name FreeBSD-14.0-RELEASE-amd64

Sample `Vagrantbox` file
------------------------
Expand All @@ -59,7 +62,7 @@ ansible_raw_arguments = []
Vagrant.configure(2) do |config|
servers.each do |server|
config.vm.define server[:name] do |box|
box.vm.box = 'FreeBSD-13.2-RELEASE-amd64'
box.vm.box = 'FreeBSD-14.0-RELEASE-amd64'
box.vm.hostname = server[:name]
box.vm.provider 'virtualbox' do |v|
v.default_nic_type = 'virtio'
Expand Down Expand Up @@ -113,7 +116,7 @@ guest_os_type = "FreeBSD_64"
memory = 1024
mirror = "https://download.freebsd.org"
rc_conf_file = ""
revision = "13.2"
revision = "14.0"
```

The following variables can be set:
Expand All @@ -125,7 +128,7 @@ The following variables can be set:
- `memory` is the amount of RAM in megabytes assigned. _Default:_
`1024`

- `revision` is the FreeBSD revision number. _Default:_ `13.2`
- `revision` is the FreeBSD revision number. _Default:_ `14.0`

- `branch` used in conjunction with `build_date`, `git_commit` and
`directory`. _Default:_ `RELEASE`
Expand Down
11 changes: 10 additions & 1 deletion http/installerconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ if [ -e /dev/vtbd0 ]; then
GEOM=vtbd0 # VirtIO (QEMU)
fi

if [ -z $GEOM ]; then
echo "ERROR: No disks found." >&2
exit 1
fi

if [ "$FILESYSTEM" = 'ufs' ]; then
PARTITIONS="$GEOM"
else
Expand All @@ -26,17 +31,21 @@ if [ "$RC_CONF_FILE" = 'local' ]; then
touch /tmp/rc-local
SSHD_RC_CONF_FILE=/etc/rc.conf.local
SENDMAIL_RC_CONF_FILE=/etc/rc.conf.local
SYSCTL_CONF_FILE=/etc/sysctl.conf.local
elif [ "$RC_CONF_FILE" = 'vendor' ]; then
touch /tmp/rc-vendor
SSHD_RC_CONF_FILE=/etc/defaults/vendor.conf
SENDMAIL_RC_CONF_FILE=/etc/defaults/vendor.conf
SYSCTL_CONF_FILE=/etc/sysctl.conf
elif [ "$RC_CONF_FILE" = 'name' ]; then
touch /tmp/rc-name
SSHD_RC_CONF_FILE=/etc/rc.conf.d/sshd
SENDMAIL_RC_CONF_FILE=/etc/rc.conf.d/sendmail
SYSCTL_CONF_FILE=/etc/sysctl.conf.d/reboot.conf # XXX
else
SSHD_RC_CONF_FILE=/etc/rc.conf
SENDMAIL_RC_CONF_FILE=/etc/rc.conf
SYSCTL_CONF_FILE=/etc/sysctl.conf
fi

# Disable X11
Expand Down Expand Up @@ -66,7 +75,7 @@ echo 'vagrant' | pw usermod root -h 0
echo 'debug.trace_on_panic=1'
echo 'debug.debugger_on_panic=0'
echo 'kern.panic_reboot_wait_time=0'
} >> /etc/sysctl.conf
} >> "$SYSCTL_CONF_FILE"

# The console is not interactive, so we might as well boot quickly
sysrc -f /boot/loader.conf autoboot_delay=-1
Expand Down
6 changes: 5 additions & 1 deletion scripts/hardening.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if [ -e /tmp/rc-local ]; then
NETOPTIONS_RC_CONF_FILE=/etc/rc.conf.local
ROUTING_RC_CONF_FILE=/etc/rc.conf.local
SSHD_RC_CONF_FILE=/etc/rc.conf.local
SYSCTL_CONF_FILE=/etc/sysctl.conf.local
SYSLOGD_RC_CONF_FILE=/etc/rc.conf.local
elif [ -e /tmp/rc-vendor ]; then
BLACKLISTD_RC_CONF_FILE=/etc/defaults/vendor.conf
Expand All @@ -16,6 +17,7 @@ elif [ -e /tmp/rc-vendor ]; then
NETOPTIONS_RC_CONF_FILE=/etc/defaults/vendor.conf
ROUTING_RC_CONF_FILE=/etc/defaults/vendor.conf
SSHD_RC_CONF_FILE=/etc/defaults/vendor.conf
SYSCTL_CONF_FILE=/etc/sysctl.conf
SYSLOGD_RC_CONF_FILE=/etc/defaults/vendor.conf
elif [ -e /tmp/rc-name ]; then
BLACKLISTD_RC_CONF_FILE=/etc/rc.conf.d/blacklistd
Expand All @@ -24,6 +26,7 @@ elif [ -e /tmp/rc-name ]; then
NETOPTIONS_RC_CONF_FILE=/etc/rc.conf.d/netoptions
ROUTING_RC_CONF_FILE=/etc/rc.conf.d/routing
SSHD_RC_CONF_FILE=/etc/rc.conf.d/sshd
SYSCTL_CONF_FILE=/etc/sysctl.conf.d/hardening.conf # XXX
SYSLOGD_RC_CONF_FILE=/etc/rc.conf.d/syslogd
else
BLACKLISTD_RC_CONF_FILE=/etc/rc.conf
Expand All @@ -32,6 +35,7 @@ else
NETOPTIONS_RC_CONF_FILE=/etc/rc.conf
ROUTING_RC_CONF_FILE=/etc/rc.conf
SSHD_RC_CONF_FILE=/etc/rc.conf
SYSCTL_CONF_FILE=/etc/sysctl.conf
SYSLOGD_RC_CONF_FILE=/etc/rc.conf
fi

Expand Down Expand Up @@ -96,7 +100,7 @@ sysrc -f "$CLEARTMP_RC_CONF_FILE" clear_tmp_enable=YES
sysrc -f "$SYSLOGD_RC_CONF_FILE" syslogd_flags=-ss

# Change sysctl default values
cat > /etc/sysctl.conf <<- EOF
cat > "$SYSCTL_CONF_FILE" <<- EOF
debug.debugger_on_panic=0
debug.trace_on_panic=1
hw.kbd.keymap_restrict_change=4
Expand Down
14 changes: 7 additions & 7 deletions scripts/vmtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ fi
case "$PACKER_BUILDER_TYPE" in

virtualbox-iso|virtualbox-ovf)
pkg install -qy virtualbox-ose-additions-nox11
# pkg install -qy virtualbox-ose-additions-nox11

sysrc -f "$DBUS_RC_CONF_FILE" dbus_enable=YES
sysrc -f "$VBOXGUEST_RC_CONF_FILE" vboxguest_enable=YES
sysrc -f "$VBOXSERVICE_RC_CONF_FILE" vboxservice_enable=YES
# sysrc -f "$DBUS_RC_CONF_FILE" dbus_enable=YES
# sysrc -f "$VBOXGUEST_RC_CONF_FILE" vboxguest_enable=YES
# sysrc -f "$VBOXSERVICE_RC_CONF_FILE" vboxservice_enable=YES

cat >> /boot/loader.conf <<- END
#VIRTUALBOX-BEGIN
vboxdrv_load="YES"
#VIRTUALBOX-END
# VIRTUALBOX-BEGIN
#vboxdrv_load="YES"
# VIRTUALBOX-END
END
;;

Expand Down
2 changes: 1 addition & 1 deletion variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ variable "rc_conf_file" {

variable "revision" {
type = string
default = "13.2"
default = "14.0"
}
2 changes: 1 addition & 1 deletion variables.pkrvars.hcl.sample
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ guest_os_type = "FreeBSD_64"
memory = 1024
mirror = "https://download.freebsd.org"
rc_conf_file = ""
revision = "13.2"
revision = "14.0"

0 comments on commit 6738c6f

Please sign in to comment.