This repository has been archived by the owner on Sep 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sk6501.conf
129 lines (121 loc) · 3.54 KB
/
sk6501.conf
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
123
124
125
126
127
128
129
NANO_BOOT2CFG="-h"
NANO_BOOTLOADER="boot/boot0"
NANO_KERNEL=SK6501
NANO_NAME=sk6501
NANO_DRIVE=da0
NANO_MEDIASIZE=`expr -e 16008609792 / 512` # 16G SanDisk Cruzer Fit
NANO_RAM_ETCSIZE=`expr -e 10485760 / 512`
NANO_RAM_TMPVARSIZE=`expr -e 52428800 / 512`
NANO_MODULES="coretemp pf pflog usb"
NANO_PACKAGE_LIST="apcupsd \
ca_root_nss \
darkstat \
devcpu-data \
dma \
dnscrypt-proxy \
dnstop \
dyfi_update \
feather \
htop \
iftop \
iperf3 \
isc-dhcp43-server \
mtr-nox11 \
ncdu \
nmap \
lsof \
openntpd \
perl5 \
pftop \
py27-speedtest-cli \
python2 \
tarsnap \
tmux \
unbound \
vim-console \
void-zones-tools"
cust_comconsole_vt100() {
sed -i "" -e /ttyu0/s/dialup/vt100/ ${NANO_WORLDDIR}/etc/ttys
}
cust_loader_conf() {
cat << EOF >> ${NANO_WORLDDIR}/boot/loader.conf
beastie_disable="YES"
hint.acpi.0.disabled=1
coretemp_load="YES"
hw.em.smart_pwr_down=1
autoboot_delay="3"
hint.p4tcc.0.disabled="0"
kern.cam.boot_delay="10000"
EOF
}
# http://freebsd.1045724.n5.nabble.com/10-0-BETA3-nanobsd-sh-does-not-use-pkg-tp5862439p5862531.html
cust_pkgng() {
TEMP_RESOLV_CONF=${NANO_WORLDDIR}/etc/resolv.conf
echo "nameserver 9.9.9.9" > ${TEMP_RESOLV_CONF}
LOCAL_REPO_DIR=${NANO_WORLDDIR}/usr/local/etc/pkg/repos
SSL_CONF_DIR=${NANO_WORLDDIR}/usr/local/etc/ssl
mkdir -p ${LOCAL_REPO_DIR} ${SSL_CONF_DIR}
cat << EOF >> ${LOCAL_REPO_DIR}/FreeBSD.conf
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/\${ABI}/latest"
}
EOF
pkg -c ${NANO_WORLDDIR} install -y ca_root_nss
cat << EOF >> ${LOCAL_REPO_DIR}/pkg.valkonen.fi.conf
pkg.valkonen.fi: {
url: "https://pkg.valkonen.fi/packages",
mirror_type: "http",
signature_type: "pubkey",
pubkey: "/usr/local/etc/ssl/pkg.valkonen.fi.pub",
enabled: yes,
priority: 100
}
EOF
cat << EOF >> ${SSL_CONF_DIR}/pkg.valkonen.fi.pub
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA27z9uKZUDOJI0SsRYq3K
gpUT6d4q4oFUglttOGB1jkthZjZE9IX9HQ8Mqo6g+SMorzWxDNBuexGKobUm1ESy
Wud0GfEJDG1pHKE3T3TMI01L25zQcZgb+b4daPpAEzYuF0MHqMQdfy9M+r2Ilt6O
Zqw9PsuYbWqLm8r/a65cR6pRUR5QK4akNtPTcMuL0sQ1adQXIz/v6vtQX/eqR1dS
TpcaoS44+bJWiFU3Fy5MvoCaOXkOPhvCqxW6wzl2TPYiGx33RgIrMTSpPvZa6idh
x6P5grku72Zm4rXre+T/frOcXQSFmpY0kG/1fC5c5swG6+zxwh+YMCf2LTdxcrcb
ZcJGGT66YmDZGvzHb1Hx7iLFQBiviTyyPM+r+j0PLF/s7wS6dMMZXByhO52RxDo3
X2W0Pz5S+d/2Oo6PtPQf15k7RvTzxEBVLPUCJqagRgJ5Bq2flddg5ML20Hdr7gsy
G7D9rBnTYMVmQELevdrCOehvVj+yWsQBALt1w5abE+0XzoOEW6iusn90oGfJP4qg
S/I50ATPjMalObsmDe0OGl4jLlHo7pjUXtITGqIF+cmUVRkDrG7zrMGJnsTL0375
E1T6aIZSlxKDqGVZrJqUXKXPrTZWjBA/hWkhyqWlIzchX+S8gdN0r7tE/WWw8oDa
2eeD1UylDV+aG0iuugUmBxECAwEAAQ==
-----END PUBLIC KEY-----
EOF
pkg -c ${NANO_WORLDDIR} install -y ${NANO_PACKAGE_LIST}
pkg -c ${NANO_WORLDDIR} clean -ay
rm -Rf ${NANO_WORLDDIR}/var/db/pkg
rm -Rf ${NANO_WORLDDIR}/conf/base/var/db/pkg
rm ${TEMP_RESOLV_CONF}
}
cust_timezone() {
cp ${NANO_WORLDDIR}/usr/share/zoneinfo/Europe/Helsinki ${NANO_WORLDDIR}/etc/localtime
}
cust_console_log() {
sed -i "" -e "s/^#\(console\.info.*\)/\1/" ${NANO_WORLDDIR}/etc/syslog.conf
cat << EOF >> ${NANO_WORLDDIR}/etc/rc.d/var
if [ ! -f /var/log/console.log ]; then
touch /var/log/console.log; chmod 600 /var/log/console.log
fi
EOF
}
cust_symlink_python() {
ln -s /usr/local/bin/python2 ${NANO_WORLDDIR}/usr/local/bin/python
}
cust_init_void_zones() {
touch ${NANO_WORLDDIR}/var/unbound/local-void.zones
}
customize_cmd cust_comconsole
customize_cmd cust_comconsole_vt100
customize_cmd cust_install_files
customize_cmd cust_loader_conf
customize_cmd cust_pkgng
customize_cmd cust_timezone
customize_cmd cust_console_log
customize_cmd cust_symlink_python
customize_cmd cust_init_void_zones