-
Notifications
You must be signed in to change notification settings - Fork 0
/
Furious.cfg
122 lines (92 loc) · 3.56 KB
/
Furious.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
PARTITIONS=vtbd0
DISTRIBUTIONS="kernel.txz base.txz Furious.txz"
BSDINSTALL_DISTSITE=ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.1-RELEASE
#!/bin/sh
set -o xtrace
echo "==> Running Furious.cfg"
# Enable serial and internal consoles
echo "==> Enabling serial and internal consoles"
echo "-Dhv" > /boot.config
echo "cuau0 \"/usr/libexec/getty std.38400\" xterm on secure" >> /etc/ttys
echo "==> Adding boot loader settings"
cat << BOOT > /boot/loader.conf
autoboot_delay="5"
verbose_loading="YES"
hw.snd.default_auto=0
hw.usb.disable_enumeration=1
hw.usb.no_boot_wait=1
hw.usb.no_shutdown_wait=1
BOOT
echo "==> Setting up rc.conf"
cat > /etc/rc.conf << RC_CONF
fsck_y_enable="YES"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
RC_CONF
# Fetch and install binary updates. Ensures we have the latest security fixes.
echo "==> Running freebsd-update fetch and freebsd-update install"
# Remove src from update since it's not installed
# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198030
sed -i.bak -e s/Components\ src\ world\ kernel/Components\ world\ kernel/g /etc/freebsd-update.conf
cat << FREEBSDUPDATE > /tmp/freebsd-update.conf
KeyPrint 800651ef4b4c71c27e60786d7b487188970f4b4169cc055784e21eb71d410cc5
ServerName update.FreeBSD.org
Components world/base kernel
IgnorePaths
IDSIgnorePaths /usr/share/man/cat
IDSIgnorePaths /usr/share/man/whatis
IDSIgnorePaths /var/db/locate.database
IDSIgnorePaths /var/log
UpdateIfUnmodified /etc/ /var/ /root/ /.cshrc /.profile
MergeChanges /etc/ /boot/device.hints
BackupKernel no
FREEBSDUPDATE
env PAGER=cat freebsd-update -f /tmp/freebsd-update.conf fetch
env PAGER=cat freebsd-update -f /tmp/freebsd-update.conf install
echo "==> Installing packages"
env ASSUME_ALWAYS_YES=YES pkg update -f
env ASSUME_ALWAYS_YES=YES pkg upgrade -q -y
env ASSUME_ALWAYS_YES=YES pkg install -q -y mc bash bash-completion curl wget htop nano tmux screen py27-glances
env ASSUME_ALWAYS_YES=YES pkg autoremove
env ASSUME_ALWAYS_YES=YES pkg clean -a
echo "== Enable root login via ssh"
sed -i.bak -e s/#PermitRootLogin\ no/PermitRootLogin\ without-password/g /etc/ssh/sshd_config
## Build date used for motd and product file
BUILDDATE=$(date +%Y%m%d)
RELEASE="11.1-RELEASE"
DOC_URL="https://github.com/8bite5d0/Furious-Admin-Tool"
# Create MOTD
echo "Creating /etc/motd"
mv /etc/motd /etc/motd-backup
cat << MOTD > /etc/motd
________ __
/ | / |
$$$$$$$$/__ __ ______ $$/ ______ __ __ _______
$$ |__ / | / | / \ / | / \ / | / | / |
$$ | $$ | $$ |/$$$$$$ |$$ |/$$$$$$ |$$ | $$ |/$$$$$$$/
$$$$$/ $$ | $$ |$$ | $$/ $$ |$$ | $$ |$$ | $$ |$$ \
$$ | $$ \__$$ |$$ | $$ |$$ \__$$ |$$ \__$$ | $$$$$$ |
$$ | $$ $$/ $$ | $$ |$$ $$/ $$ $$/ / $$/
$$/ $$$$$$/ $$/ $$/ $$$$$$/ $$$$$$/ $$$$$$$/
Instance (FreeBSD $RELEASE $BUILDDATE)
$DOC_URL
MOTD
# Create product file
echo "Creating /etc/product file"
cat << PRODUCT > /etc/product
Name: 8bite5d0
Image: Furious-Admin-Tool $RELEASE $BUILDDATE
Documentation: $DOC_URL
Description: FreeBSD $RELEASE 64-bit image with just essential packages \
installed. Ideal for users who are comfortable with setting up their \
own environment and tools.
PRODUCT
echo "Cleaning up"
rm -rf /tmp/installscript
rm -rf /var/db/freebsd-update/*
rm -rf /tmp/freebsd-update.conf
rm -rf /boot/kernel/*.symbols
echo "End of installerconfig"
# Shutdown/Poweroff
poweroff