aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/modloop.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/openrc/modloop.initd')
-rwxr-xr-xmain/openrc/modloop.initd12
1 files changed, 10 insertions, 2 deletions
diff --git a/main/openrc/modloop.initd b/main/openrc/modloop.initd
index 87069b487ac..41f8462bb72 100755
--- a/main/openrc/modloop.initd
+++ b/main/openrc/modloop.initd
@@ -1,5 +1,8 @@
#!/sbin/openrc-run
+# Copyright (c) Natanael Copa
+# This code is licensed under BSD-2-Clause
+
# script that will mount image with modules
depend() {
@@ -12,7 +15,7 @@ depend() {
init_KOPT() {
for opt in $(cat /proc/cmdline 2>/dev/null); do
case "$opt" in
- modloop=*)
+ modloop=*|modloop_verify=*)
eval "KOPT_${opt%%=*}='${opt#*=}'" ;;
esac
done
@@ -43,6 +46,9 @@ find_modloop() {
verify_modloop() {
local modloop=$1 key=
+ if ! yesno "${KOPT_modloop_verify:=yes}"; then
+ return 0
+ fi
for key in /etc/apk/keys/*.pub; do
local sig=/var/cache/misc/${modloop##*/}.SIGN.RSA.${key##*/}
if [ -f "$sig" ]; then
@@ -67,11 +73,12 @@ start() {
local modloop= mount_opts= modloop_dldir="/lib"
init_KOPT
- mkdir -p /.modloop /lib
case "$KOPT_modloop" in
+ none) return 0;;
http://*|https://*|ftp://*)
modloop=$modloop_dldir/${KOPT_modloop##*/}
if [ ! -f "$modloop" ]; then
+ mkdir -p "$modloop_dldir"
wget -P "$modloop_dldir" "$KOPT_modloop" || eend 1
fi
;;
@@ -87,6 +94,7 @@ start() {
esac
ebegin "Mounting modloop $modloop"
+ mkdir -p /.modloop
if [ -n "$modloop" ]; then
verify_modloop "$modloop" || eerror "Failed to verify signature of $img!"
mount -o loop,ro $modloop /.modloop