1
0
Fork 0
mirror of https://github.com/pygos/init.git synced 2024-12-22 07:10:49 +01:00

Add a module auto loading service

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-07-17 22:39:27 +02:00
parent 258848ace2
commit 4b047ad61e
7 changed files with 53 additions and 2 deletions

2
.gitignore vendored
View file

@ -31,9 +31,11 @@ services/sysfs
services/ifrename
services/ifcfg
services/ifdown
services/modules
scripts/devfs.sh
scripts/ifrename.sh
scripts/ifcfg.sh
scripts/modules_load.sh
etc/initd.env

View file

@ -46,6 +46,7 @@ install-data-local:
$(LN_S) $(TEMPLATEDIR)/sigterm $(DESTDIR)$(SVCDIR)/sigterm@reboot
$(LN_S) $(TEMPLATEDIR)/ifdown $(DESTDIR)$(SVCDIR)/ifdown@reboot
$(LN_S) $(TEMPLATEDIR)/ifcfg $(DESTDIR)$(SVCDIR)/ifcfg
$(LN_S) $(TEMPLATEDIR)/modules $(DESTDIR)$(SVCDIR)/modules
if USYSLOGD
$(LN_S) $(TEMPLATEDIR)/usyslogd $(DESTDIR)$(SVCDIR)/usyslogd
endif

View file

@ -65,9 +65,11 @@ AC_CONFIG_FILES([services/procfs])
AC_CONFIG_FILES([services/ifrename])
AC_CONFIG_FILES([services/ifcfg])
AC_CONFIG_FILES([services/ifdown])
AC_CONFIG_FILES([services/modules])
AC_CONFIG_FILES([scripts/devfs.sh])
AC_CONFIG_FILES([scripts/ifrename.sh])
AC_CONFIG_FILES([scripts/ifcfg.sh])
AC_CONFIG_FILES([scripts/modules_load.sh])
AC_CONFIG_FILES([etc/initd.env])
AC_OUTPUT([Makefile])

View file

@ -1,4 +1,4 @@
helper_SCRIPTS += scripts/devfs.sh scripts/trymount.sh scripts/ifrename.sh
helper_SCRIPTS += scripts/ifcfg.sh scripts/ifdown.sh
helper_SCRIPTS += scripts/ifcfg.sh scripts/ifdown.sh scripts/modules_load.sh
EXTRA_DIST += scripts/trymount.sh scripts/ifdown.sh

View file

@ -0,0 +1,39 @@
#!/bin/sh
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Copyright (C) 2018 - David Oberhollenzer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
MODLIST="@ETCPATH@/modules"
if [ ! -f "$MODLIST" ]; then
exit 0
fi
while read LINE;
do
trimmed=`echo -- $LINE`
[ ! -z "$trimmed" ] || continue
set $trimmed
case "$1" in
\#*)
;;
*)
modprobe "$1"
;;
esac
done < "$MODLIST"

View file

@ -6,7 +6,7 @@ init_DATA += services/sigterm services/sync services/devfs
init_DATA += services/sysfs services/procfs services/tmpfs
init_DATA += services/vfs services/ifrename services/ifcfg
init_DATA += services/dhcpcd services/dhcpcdmaster services/unbound
init_DATA += services/dnsmasq services/ifdown
init_DATA += services/dnsmasq services/ifdown services/modules
if USYSLOGD
init_DATA += services/usyslogd

7
services/modules.in Normal file
View file

@ -0,0 +1,7 @@
description "load kernel modules"
type wait
target boot
after vfs
before sysinit
exec "@SCRIPTDIR@/modules_load.sh"