File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
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}
You can’t perform that action at this time.
0 commit comments