Overview
Comment: | join all init scripts to speed up initialization |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
295630c60d296e97046659d7b361c585 |
User & Date: | arcade on 2019-10-23 07:54:59.931 |
Other Links: | manifest | tags |
Context
2019-10-23
| ||
08:44 | fix multiline check-in: 5f60bcc749 user: arcade tags: trunk | |
07:54 | join all init scripts to speed up initialization check-in: 295630c60d user: arcade tags: trunk | |
07:40 | make interface configuration multiline check-in: c9cd53b0f6 user: arcade tags: trunk | |
Changes
Deleted DAEMON.init.mk version [b3b679f99c].
Deleted LOGIN.init.mk version [a0e3b6abd2].
Modified Makefile
from [c62468910e]
to [ce3ea9c598].
︙ | ︙ | |||
14 15 16 17 18 19 20 | #.MAKE.JOBS?=2 .SILENT: install: install rc /etc/rc | < | > < < < < < < < < > | > > > > > | 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 | #.MAKE.JOBS?=2 .SILENT: install: install rc /etc/rc SCRIPTS=${:!find /etc/mrc -name '*.service.mk'!:S/\/etc\/mrc\///} .if defined(AUTOBOOT) .ERROR: : ERROR: ABORTING BOOT (sending SIGTERM to parent)! : target ${.ERROR_TARGET} failed to execute: : ${.ERROR_CMD} kill 1 .else DAEMON: NETWORK SERVERS LOGIN: DAEMON NETWORK: SERVERS: SERVICE: .endif test: echo Empty target. TARGETS:=${SCRIPTS:S/.init.mk//:S/.service.mk//} .for file in ${SCRIPTS} #.info ${file} .include "${file}" .endfor .include "init.mk" .MAIN: ${TARGETS} .PHONY: ${TARGETS} ${OTHER_TARGETS} .undef TARGETS OTHER_TARGETS SCRIPTS ENABLED=${:!env!:C/=.*//:M*_ENABLE} .for var in ${ENABLED} .if !empty(${var}:tl:Mno) #.info ${var} .undef ${var} |
︙ | ︙ |
Deleted NETWORK.init.mk version [491e93b769].
Deleted SERVERS.init.mk version [d589f6dc14].
Deleted SERVICE.init.mk version [9af2593c09].
Deleted adjkerntz.init.mk version [e804eafdd9].
Deleted bootfs.init.mk version [d887eb8b56].
Deleted cleanvar.init.mk version [924d7d284c].
Deleted cleartmp.init.mk version [9e4a8199b1].
Deleted cloned.init.mk version [4278e3af4f].
Deleted devfs.init.mk version [6873f9fe09].
Deleted dmesg.init.mk version [9b6658ca02].
Deleted dumpon.init.mk version [c2234e19da].
Deleted hostname.init.mk version [e13e61205f].
Deleted ifconfig.init.mk version [b36f3be61c].
Renamed and modified
fsck.init.mk
[15c9110dc2]
to init.mk
[7320857c63].
1 2 3 4 5 6 7 | fsck: echo "MRC:$@> Checking disks." ;\ fsck -p ;\ case $$? in \ 0) ;; \ 2) exit 1 \ ;; \ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | # Meta targets TARGETS+=adjkerntz bootfs cleanvar cleartmp cloned devfs dmesg dumpon fsck hostname ifconfig kld ldconfig 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 bootfs: fsck echo "MRC:$@> Checking whether we need /boot mounted." mount -vadr | grep -q ' /boot$$' && mount -r /boot || true 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 cleartmp: mountlate echo "MRC:$@> Clearing tmp."; \ find -x /tmp -mindepth 1 ! -name lost+found \ ! -name snapshots ! -path "./snapshots/*" \ ! -name quota.user ! -name quota.group \ -delete -type d -prune ;\ rm -f /tmp/.X*-lock ;\ rm -fr /tmp/.X11-unix ;\ mkdir -m 1777 /tmp/.X11-unix cloned: kld echo "MRC:$@> Cloning interfaces: ${CLONED_INTERFACES}" .for iface in ${CLONED_INTERFACES} ifconfig ${iface} create .endfor 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 DMESG_FILE?=/var/run/dmesg.boot dmesg: mountlate echo "MRC:$@> Writing dmesg." umask 022 ; dmesg -a >> ${DMESG_FILE} DUMPDEV?=no dumpon: random test -e ${DUMPDEV} && { \ echo "MRC:$@> Setting dumpon device to ${DUMPDEV}"; \ dumpon -v ${DUMPDEV}; \ } || true fsck: echo "MRC:$@> Checking disks." ;\ fsck -p ;\ case $$? in \ 0) ;; \ 2) exit 1 \ ;; \ |
︙ | ︙ | |||
26 27 28 29 30 31 32 | ;; \ 130) exit 1 \ ;; \ *) echo "Unknown error, help!" ;\ exit 1 \ ;; \ esac | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 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 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | ;; \ 130) exit 1 \ ;; \ *) echo "Unknown error, help!" ;\ exit 1 \ ;; \ esac HOSTNAME?=Amnesiac hostname: echo "MRC:$@> Setting to ${HOSTNAME}." hostname ${HOSTNAME} 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} .for item in ${IFCONFIG_${iface}} ifconfig ${iface} ${item} .endfor .endfor kld: bootfs .if defined(KLD_LIST) echo "MRC:$@> Loading kernel modules: ${KLD_LIST}" kldload -n ${KLD_LIST} .endif 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} 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 NETFS_TYPES?=nfs:NFS smbfs:SMB excludes=${NETFS_TYPES:C/:.*//} mount: root echo "MRC:$@> Mount local FS." mount -a -t no${excludes:ts,} mountlate: NETWORK mount cleanvar runshm devd echo "MRC:$@> Mount late FS." mount -a msgs: mount echo "MRC:$@> Making bounds." ;\ test ! -d /var/msgs -o -f /var/msgs/bound -o -L /var/msgs/bounds || \ echo 0 > /var/msgs/bounds NEWSYSLOG_ENABLE?=no newsyslog: mountlate sysdb test -z "$${NEWSYSLOG_ENABLE}" || \ echo "MRC:$@> Trimming log files." ;\ /usr/sbin/newsyslog ${NEWSYSLOG_FLAGS} nextboot: mount .if exists(/boot/nextkernel) echo "MRC:$@> Removing nextboot setting." rm -f /boot/nextkernel .endif 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 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 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 .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) 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."; \ mkdir -p /var/run/shm; \ mount_tmpfs -m 01777 dummy /var/run/shm; \ mkdir -p -m 01777 /var/run/shm/tmp; \ 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 swap: savecore .if ${:!sysctl -n vm.swap_enabled!}} != 0 echo "MRC:$@> Enabling swap."; \ swapon -a .endif sysctl: kld root .if exists(/etc/sysctl.conf) echo "MRC:$@> Setting sysctl defaults."; \ awk '$$0~/^[ ]*(#.*)?$$/{next}{print}' < /etc/sysctl.conf | xargs -n1 sysctl .endif sysdb: mountlate echo "MRC:$@> Building databases."; \ dev_mkdb; \ install -c -m 644 -g wheel /dev/null /var/run/utmpx 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; \ done |
Deleted kld.init.mk version [4db3c3f5d6].
Deleted ldconfig.init.mk version [82b48d4f36].
Deleted mixer.init.mk version [b996d1d21a].
Deleted mount.init.mk version [12f98edc5e].
Deleted mountlate.init.mk version [9d4d422199].
Deleted msgs.init.mk version [63a12d3263].
Deleted newsyslog.init.mk version [7e859bb781].
Deleted nextboot.init.mk version [71e854ad00].
Deleted nfsclient.init.mk version [f1a8b2de56].
Deleted pwcheck.init.mk version [86138ffb9c].
Deleted random.init.mk version [6bbf837dab].
Deleted root.init.mk version [daf2788083].
Deleted rpc_umntall.init.mk version [b2f9b7f446].
Deleted runshm.init.mk version [df6ba5679f].
Deleted savecore.init.mk version [de8547d324].
Deleted swap.init.mk version [c2487b0c65].
Deleted sysctl.init.mk version [14b3132f0f].
Deleted sysdb.init.mk version [987bc8e0f2].
Deleted wlans.init.mk version [f45e8c9798].