Check-in [7a1e7f4a58]
Logged in as anonymous
Overview
Comment:rename, make silent, add correct logging, collapse command
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7a1e7f4a58d862880ac7dd2d4f1ec9cbabd32a02d4c9e7a9e2389a39a30b9e99
User & Date: arcade on 2019-10-21 16:17:43.291
Other Links: manifest | tags
Context
2019-10-21
18:57
add some targets, add fsck fallbacks check-in: 5621f7a556 user: arcade tags: trunk
16:17
rename, make silent, add correct logging, collapse command check-in: 7a1e7f4a58 user: arcade tags: trunk
15:38
fix automountd, fix daemon, change daemonizers description check-in: be4f89a54b user: arcade tags: trunk
Changes
1
2
3
# vim:ft=make:

DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig nfsclient
<
<



1


DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig nfsclient
1
2
3
# vim:ft=make:

LOGIN: DAEMON dntpd
<
<



1


LOGIN: DAEMON dntpd
Modified Makefile from [aa2a86c99e] to [71a8a084f3].
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
.endfor

.if !target(_service) || !target(_earlyservice)
.error No service handler defined.
.endif

#.MAKE.JOBS?=2
#.SILENT:

.if defined(AUTOBOOT)
SCRIPTS=${:!find /etc/mrc -name '*.init' -o -name '*.service'!:S/\/etc\/mrc\///}

.ERROR:
	: ERROR: ABORTING BOOT (sending SIGTERM to parent)!
	: target ${.ERROR_TARGET} failed to execute:
	: ${.ERROR_CMD}
	kill 1
.else
SCRIPTS=${:!find /etc/mrc -name '*.service'!:S/\/etc\/mrc\///}

DAEMON: NETWORK SERVERS

LOGIN: DAEMON

NETWORK:

SERVERS:

SERVICE:
.endif

test:
	echo Empty target.

TARGETS:=${SCRIPTS:S/.init//:S/.service//}

.MAIN: ${TARGETS}

.PHONY: ${TARGETS} ${OTHER_TARGETS}

.undef TARGETS OTHER_TARGETS








|


|







|















|







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
.endfor

.if !target(_service) || !target(_earlyservice)
.error No service handler defined.
.endif

#.MAKE.JOBS?=2
.SILENT:

.if defined(AUTOBOOT)
SCRIPTS=${:!find /etc/mrc -name '*.init.mk' -o -name '*.service.mk'!:S/\/etc\/mrc\///}

.ERROR:
	: ERROR: ABORTING BOOT (sending SIGTERM to parent)!
	: target ${.ERROR_TARGET} failed to execute:
	: ${.ERROR_CMD}
	kill 1
.else
SCRIPTS=${:!find /etc/mrc -name '*.service.mk'!:S/\/etc\/mrc\///}

DAEMON: NETWORK SERVERS

LOGIN: DAEMON

NETWORK:

SERVERS:

SERVICE:
.endif

test:
	echo Empty target.

TARGETS:=${SCRIPTS:S/.init.mk//:S/.service.mk//}

.MAIN: ${TARGETS}

.PHONY: ${TARGETS} ${OTHER_TARGETS}

.undef TARGETS OTHER_TARGETS

1
2
3
# vim:ft=make:

NETWORK: ifconfig devd hostname
<
<



1


NETWORK: ifconfig devd hostname
1
2
3
# vim:ft=make:

SERVERS: swap mountlate syslogd
<
<



1


SERVERS: swap mountlate syslogd
Name change from SERVICE.init to SERVICE.init.mk.
1
2
3
4
5
# vim:ft=make:

adjkerntz: random mount
	: Adjust kernel timezone.
	adjkerntz -i
<
<

|



1
2
3


adjkerntz: random mount
	echo "MRC:$@> Adjust kernel timezone."
	adjkerntz -i
1
2
3
4
5
6
7
8
# vim:ft=make:

DAEMON_automountd_COMMAND?=/usr/sbin/automountd
DAEMON_automountd_ENABLE?=no
DAEMON_automountd_MODULES=autofs

automountd: _service # nfsclient -> DAEMON
	test -z "$${DAEMON_$@_ENABLE}" || /usr/sbin/automount
<
<








1
2
3
4
5
6


DAEMON_automountd_COMMAND?=/usr/sbin/automountd
DAEMON_automountd_ENABLE?=no
DAEMON_automountd_MODULES=autofs

automountd: _service # nfsclient -> DAEMON
	test -z "$${DAEMON_$@_ENABLE}" || /usr/sbin/automount
1
2
3
4
5
# vim:ft=make:

bootfs: fsck
	: Checking whether we need /boot mounted.
	mount -vadr | grep -q ' /boot$$' && mount -r /boot || true
<
<

|



1
2
3


bootfs: fsck
	echo "MRC:$@> Checking whether we need /boot mounted."
	mount -vadr | grep -q ' /boot$$' && mount -r /boot || true
1
2
3
4
5

6
7
8
9
# vim:ft=make:

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

cleanvar: mount

.for dir in ${CLEANVAR_DIRS}
	-test -d ${dir} && find ${dir} -mindepth 1 -delete
.endfor
	install -m644 /dev/null /var/run/utmpx
<
<



>






1
2
3
4
5
6
7
8


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

cleanvar: mount
	echo "MRC:$@> Cleaning 'var's."
.for dir in ${CLEANVAR_DIRS}
	-test -d ${dir} && find ${dir} -mindepth 1 -delete
.endfor
	install -m644 /dev/null /var/run/utmpx
1
2
3

4
5
6
# vim:ft=make:

cloned: kld

.for iface in ${CLONED_INTERFACES}
	ifconfig ${iface} create
.endfor
<
<

>





1
2
3
4
5


cloned: kld
	echo "MRC:$@> Cloning interfaces: ${CLONED_INTERFACES}"
.for iface in ${CLONED_INTERFACES}
	ifconfig ${iface} create
.endfor
1
2
3
4
5
6
# vim:ft=make:

DAEMON_cron_COMMAND?=/usr/sbin/cron
DAEMON_cron_FLAGS?=-s

cron: _service LOGIN
<
<






1
2
3
4


DAEMON_cron_COMMAND?=/usr/sbin/cron
DAEMON_cron_FLAGS?=-s

cron: _service LOGIN
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
LOCAL_TARGETS:=_service_daemon _earlyservice_daemon
OTHER_TARGETS+=${LOCAL_TARGETS}
.if ${STARTER} == "daemon"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice.*/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \

	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  daemon -c -u ${DAEMON_$@_USER:Uroot} -r -P /var/run/daemon.$@.pid ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \
	}
.endfor

.undef LOCAL_TARGETS









>






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LOCAL_TARGETS:=_service_daemon _earlyservice_daemon
OTHER_TARGETS+=${LOCAL_TARGETS}
.if ${STARTER} == "daemon"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice.*/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  echo "MRC:$@> Starting service."; \
	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  daemon -c -u ${DAEMON_$@_USER:Uroot} -r -P /var/run/daemon.$@.pid ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \
	}
.endfor

.undef LOCAL_TARGETS
1
2
3
4
5
6
7
8
9
10
11
12
# vim:ft=make:

DAEMON_dbus_COMMAND?=/usr/local/bin/dbus-daemon
DAEMON_dbus_ENABLE?=no
DAEMON_dbus_FLAGS?=--system

dbus: _service
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  /usr/local/bin/dbus-uuidgen --ensure; \
	  mkdir -p /var/run/dbus; \
	}
<
<





<






1
2
3
4
5

6
7
8
9


DAEMON_dbus_COMMAND?=/usr/local/bin/dbus-daemon
DAEMON_dbus_ENABLE?=no
DAEMON_dbus_FLAGS?=--system

dbus: _service

	test -z "$${DAEMON_$@_ENABLE}" || { \
	  /usr/local/bin/dbus-uuidgen --ensure; \
	  mkdir -p /var/run/dbus; \
	}
1
2
3
4
5
6
7
8
# vim:ft=make:

DAEMON_devd_COMMAND?=/sbin/devd
DAEMON_devd_ENABLE?=yes
DAEMON_devd_FLAGS?=-dq

devd: _earlyservice
	test -n "$${DAEMON_$@_ENABLE}" || sysctl hw.bus.devctl_disable=1
<
<








1
2
3
4
5
6


DAEMON_devd_COMMAND?=/sbin/devd
DAEMON_devd_ENABLE?=yes
DAEMON_devd_FLAGS?=-dq

devd: _earlyservice
	test -n "$${DAEMON_$@_ENABLE}" || sysctl hw.bus.devctl_disable=1
1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

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

devfs:
	: Applying devfs rules.
.for file in ${DEVFS_CONFIG_FILES}
.if exists(${file})
	devfsctl -a -f ${file}
.endif
.endfor
<
<



|







1
2
3
4
5
6
7
8
9


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

devfs:
	echo "MRC:$@> Applying rules: ${DEVFS_CONFIG_FILES}"
.for file in ${DEVFS_CONFIG_FILES}
.if exists(${file})
	devfsctl -a -f ${file}
.endif
.endfor
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_dhcpcd_COMMAND?=/sbin/dhcpcd
DAEMON_dhcpcd_ENABLE?=no
DAEMON_dhcpcd_FLAGS?=-B

dhcpcd: _service NETWORK SERVICE # mount -> SERVICE, cleanvar -> SERVICE
<
<







1
2
3
4
5


DAEMON_dhcpcd_COMMAND?=/sbin/dhcpcd
DAEMON_dhcpcd_ENABLE?=no
DAEMON_dhcpcd_FLAGS?=-B

dhcpcd: _service NETWORK SERVICE # mount -> SERVICE, cleanvar -> SERVICE
1
2
3
4
5
6
7
# vim:ft=make:

DMESG_FILE?=/var/run/dmesg.boot

dmesg: mountlate
	: Writing dmesg.
	umask 022 ; dmesg -a >> ${DMESG_FILE}
<
<



|



1
2
3
4
5


DMESG_FILE?=/var/run/dmesg.boot

dmesg: mountlate
	echo "MRC:$@> Writing dmesg."
	umask 022 ; dmesg -a >> ${DMESG_FILE}
1
2
3
4
5
6
# vim:ft=make:

DAEMON_dntpd_COMMAND?=/usr/sbin/dntpd
DAEMON_dntpd_FLAGS?=-F

dntpd: _service NETWORK
<
<






1
2
3
4


DAEMON_dntpd_COMMAND?=/usr/sbin/dntpd
DAEMON_dntpd_FLAGS?=-F

dntpd: _service NETWORK
1
2
3
4
5

6
7

# vim:ft=make:

DUMPDEV?=no

dumpon: random

	: Setting dumpon device.
	test -e ${DUMPDEV} && dumpon -v ${DUMPDEV} || true

<
<



>
|
|
>


1
2
3
4
5
6
7


DUMPDEV?=no

dumpon: random
	test -e ${DUMPDEV} && { \
	  echo "MRC:$@> Setting dumpon device to ${DUMPDEV}"; \
	  dumpon -v ${DUMPDEV}; \
	} || true
Renamed and modified fsck.init [1755acd658] to fsck.init.mk [cc68b20a5b].
1
2
3
4
5
# vim:ft=make:

fsck:
	: Checking disks
	fsck -p
<
<

|



1
2
3


fsck:
	echo "MRC:$@> Checking disks."
	fsck -p
1
2
3
4
5
6
7
# vim:ft=make:

HOSTNAME?=Amnesiac

hostname:
	: Setting hostname.
	hostname ${HOSTNAME}
<
<



|



1
2
3
4
5


HOSTNAME?=Amnesiac

hostname:
	echo "MRC:$@> Setting to ${HOSTNAME}."
	hostname ${HOSTNAME}
1
2
3
4
5
6
7
8
9
10
# vim:ft=make:

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

ifconfig: adjkerntz wlans cloned kld
	: Starting interfaces.
.for iface in ${IFCONFIG_IFACES}
	ifconfig ${iface} ${IFCONFIG_${iface}}
.endfor
<
<




|





1
2
3
4
5
6
7
8


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

ifconfig: adjkerntz wlans cloned kld
	echo "MRC:$@> Starting interfaces: ${IFCONFIG_IFACES}"
.for iface in ${IFCONFIG_IFACES}
	ifconfig ${iface} ${IFCONFIG_${iface}}
.endfor
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_inetd_COMMAND?=/usr/sbin/inetd
DAEMON_inetd_enable?=no
DAEMON_inetd_FLAGS?=-C 60

inetd: _service LOGIN
<
<







1
2
3
4
5


DAEMON_inetd_COMMAND?=/usr/sbin/inetd
DAEMON_inetd_enable?=no
DAEMON_inetd_FLAGS?=-C 60

inetd: _service LOGIN
Renamed and modified kld.init [ed8e95636b] to kld.init.mk [4db3c3f5d6].
1
2
3
4

5
6
# vim:ft=make:

kld: bootfs
.if defined(KLD_LIST)

	kldload -n ${KLD_LIST}
.endif
<
<


>




1
2
3
4
5


kld: bootfs
.if defined(KLD_LIST)
	echo "MRC:$@> Loading kernel modules: ${KLD_LIST}"
	kldload -n ${KLD_LIST}
.endif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# vim:ft=make:

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

.for ldc in ${LDCONFIG_PATHS} /etc/ld-elf.so.conf
.if exists(${ldc})
ldc+=${ldc}
.endif
.endfor

.for dir in ${LDCONFIG_LOCAL_DIRS}
.if exists(${dir})
ldc+=${:!find ${dir} -type f!}
.endif
.endfor

ldconfig: mountlate
	: Initializing ldconfig.
	ldconfig -elf ${ldc}
<
<



|
|
|










|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18


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

.for path in ${LDCONFIG_PATHS} /etc/ld-elf.so.conf
.if exists(${path})
ldc+=${path}
.endif
.endfor

.for dir in ${LDCONFIG_LOCAL_DIRS}
.if exists(${dir})
ldc+=${:!find ${dir} -type f!}
.endif
.endfor

ldconfig: mountlate
	echo "MRC:$@> Initializing shared libraries: ${ldc}"; \
	ldconfig -elf ${ldc}
1
2
3
4
5
6
7
8
9
# vim:ft=make:

mixers=${:!find /dev -name 'mixer*'!:S/\/dev\///}

mixer: mount cleanvar
	: Restoring mixer levels.
.for mixer in ${mixers}
	-test -f /var/db/${mixer}-state && mixer -f /dev/${mixer} `cat /var/db/${mixer}-state`
.endfor
<
<



|





1
2
3
4
5
6
7


mixers=${:!find /dev -name 'mixer*'!:S/\/dev\///}

mixer: mount cleanvar
	echo "MRC:$@> Restoring levels."
.for mixer in ${mixers}
	-test -f /var/db/${mixer}-state && mixer -f /dev/${mixer} `cat /var/db/${mixer}-state`
.endfor
1
2
3
4
5
6
7
8
9
# vim:ft=make:

NETFS_TYPES?=nfs:NFS smbfs:SMB

excludes=${NETFS_TYPES:C/:.*//}

mount: root
	: Mount local FS.
	mount -a -t no${excludes:ts,}
<
<





|



1
2
3
4
5
6
7


NETFS_TYPES?=nfs:NFS smbfs:SMB

excludes=${NETFS_TYPES:C/:.*//}

mount: root
	echo "MRC:$@> Mount local FS."
	mount -a -t no${excludes:ts,}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# vim:ft=make:

DAEMON_mountd_COMMAND?=/sbin/mountd
DAEMON_mountd_ENABLE?=no
DAEMON_mountd_FLAGS?=-r

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

mountd: rpcbind NETWORK SERVERS _service # mountlate -> SERVERS
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  rm -f /var/db/mountdtab; \
	  ( umask 022 ; touch /var/db/mountdtab ); \
	}
<
<









<






1
2
3
4
5
6
7
8
9

10
11
12
13


DAEMON_mountd_COMMAND?=/sbin/mountd
DAEMON_mountd_ENABLE?=no
DAEMON_mountd_FLAGS?=-r

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

mountd: rpcbind NETWORK SERVERS _service # mountlate -> SERVERS

	test -z "$${DAEMON_$@_ENABLE}" || { \
	  rm -f /var/db/mountdtab; \
	  ( umask 022 ; touch /var/db/mountdtab ); \
	}
1
2
3
4
5
# vim:ft=make:

mountlate: NETWORK mount cleanvar runshm devd
	: Mount late FS.
	mount -a
<
<

|



1
2
3


mountlate: NETWORK mount cleanvar runshm devd
	echo "MRC:$@> Mount late FS."
	mount -a
1
2
3
4
5
6
7
# vim:ft=make:

nextboot: mount
.if exists(/boot/nextkernel)
	: Removing nextboot setting.
	rm -f /boot/nextkernel
.endif
<
<


|




1
2
3
4
5


nextboot: mount
.if exists(/boot/nextkernel)
	echo "MRC:$@> Removing nextboot setting."
	rm -f /boot/nextkernel
.endif
1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

NFSCLIENT_ENABLE?=no

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

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







<



1
2
3
4
5
6
7

8


NFSCLIENT_ENABLE?=no

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

nfsclient: NETWORK rpcbind rpc_umntall

	test -z "$${NFSCLIENT_ENABLE}" || kldload -n nfs
1
2
3
4
5
6
7
8
9
# vim:ft=make:

DAEMON_nfsd_COMMAND?=/sbin/nfsd
DAEMON_nfsd_ENABLE?=no
DAEMON_nfsd_FLAGS?=-u -t -n 4

.if empty(DAEMON_nfsd_ENABLE:tl:Mno)
DAEMON_rpcbind_ENABLE=yes
DAEMON_mountd_ENABLE=yes
<
<









1
2
3
4
5
6
7


DAEMON_nfsd_COMMAND?=/sbin/nfsd
DAEMON_nfsd_ENABLE?=no
DAEMON_nfsd_FLAGS?=-u -t -n 4

.if empty(DAEMON_nfsd_ENABLE:tl:Mno)
DAEMON_rpcbind_ENABLE=yes
DAEMON_mountd_ENABLE=yes
1
2
3
4
5
6
7
8
9
10
11
12
13
# vim:ft=make:

DAEMON_node_exporter_COMMAND?=/usr/local/bin/node_exporter --web.listen-address=${DAEMON_node_exporter_LISTEN_ADDRESS} --collector.textfile.directory=${DAEMON_node_exporter_TEXTFILE_DIR}
DAEMON_node_exporter_ENABLE?=no
DAEMON_node_exporter_LISTEN_ADDRESS?=:9100
DAEMON_node_exporter_TEXTFILE_DIR?=/var/tmp/node_exporter
DAEMON_node_exporter_USER?=nobody
DAEMON_node_exporter_GROUP?=nobody

node_exporter: _service
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || \
	install -d -o ${DAEMON_node_exporter_USER} -g ${DAEMON_node_exporter_GROUP} -m1755 ${DAEMON_node_exporter_TEXTFILE_DIR}
<
<








<




1
2
3
4
5
6
7
8

9
10


DAEMON_node_exporter_COMMAND?=/usr/local/bin/node_exporter --web.listen-address=${DAEMON_node_exporter_LISTEN_ADDRESS} --collector.textfile.directory=${DAEMON_node_exporter_TEXTFILE_DIR}
DAEMON_node_exporter_ENABLE?=no
DAEMON_node_exporter_LISTEN_ADDRESS?=:9100
DAEMON_node_exporter_TEXTFILE_DIR?=/var/tmp/node_exporter
DAEMON_node_exporter_USER?=nobody
DAEMON_node_exporter_GROUP?=nobody

node_exporter: _service

	test -z "$${DAEMON_$@_ENABLE}" || \
	install -d -o ${DAEMON_node_exporter_USER} -g ${DAEMON_node_exporter_GROUP} -m1755 ${DAEMON_node_exporter_TEXTFILE_DIR}
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
LOCAL_TARGETS:=_service_plain _earlyservice_plain
OTHER_TARGETS+=${LOCAL_TARGETS}
.if ${STARTER} == "plain"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice.*/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \

	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  chroot -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} / ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \
	}
.endfor

.undef LOCAL_TARGETS









>






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LOCAL_TARGETS:=_service_plain _earlyservice_plain
OTHER_TARGETS+=${LOCAL_TARGETS}
.if ${STARTER} == "plain"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice.*/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  echo "MRC:$@> Starting service."; \
	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  chroot -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} / ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \
	}
.endfor

.undef LOCAL_TARGETS
1
2
3
4
5
6
7
# vim:ft=make:

pwcheck: mountlate syslogd
	: Checking password lock file.
.if exists(/etc/ptmp)
	logger -s -p auth.err "password file may be incorrect -- /etc/ptmp exists"
.endif
<
<

|





1
2
3
4
5


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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# vim:ft=make:

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

random: mount devfs
	: Seeding random.
	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)
.for file in ${:!find ${ENTROPY_DIR} -type f!}
	dd status=none if=${file} of=/dev/random bs=8k
.endfor
<
<




|









1
2
3
4
5
6
7
8
9
10
11
12


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

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)
.for file in ${:!find ${ENTROPY_DIR} -type f!}
	dd status=none if=${file} of=/dev/random bs=8k
.endfor
Renamed and modified root.init [398ba3c8e7] to root.init.mk [daf2788083].
1
2
3
4
5
6
# vim:ft=make:

root: fsck bootfs
	: Mount root R/W.
	mount -uo rw /
	umount -a
<
<

|




1
2
3
4


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

5
6
7
# vim:ft=make:

rpc_umntall: mountlate NETWORK rpcbind
.if empty(RPC_UMNTALL_ENABLE:tl:Mno)

	test -f /var/db/mounttab || true && \
	  rpc.umntall -k &
.endif
<
<


>





1
2
3
4
5
6


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
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_rpcbind_COMMAND?=/usr/sbin/rpcbind
DAEMON_rpcbind_ENABLE?=no
DAEMON_rpcbind_FLAGS?=-d

rpcbind: _earlyservice NETWORK syslogd
<
<







1
2
3
4
5


DAEMON_rpcbind_COMMAND?=/usr/sbin/rpcbind
DAEMON_rpcbind_ENABLE?=no
DAEMON_rpcbind_FLAGS?=-d

rpcbind: _earlyservice NETWORK syslogd
1
2
3
4
5
6
7
# vim:ft=make:

runshm: cleanvar
	: Mount and populate /var/run/shm.
	mkdir -p /var/run/shm
	mount_tmpfs -m 01777 dummy /var/run/shm
	mkdir -p -m 01777 /var/run/shm/tmp
<
<

|
|
|
|


1
2
3
4
5


runshm: cleanvar
	echo "MRC:$@> Mount and populate /var/run/shm."; \
	mkdir -p /var/run/shm; \
	mount_tmpfs -m 01777 dummy /var/run/shm; \
	mkdir -p -m 01777 /var/run/shm/tmp; \
1
2
3
4
5
6
7
8
9
10
11
12
13
# vim:ft=make:

DUMPDIR?=/var/crash
CRASHINFO_ENABLE?=no

savecore: dumpon
.if empty(DUMPDEV:tl:Mno) && exists(${DUMPDEV}) && exists(${DUMPDIR})
	: Saving coredump.
	savecore ${DUMPDIR} ${DUMPDEV}
.if empty(CRASHINFO_ENABLE:tl:Mno)
	crashinfo -d ${DUMPDIR}
.endif
.endif
<
<





|







1
2
3
4
5
6
7
8
9
10
11


DUMPDIR?=/var/crash
CRASHINFO_ENABLE?=no

savecore: dumpon
.if empty(DUMPDEV:tl:Mno) && exists(${DUMPDEV}) && exists(${DUMPDIR})
	echo "MRC:$@> Saving coredump."; \
	savecore ${DUMPDIR} ${DUMPDEV}
.if empty(CRASHINFO_ENABLE:tl:Mno)
	crashinfo -d ${DUMPDIR}
.endif
.endif
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_slim_COMMAND?=/usr/local/bin/slim
DAEMON_slim_ENABLE?=no

slim: _service dbus
	rm -f /var/run/slim.auth
<
<







1
2
3
4
5


DAEMON_slim_COMMAND?=/usr/local/bin/slim
DAEMON_slim_ENABLE?=no

slim: _service dbus
	rm -f /var/run/slim.auth
1
2
3
4
5
6
7
8
9
10
11
12
13
# vim:ft=make:

DAEMON_smartd_COMMAND?=/usr/local/sbin/smartd
DAEMON_smartd_ENABLE?=no
DAEMON_smartd_FLAGS?=-c /usr/local/etc/smartd.conf -n

smartd: _service
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || \
	test -f /usr/local/etc/smartd.conf || { \
	  echo smartd requires config file to start. ; \
	  false; \
	}
<
<





<


|




1
2
3
4
5

6
7
8
9
10


DAEMON_smartd_COMMAND?=/usr/local/sbin/smartd
DAEMON_smartd_ENABLE?=no
DAEMON_smartd_FLAGS?=-c /usr/local/etc/smartd.conf -n

smartd: _service

	test -z "$${DAEMON_$@_ENABLE}" || \
	test -f /usr/local/etc/smartd.conf || { \
	  echo "MRC:$@> smartd requires config file to start." ; \
	  false; \
	}
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_sndiod_COMMAND?=/usr/local/bin/sndiod
DAEMON_sndiod_ENABLE?=no
DAEMON_sndiod_FLAGS?=-c 0:7 -j off -s default -m mon -s monitor -d

sndiod: _service
<
<







1
2
3
4
5


DAEMON_sndiod_COMMAND?=/usr/local/bin/sndiod
DAEMON_sndiod_ENABLE?=no
DAEMON_sndiod_FLAGS?=-c 0:7 -j off -s default -m mon -s monitor -d

sndiod: _service
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
LOCAL_TARGETS:=_service_svc _earlyservice_svc
OTHER_TARGETS+=_service_svc _earlyservice_svc
.if ${STARTER} == "svc"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \

	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \
	}
.endfor

.undef LOCAL_TARGETS









>






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LOCAL_TARGETS:=_service_svc _earlyservice_svc
OTHER_TARGETS+=_service_svc _earlyservice_svc
.if ${STARTER} == "svc"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice/SERVICE/} .USE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  echo "MRC:$@> Starting service."; \
	  test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \
	  svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \
	}
.endfor

.undef LOCAL_TARGETS
Renamed and modified swap.init [1f6b4316a8] to swap.init.mk [c2487b0c65].
1
2
3
4
5
6
7
# vim:ft=make:

swap: savecore
.if ${:!sysctl -n vm.swap_enabled!}} != 0
	: Enabling swap.
	swapon -a
.endif
<
<


|




1
2
3
4
5


swap: savecore
.if ${:!sysctl -n vm.swap_enabled!}} != 0
	echo "MRC:$@> Enabling swap."; \
	swapon -a
.endif
1
2
3
4
5
6
7
# vim:ft=make:

sysctl: kld root
.if exists(/etc/sysctl.conf)
	: Setting sysctl defaults.
	awk '$$0~/^[ ]*(#.*)?$$/{next}{print}' < /etc/sysctl.conf | xargs -n1 sysctl
.endif
<
<


|




1
2
3
4
5


sysctl: kld root
.if exists(/etc/sysctl.conf)
	echo "MRC:$@> Setting sysctl defaults."; \
	awk '$$0~/^[ ]*(#.*)?$$/{next}{print}' < /etc/sysctl.conf | xargs -n1 sysctl
.endif
1
2
3
4
5
6
# vim:ft=make:

sysdb: mountlate
	: Building databases.
	dev_mkdb
	install -c -m 644 -g wheel /dev/null /var/run/utmpx
<
<

|
|



1
2
3
4


sysdb: mountlate
	echo "MRC:$@> Building databases."; \
	dev_mkdb; \
	install -c -m 644 -g wheel /dev/null /var/run/utmpx
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_syslogd_COMMAND?=/usr/sbin/syslogd
DAEMON_syslogd_ENABLE?=yes
DAEMON_syslogd_FLAGS?=-ss8cc

syslogd: _earlyservice
<
<







1
2
3
4
5


DAEMON_syslogd_COMMAND?=/usr/sbin/syslogd
DAEMON_syslogd_ENABLE?=yes
DAEMON_syslogd_FLAGS?=-ss8cc

syslogd: _earlyservice
1
2
3
4
5
6
7
8
9
# vim:ft=make:

DAEMON_watchdogd_COMMAND?=/usr/sbin/watchdogd
DAEMON_watchdogd_ENABLE?=no
DAEMON_watchdogd_FLAGS?=-d

.if empty(:!sysctl -qn debug.watchdog || exit 0!)
DAEMON_watchdogd_ENABLE=no
.endif
<
<









1
2
3
4
5
6
7


DAEMON_watchdogd_COMMAND?=/usr/sbin/watchdogd
DAEMON_watchdogd_ENABLE?=no
DAEMON_watchdogd_FLAGS?=-d

.if empty(:!sysctl -qn debug.watchdog || exit 0!)
DAEMON_watchdogd_ENABLE=no
.endif
1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

wlans: kld
	: Configuring wlans.
	for dev in `sysctl -n net.wlan.devices`; do \
	  eval all_wlans=\$${WLANS_$${dev}}; \
	  for wlan in $${all_wlans}; do \
	    eval wlan_args=\$${WLANS_$${wlan}_ARGS}; \
	    ifconfig $${wlan} create wlandev $${dev} $${wlan_args}; \
	    ifconfig $${wlan} up; \
	  done; \
<
<

|









1
2
3
4
5
6
7
8
9


wlans: kld
	echo "MRC:$@> Configuring wlans."; \
	for dev in `sysctl -n net.wlan.devices`; do \
	  eval all_wlans=\$${WLANS_$${dev}}; \
	  for wlan in $${all_wlans}; do \
	    eval wlan_args=\$${WLANS_$${wlan}_ARGS}; \
	    ifconfig $${wlan} create wlandev $${dev} $${wlan_args}; \
	    ifconfig $${wlan} up; \
	  done; \