Skip to content

Commit aa4f56c

Browse files
committed
OPNsense installer preseed script introduced.
Signed-off-by: Mateusz Maciejewski <[email protected]>
1 parent d4af9c5 commit aa4f56c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
3+
LABEL=OPNBOOT
4+
INSTALLER_ROOT_PARTITION=/dev/da0p4
5+
INSTALLER_MOUNT_DIR=/mnt
6+
BSDINSTALL_DIR=/usr/libexec/bsdinstall
7+
TARGET_FILE=opnsense-zfs
8+
9+
echo FreeBSD+OPNsense bsdinstall modifier
10+
echo
11+
echo "WARNING: This script is supposed to be executed on any FreeBSD-compatible system."
12+
echo "Please connect OPNsense Installer USB stick and verify it's root partition device name to be: " ${INSTALLER_ROOT_PARTITION}
13+
echo "Please type 'yes' to continue."
14+
echo
15+
16+
read ANSWER
17+
if[ $ANSWER != yes ];
18+
then
19+
exit 1;
20+
fi
21+
22+
umount ${INSTALLER_MOUNT_DIR}
23+
mount -w /dev/da0p4 ${INSTALLER_MOUNT_DIR}
24+
ls -l ${BSDINSTALL_DIR}*zfs*
25+
awk -v sq="'" -v dq='"' -v ROOT_LABEL=${LABEL} '/^NEWFS_ESP=/ { print "NEWFS_ESP=" sq "newfs_msdos -L " ROOT_LABEL " " dq "%si" dq sq; next; }; { print; }' ${BSDINSTALL_DIR}/${TARGET_FILE} > /tmp/${TARGE_FILE}
26+
diff /tmp/${TARGE_FILE} ${BSDINSTALL_DIR}/${TARGET_FILE}
27+
umount {INSTALLER_MOUNT_DIR}

0 commit comments

Comments
 (0)