aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorChris Rees <crees@FreeBSD.org>2019-04-07 18:31:45 +0000
committerChris Rees <crees@FreeBSD.org>2019-04-07 18:31:45 +0000
commitf5dfe75da5ba2937f8766792f625f32fc3ef4757 (patch)
treeee0333ae893dbad1feaeae76e5d300789fed9d29 /libexec
parentb2689b12b1f5a67741f439592764034b86de69c3 (diff)
Notes
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/rc/rc.d/abi4
-rwxr-xr-xlibexec/rc/rc.d/bthidd8
-rwxr-xr-xlibexec/rc/rc.d/cfumass2
-rwxr-xr-xlibexec/rc/rc.d/kld2
-rwxr-xr-xlibexec/rc/rc.d/mdconfig2
-rwxr-xr-xlibexec/rc/rc.d/mdconfig22
-rwxr-xr-xlibexec/rc/rc.d/mountcritremote2
-rwxr-xr-xlibexec/rc/rc.d/syscons2
-rw-r--r--libexec/rc/rc.subr43
9 files changed, 24 insertions, 43 deletions
diff --git a/libexec/rc/rc.d/abi b/libexec/rc/rc.d/abi
index bf582219a1f79..49766abb3895e 100755
--- a/libexec/rc/rc.d/abi
+++ b/libexec/rc/rc.d/abi
@@ -27,10 +27,10 @@ linux_start()
local _tmpdir
echo -n ' linux'
- load_kld -e 'linux(aout|elf)' linux
+ load_kld linux
case `sysctl -n hw.machine_arch` in
amd64)
- load_kld -e 'linux64elf' linux64
+ load_kld linux64
;;
esac
if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
diff --git a/libexec/rc/rc.d/bthidd b/libexec/rc/rc.d/bthidd
index 6471522641878..6ebc52f3c4c19 100755
--- a/libexec/rc/rc.d/bthidd
+++ b/libexec/rc/rc.d/bthidd
@@ -34,11 +34,11 @@ evdev_enabled()
bthidd_prestart()
{
if evdev_enabled; then
- load_kld -m uinput uinput
+ load_kld uinput
fi
- load_kld -m kbdmux kbdmux
- load_kld -m vkbd vkbd
- load_kld -m ng_btsocket ng_btsocket
+ load_kld kbdmux
+ load_kld vkbd
+ load_kld ng_btsocket
return 0
}
diff --git a/libexec/rc/rc.d/cfumass b/libexec/rc/rc.d/cfumass
index 9e34ddaf4b73f..7612462bba300 100755
--- a/libexec/rc/rc.d/cfumass
+++ b/libexec/rc/rc.d/cfumass
@@ -75,7 +75,7 @@ cfumass_start()
return "${err}"
fi
- load_kld -e cfumass cfumass
+ load_kld cfumass
# If the template is already switched to Mass Storage, then reset
# it to -1 to force the host to reenumerate it; otherwise it might
diff --git a/libexec/rc/rc.d/kld b/libexec/rc/rc.d/kld
index d3829efe824a0..3a77a73525ad1 100755
--- a/libexec/rc/rc.d/kld
+++ b/libexec/rc/rc.d/kld
@@ -46,7 +46,7 @@ kld_start()
echo 'Loading kernel modules:'
for _kld in $kld_list ; do
- load_kld -e ${_kld}.ko $_kld
+ load_kld $_kld
done
}
diff --git a/libexec/rc/rc.d/mdconfig b/libexec/rc/rc.d/mdconfig
index 26f282bbe9508..9efcead132b1e 100755
--- a/libexec/rc/rc.d/mdconfig
+++ b/libexec/rc/rc.d/mdconfig
@@ -114,7 +114,7 @@ mdconfig_start()
continue
fi
if [ "${_file}" != "${_file%.uzip}" ]; then
- load_kld -m g_uzip geom_uzip || return 3
+ load_kld geom_uzip || return 3
# sleep a bit to allow creation of /dev/mdX.uzip
sleep 2
fi
diff --git a/libexec/rc/rc.d/mdconfig2 b/libexec/rc/rc.d/mdconfig2
index 3a7f263d19e14..25ac903da6a3e 100755
--- a/libexec/rc/rc.d/mdconfig2
+++ b/libexec/rc/rc.d/mdconfig2
@@ -123,7 +123,7 @@ mdconfig2_start()
# been created.
if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then
if [ "${_file}" != "${_file%.uzip}" ]; then
- load_kld -m g_uzip geom_uzip || return 3
+ load_kld geom_uzip || return 3
fi
if is_readonly ${_fs}; then
warn "${_fs} is mounted read-only, skipping ${_md}."
diff --git a/libexec/rc/rc.d/mountcritremote b/libexec/rc/rc.d/mountcritremote
index dede14f194682..c87f6e76518ab 100755
--- a/libexec/rc/rc.d/mountcritremote
+++ b/libexec/rc/rc.d/mountcritremote
@@ -27,7 +27,7 @@ mountcritremote_precmd()
case "`mount -d -a -t nfs 2> /dev/null`" in
*mount_nfs*)
# Handle absent nfs client support
- load_kld -m nfs nfscl || return 1
+ load_kld nfscl || return 1
;;
esac
return 0
diff --git a/libexec/rc/rc.d/syscons b/libexec/rc/rc.d/syscons
index 7c0c8035be2ea..d2512dc071438 100755
--- a/libexec/rc/rc.d/syscons
+++ b/libexec/rc/rc.d/syscons
@@ -346,7 +346,7 @@ syscons_start()
for i in `kldstat | awk '$5 ~ "_saver\.ko$" { print $5 }'`; do
kldunload ${i}
done
- load_kld -e _saver ${saver}_saver
+ load_kld ${saver}_saver
;;
esac
diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr
index 93d2cfda87b77..2677cf4de7f84 100644
--- a/libexec/rc/rc.subr
+++ b/libexec/rc/rc.subr
@@ -1853,48 +1853,29 @@ mount_md()
}
# Code common to scripts that need to load a kernel module
-# if it isn't in the kernel yet. Syntax:
-# load_kld [-e regex] [-m module] file
-# where -e or -m chooses the way to check if the module
-# is already loaded:
-# regex is egrep'd in the output from `kldstat -v',
-# module is passed to `kldstat -m'.
-# The default way is as though `-m file' were specified.
+# if it isn't in the kernel yet. Syntax:
+# load_kld file
load_kld()
{
- local _loaded _mod _opt _re
+ local _opt
+ # Silently ignore legacy options; they are unnecessary
while getopts "e:m:" _opt; do
case "$_opt" in
- e) _re="$OPTARG" ;;
- m) _mod="$OPTARG" ;;
- *) err 3 'USAGE: load_kld [-e regex] [-m module] file' ;;
+ e) ;;
+ m) ;;
+ *) err 3 'USAGE: load_kld file' ;;
esac
done
shift $(($OPTIND - 1))
if [ $# -ne 1 ]; then
- err 3 'USAGE: load_kld [-e regex] [-m module] file'
+ err 3 'USAGE: load_kld file'
fi
- _mod=${_mod:-$1}
- _loaded=false
- if [ -n "$_re" ]; then
- if kldstat -v | egrep -q -e "$_re"; then
- _loaded=true
- fi
- else
- if kldstat -q -m "$_mod"; then
- _loaded=true
- fi
- fi
- if ! $_loaded; then
- if ! kldload "$1"; then
- warn "Unable to load kernel module $1"
- return 1
- else
- info "$1 kernel module loaded."
- fi
+ if ! kldload -n "$1"; then
+ warn "Unable to load kernel module $1"
+ return 1
else
- debug "load_kld: $1 kernel module already loaded."
+ info "$1 kernel module loaded."
fi
return 0
}