aboutgitcode
diff options
context:
space:
mode:
authorSevinj Aghayeva <sevinj.aghayeva@gmail.com>2022-04-08 07:26:05 -0400
committerStefano Brivio <sbrivio@redhat.com>2022-04-08 21:26:24 +0200
commit83e5ef9fbb508b60aa0d1126a7eeae67ef65637c (patch)
tree51b19282a7e0081f9bc18b3089ddddbe90bb65d2
parent57fec9fcfddc9ebaf3885dfd8d314c8c67bac117 (diff)
downloadmbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.tar
mbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.tar.gz
mbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.tar.bz2
mbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.tar.lz
mbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.tar.xz
mbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.tar.zst
mbuto-83e5ef9fbb508b60aa0d1126a7eeae67ef65637c.zip
mbuto: handle adding built-in modules
We first assign the output of modprobe to a string and check if it is a built-in module and add its node if so. Otherwise, we process every token in modprobe output and try to see if it is a module. Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
-rwxr-xr-xmbuto35
1 files changed, 20 insertions, 15 deletions
diff --git a/mbuto b/mbuto
index 3884f5a..e8e4129 100755
--- a/mbuto
+++ b/mbuto
@@ -700,22 +700,27 @@ kmod_add() {
__find_path="${MODDIR}/lib/modules"
fi
- for __t in $("${MODPROBE}" -S "${KERNEL}" -d "${__d_opt}" -q \
- --show-depends -- "$(${BASENAME} -- ${1})"); do
- __t="$(${BASENAME} -- "${__t%*.ko}")"
- if ${MODPROBE} -S "${KERNEL}" -d "${__d_opt}" -q \
- --show-depends -- "$(${BASENAME} -- "${__t}")"; then
- __src="$(${FIND} ${__find_path} -name "${__t}.ko")"
- __dst="${wd}/${__src##${MODDIR}}"
- if ! "${DIFF}" "${__src}" "${__dst}" 2>/dev/null; then
- "${MKDIR}" -p "$("${DIRNAME}" "${__dst}")"
- "${CP}" -a "${__src}" "${__dst}"
- fi
- kmod_node "${1}"
- elif [ -z "${__f%builtin *}" ]; then
+ __f=$("${MODPROBE}" -S "${KERNEL}" -d "${__d_opt}" -q \
+ --show-depends -- "$(${BASENAME} -- ${1})")
+ case ${__f} in
+ "builtin "*)
kmod_node "${1}"
- fi
- done
+ ;;
+ *)
+ for __t in ${__f}; do
+ __t="$(${BASENAME} -- "${__t%*.ko}")"
+ if ${MODPROBE} -S "${KERNEL}" -d "${__d_opt}" -q \
+ --show-depends -- "$(${BASENAME} -- "${__t}")"; then
+ __src="$(${FIND} ${__find_path} -name "${__t}.ko")"
+ __dst="${wd}/${__src##${MODDIR}}"
+ if ! "${DIFF}" "${__src}" "${__dst}" 2>/dev/null; then
+ "${MKDIR}" -p "$("${DIRNAME}" "${__dst}")"
+ "${CP}" -a "${__src}" "${__dst}"
+ fi
+ kmod_node "${1}"
+ fi
+ done
+ esac
}
# kmod_post() - Copy files for modprobe on target, run depmod