From bd3cffc61af61deef062212a074726ae9ba910c8 Mon Sep 17 00:00:00 2001 From: Sharad Ahlawat Date: Thu, 11 Jun 2020 12:03:50 -0700 Subject: [PATCH] updates Jun 11 --- configs/etc/crontab-config.txt | 2 ++ configs/pxe/fstab.12p | 3 ++ configs/pxe/fstab.13p | 3 ++ configs/pxe/iscsi.conf.11 | 7 ++++ configs/pxe/iscsi.conf.12 | 7 ++++ configs/pxe/iscsi.conf.12p | 7 ++++ configs/pxe/iscsi.conf.13p | 7 ++++ configs/pxe/iscsid | 21 +++++++++++ configs/pxe/loader.conf | 1 + configs/pxe/sysctl.conf | 13 +++++++ jails/config/vm/windows.sh | 66 ++++++++++++++++++++++++++++++++++ 11 files changed, 137 insertions(+) create mode 100644 configs/etc/crontab-config.txt create mode 100644 configs/pxe/fstab.12p create mode 100644 configs/pxe/fstab.13p create mode 100644 configs/pxe/iscsi.conf.11 create mode 100644 configs/pxe/iscsi.conf.12 create mode 100644 configs/pxe/iscsi.conf.12p create mode 100644 configs/pxe/iscsi.conf.13p create mode 100755 configs/pxe/iscsid create mode 100644 configs/pxe/loader.conf create mode 100644 configs/pxe/sysctl.conf create mode 100755 jails/config/vm/windows.sh diff --git a/configs/etc/crontab-config.txt b/configs/etc/crontab-config.txt new file mode 100644 index 0000000..6095fc0 --- /dev/null +++ b/configs/etc/crontab-config.txt @@ -0,0 +1,2 @@ +00 08,12,16,20 * * * /root/FreeBSD/scripts/zfs_health.sh +00 2 * * 0 /usr/local/sbin/zfSnap -d -s -S -a 2w -p weekly_ -r zroot ship data base diff --git a/configs/pxe/fstab.12p b/configs/pxe/fstab.12p new file mode 100644 index 0000000..11c44dd --- /dev/null +++ b/configs/pxe/fstab.12p @@ -0,0 +1,3 @@ +# Device Mountpoint FStype Options Dump Pass# +192.168.0.10:/mnt/ship/pxe/FreeBSD12p / nfs rw 0 0 +fdescfs /dev/fd fdescfs rw 0 0 diff --git a/configs/pxe/fstab.13p b/configs/pxe/fstab.13p new file mode 100644 index 0000000..41fef92 --- /dev/null +++ b/configs/pxe/fstab.13p @@ -0,0 +1,3 @@ +# Device Mountpoint FStype Options Dump Pass# +192.168.0.10:/mnt/ship/pxe/FreeBSD13p / nfs rw 0 0 +fdescfs /dev/fd fdescfs rw 0 0 diff --git a/configs/pxe/iscsi.conf.11 b/configs/pxe/iscsi.conf.11 new file mode 100644 index 0000000..a2b9102 --- /dev/null +++ b/configs/pxe/iscsi.conf.11 @@ -0,0 +1,7 @@ +t0 { + TargetAddress = 192.168.0.10 + TargetName = iqn.nas.ahlawat.com:f11 + AuthMethod = CHAP + chapIName = user + chapSecret = secretsecret +} diff --git a/configs/pxe/iscsi.conf.12 b/configs/pxe/iscsi.conf.12 new file mode 100644 index 0000000..1afdda5 --- /dev/null +++ b/configs/pxe/iscsi.conf.12 @@ -0,0 +1,7 @@ +t0 { + TargetAddress = 192.168.0.10 + TargetName = iqn.nas.ahlawat.com:f12 + AuthMethod = CHAP + chapIName = user + chapSecret = secretsecret +} diff --git a/configs/pxe/iscsi.conf.12p b/configs/pxe/iscsi.conf.12p new file mode 100644 index 0000000..2e666d1 --- /dev/null +++ b/configs/pxe/iscsi.conf.12p @@ -0,0 +1,7 @@ +t0 { + TargetAddress = 192.168.0.10 + TargetName = iqn.nas.ahlawat.com:f12p + AuthMethod = CHAP + chapIName = user + chapSecret = secretsecret +} diff --git a/configs/pxe/iscsi.conf.13p b/configs/pxe/iscsi.conf.13p new file mode 100644 index 0000000..f39b03f --- /dev/null +++ b/configs/pxe/iscsi.conf.13p @@ -0,0 +1,7 @@ +t0 { + TargetAddress = 192.168.0.10 + TargetName = iqn.nas.ahlawat.com:f13p + AuthMethod = CHAP + chapIName = user + chapSecret = secretsecret +} diff --git a/configs/pxe/iscsid b/configs/pxe/iscsid new file mode 100755 index 0000000..4845968 --- /dev/null +++ b/configs/pxe/iscsid @@ -0,0 +1,21 @@ +#!/bin/sh +# +# $FreeBSD: releng/12.1/libexec/rc/rc.d/iscsid 298514 2016-04-23 16:10:54Z lme $ +# + +# PROVIDE: iscsid +# REQUIRE: NETWORK lockd +# BEFORE: DAEMON +# KEYWORD: nojail + +. /etc/rc.subr + +name="iscsid" +desc="iSCSI initiator daemon" +rcvar="iscsid_enable" +pidfile="/var/run/${name}.pid" +command="/usr/sbin/${name}" +required_modules="iscsi" + +load_rc_config $name +run_rc_command "$1" diff --git a/configs/pxe/loader.conf b/configs/pxe/loader.conf new file mode 100644 index 0000000..d5bf00d --- /dev/null +++ b/configs/pxe/loader.conf @@ -0,0 +1 @@ +if_bnxt_load="YES" diff --git a/configs/pxe/sysctl.conf b/configs/pxe/sysctl.conf new file mode 100644 index 0000000..9bf189d --- /dev/null +++ b/configs/pxe/sysctl.conf @@ -0,0 +1,13 @@ +# $FreeBSD: head/sbin/sysctl/sysctl.conf 337624 2018-08-11 13:28:03Z brd $ +# +# This file is read when going to multi-user and its contents piped thru +# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. +# + +# Uncomment this to prevent users from seeing information about processes that +# are being run under another UID. +#security.bsd.see_other_uids=0 + +net.link.bridge.pfil_bridge=0 +net.link.bridge.pfil_member=0 +net.link.bridge.pfil_onlyip=0 diff --git a/jails/config/vm/windows.sh b/jails/config/vm/windows.sh new file mode 100755 index 0000000..2185575 --- /dev/null +++ b/jails/config/vm/windows.sh @@ -0,0 +1,66 @@ +#!/usr/local/bin/bash + +# Copyright (c) 2018-2020, diyIT.org +# All rights reserved. +# +# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License") +# https://diyit.org/license/ +# +# + +# ./windows.sh under tmux + +# clean cached state +bhyvectl --destroy --vm=windows + +while true +do + +bhyve -c sockets=1,cores=2,threads=2 -m 16G -S -A -H -P \ +-s 0,hostbridge \ +-s 4,ahci-hd,/dev/zvol/ship/raw/windows,sectorsize=512 \ +-s 5,virtio-net,tap81,mac=00:0A:0B:0C:0D:81 \ +-s 6,ahci-hd,/dev/zvol/ship/raw/windows_data,sectorsize=512 \ +-s 29,fbuf,tcp=0.0.0.0:5981,w=1600,h=900 \ +-s 30,xhci,tablet \ +-s 31,lpc -l com1,/dev/nmdm81A \ +-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ +windows + +bhyve_exit=$? +# bhyve returns the following status codes: +# 0 - VM has been reset +# 1 - VM has been powered off +# 2 - VM has been halted +# 3 - VM generated a triple fault +# all other non-zero status codes are errors +# +if [ $bhyve_exit = 1 ] || [ $bhyve_exit = 2 ] +then + break +fi +echo `date` - restarting windows in 5 seconds - press ctrl-c to stop +sleep 5 + +done + +exit $? + +# -s 3,ahci,cd:/mnt/windows/w10.iso,cd:/mnt/windows/virtio-win.iso \ +# mounting the USB HDD as an attached drive to the system +#-s 3,ahci,cd:/mnt/windows/w10.iso,cd:/mnt/windows/virtio-win.iso,hd:/dev/daXp2 \ +# daX being an NTFS drive + +# bhyvectl --get-all --vm=windows + +# cu -l /dev/nmdm81B +# (This uses cu() so press ~+Ctrl-D to exit) + +#on base system: +#zfs create -V 32G -o refreservation=none ship/raw/windows +#zfs create -V 128G -o refreservation=none ship/raw/windows_data +# on boot +#ifconfig tap81 create +#ifconfig bridge1 addm tap81 up +#ifconfig tap81 up +#ifconfig tap81 inet6 auto_linklocal