summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/initramfs-framework/exec
blob: a8e2432bb6d2398bd8744eb4a94b42d114c62b83 (plain)
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
#!/bin/sh
# Copyright (C) 2017 O.S. Systems Software LTDA.
# Licensed on MIT

EXEC_DIR=/exec.d  # place to look for modules

exec_enabled() {
	return 0
}

exec_run() {
	if [ ! -d $EXEC_DIR ]; then
		msg "No contents to exec in $EXEC_DIR. Starting shell ..."
		sh
	fi

	# Load and run modules
	for m in $EXEC_DIR/*; do
		# Skip backup files
		if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
			continue
		fi

		debug "Starting $m"

		# process module
		./$m
	done
}