Check-in [0be859974c]
Logged in as anonymous
Overview
Comment:add pf/pflog, rename ifconfig to netif, comment defaults a little, fix random
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0be859974cf73b606d6dbd113962028ce7a4c6c45a8d8604ea45f0462420734f
User & Date: arcade on 2019-10-25 19:00:27.273
Other Links: manifest | tags
Context
2019-10-25
19:23
add zfs check-in: cda92733d7 user: arcade tags: trunk
19:00
add pf/pflog, rename ifconfig to netif, comment defaults a little, fix random check-in: 0be859974c user: arcade tags: trunk
18:58
force failure on error check-in: af90e819b1 user: arcade tags: trunk
Changes

1
2




3


4


5
6
7
8

9


10
11
12

13


14
15


16


17



18















19





CLEANVAR_DIRS?=/var/run /var/spool/lock /var/spool/uucp/.Temp
CRASHINFO_ENABLE?=no




DEVFS_CONFIG_FILES?=/etc/defaults/devfs.conf /etc/devfs.conf


DMESG_FILE?=/var/run/dmesg.boot


DUMPDEV?=no
DUMPDIR?=/var/crash
ENTROPY_FILE?=/var/db/entropy/random
ENTROPY_DIR?=/var/db/entropy

FSCK_Y_ENABLE?=no


HOSTNAME?=Amnesiac
IFCONFIG_IFACES?=lo0
IFCONFIG_lo0?=inet 127.0.0.1/8 up

KLD_LIST?=


LDCONFIG_PATHS?=/lib /usr/lib /usr/local/lib /usr/pkg/lib
LDCONFIG_LOCAL_DIRS?=/usr/local/libdata/ldconfig


NETFS_TYPES?=nfs:NFS smbfs:SMB


NEWSYSLOG_ENABLE?=no



NFSCLIENT_ENABLE?=no















RPC_UMNTALL_ENABLE?=no




>

|
>
>
>
>

>
>

>
>

|
<
<
>

>
>

|
<
>

>
>


>
>

>
>

>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
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
# cleanvar
CLEANVAR_DIRS?=/var/run /var/spool/lock /var/spool/uucp/.Temp

# cloned
CLONED_INTERFACES?=

# devfs
DEVFS_CONFIG_FILES?=/etc/defaults/devfs.conf /etc/devfs.conf

# dmesg
DMESG_FILE?=/var/run/dmesg.boot

# dumpon
DUMPDEV?=no



# fsck
FSCK_Y_ENABLE?=no

# hostname
HOSTNAME?=Amnesiac


# kld
KLD_LIST?=

# ldconfig
LDCONFIG_PATHS?=/lib /usr/lib /usr/local/lib /usr/pkg/lib
LDCONFIG_LOCAL_DIRS?=/usr/local/libdata/ldconfig

# mount
NETFS_TYPES?=nfs:NFS smbfs:SMB

# newsyslog
NEWSYSLOG_ENABLE?=no
NEWSYSLOG_FLAGS?=

# nfsclient
NFSCLIENT_ENABLE?=no

# netif
IFCONFIG_IFACES?=lo0
IFCONFIG_lo0?=inet 127.0.0.1/8; up

# pf
PF_ENABLE?=no
PF_RULES?=/etc/pf.conf
PF_FLAGS?=

# random
ENTROPY_DIR?=/var/db/entropy
ENTROPY_FILE?=/var/db/entropy/random

# rpc_umntall
RPC_UMNTALL_ENABLE?=no

# savecore
CRASHINFO_ENABLE?=no
DUMPDIR?=/var/crash
Modified init.mk from [d4088447d2] to [2f8a6c06fb].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Meta targets

TARGETS+=adjkerntz bootfs cleanvar cleartmp cloned devfs dmesg dumpon fsck \
	hostname ifconfig kld ldconfig microcode mixer mount mountlate msgs \
	newsyslog nextboot nfsclient pwcheck random root rpc_umntall runshm \
	savecore swap sysctl sysdb wlans

DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig nfsclient cleartmp

LOGIN: DAEMON dntpd msgs powerd

NETWORK: ifconfig devd hostname

SERVERS: swap mountlate syslogd newsyslog

SERVICE: ifconfig mount random hostname cleanvar

# regular targets

adjkerntz: random mount
	echo "MRC:$@> Adjust kernel timezone."
	adjkerntz -i




|
|


|

|

|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Meta targets

TARGETS+=adjkerntz bootfs cleanvar cleartmp cloned devfs dmesg dumpon fsck \
	hostname kld ldconfig microcode mixer mount mountlate msgs netif \
	newsyslog nextboot nfsclient pf pwcheck random root rpc_umntall runshm \
	savecore swap sysctl sysdb wlans

DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig nfsclient cleartmp pflogd

LOGIN: DAEMON dntpd msgs powerd pflogd

NETWORK: netif devd hostname

SERVERS: swap mountlate syslogd newsyslog

SERVICE: netif mount random hostname cleanvar

# regular targets

adjkerntz: random mount
	echo "MRC:$@> Adjust kernel timezone."
	adjkerntz -i

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
	   ;; \
	esac

hostname:
	echo "MRC:$@> Setting to ${HOSTNAME}."
	hostname ${HOSTNAME}

ifconfig: adjkerntz wlans cloned kld
	echo "MRC:$@> Starting interfaces: ${IFCONFIG_IFACES}"
.for iface in ${IFCONFIG_IFACES}
.for item in ${IFCONFIG_${iface}:tW:ts;}
	ifconfig ${iface} ${item}
.endfor
.undef _IFCONFIG_ARGS
.endfor

kld: bootfs
.if defined(KLD_LIST)
	echo "MRC:$@> Loading kernel modules: ${KLD_LIST}"
	kldload -n ${KLD_LIST}
.endif

.for path in ${LDCONFIG_PATHS} /etc/ld-elf.so.conf







<
<
<
<
<
<
<
<
<







105
106
107
108
109
110
111









112
113
114
115
116
117
118
	   ;; \
	esac

hostname:
	echo "MRC:$@> Setting to ${HOSTNAME}."
	hostname ${HOSTNAME}










kld: bootfs
.if defined(KLD_LIST)
	echo "MRC:$@> Loading kernel modules: ${KLD_LIST}"
	kldload -n ${KLD_LIST}
.endif

.for path in ${LDCONFIG_PATHS} /etc/ld-elf.so.conf
189
190
191
192
193
194
195






















196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214

215
216

217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232

.if empty(NFSCLIENT_ENABLE:tl:Mno)
DAEMON_rpcbind_ENABLE=yes
.endif

nfsclient: NETWORK rpcbind rpc_umntall
	test -z "$${NFSCLIENT_ENABLE}" || kldload -n nfs























pwcheck: mountlate syslogd
	echo "MRC:$@> Checking password lock file."
.if exists(/etc/ptmp)
	logger -s -p auth.err "password file may be incorrect -- /etc/ptmp \
	  exists"
.endif

random: mount devfs
	echo "MRC:$@> Seeding."
	sysctl kern.seedenable=1 > /dev/null
	( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) 2>&1 | \
	  dd status=none of=/dev/random bs=8k
	cat /bin/ls | dd status=none of=/dev/random bs=8k
.if exists(ENTROPY_DIR) # XXX
.for file in ${:!find ${ENTROPY_DIR} -type f!}
	dd status=none if=${file} of=/dev/random bs=8k
.endfor
.elif exists(ENTROPY_FILE)

	dd status=none if=${ENTROPY_FILE} of=/dev/random bs=8k
.endif

	sysctl kern.seedenable=0 > /dev/null

root: fsck bootfs
	echo "MRC:$@> Mount root R/W."
	mount -uo rw /
	umount -a

rpc_umntall: mountlate NETWORK rpcbind
.if empty(RPC_UMNTALL_ENABLE:tl:Mno) # XXX
	echo "MRC:$@> Sending RPC unmount notifications."; \
	test -f /var/db/mounttab || true && \
	  rpc.umntall -k &
.endif

runshm: cleanvar
	echo "MRC:$@> Mount and populate /var/run/shm."; \







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|
|

|
|
|
|
|
<
<
>
|
<
>








|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225


226
227

228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244

.if empty(NFSCLIENT_ENABLE:tl:Mno)
DAEMON_rpcbind_ENABLE=yes
.endif

nfsclient: NETWORK rpcbind rpc_umntall
	test -z "$${NFSCLIENT_ENABLE}" || kldload -n nfs

netif: adjkerntz wlans cloned kld
	echo "MRC:$@> Starting interfaces: ${IFCONFIG_IFACES}"
.for iface in ${IFCONFIG_IFACES}
.for item in ${IFCONFIG_${iface}:tW:ts;}
	ifconfig ${iface} ${item}
.endfor
.undef _IFCONFIG_ARGS
.endfor

pf: pflogd
.if empty(PF_ENABLE:tl:Mno)
	echo "MRC:$@> Enabling and loading rules." ;\
	kldload -n pf || exit 1 ;\
	test -r ${PF_RULES} || {\
	  echo "MRC:$@> Can't find file with rules at ${PF_RULES}." ;\
	  exit 1 ;\
	} ;\
	pfctl -Fa || exit 1 ;\
	pfctl -f ${PF_RULES} ${PF_FLAGS} || exit 1 ;\
	pfctl -Si | grep -q Enabled && pfctl -e
.endif

pwcheck: mountlate syslogd
	echo "MRC:$@> Checking password lock file."
.if exists(/etc/ptmp)
	logger -s -p auth.err "password file may be incorrect -- /etc/ptmp \
	  exists"
.endif

random: mount devfs
	echo "MRC:$@> Seeding." ;\
	sysctl kern.seedenable=1 > /dev/null ;\
	( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) 2>&1 | \
	  dd status=none of=/dev/random bs=8k ;\
	dd if=/bin/ps status=none of=/dev/random bs=8k ;\
	test -d $${ENTROPY_DIR} && {\
	  find $${ENTROPY_DIR} -type f |\
	  xargs -n1 -Ifoo dd status=none if=foo of=/dev/random bs=8k ;\


	} || {\
	  dd status=none if=${ENTROPY_FILE} of=/dev/random bs=8k ;\

	} ;\
	sysctl kern.seedenable=0 > /dev/null

root: fsck bootfs
	echo "MRC:$@> Mount root R/W."
	mount -uo rw /
	umount -a

rpc_umntall: mountlate NETWORK rpcbind
.if empty(RPC_UMNTALL_ENABLE:tl:Mno)
	echo "MRC:$@> Sending RPC unmount notifications."; \
	test -f /var/db/mounttab || true && \
	  rpc.umntall -k &
.endif

runshm: cleanvar
	echo "MRC:$@> Mount and populate /var/run/shm."; \