Skip to content

Commit

Permalink
Merge pull request #38 from smoser/fix/load-modules-fix
Browse files Browse the repository at this point in the history
load-modules: Fix bug in parse_modules and print loaded modules.
  • Loading branch information
hrw authored Jan 28, 2020
2 parents a22cef4 + dd427c0 commit 7a2b0c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/etc/init.d/load-modules
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ loadmods() {
error "failed loading these modules: $fails"
return 1
fi
local loaded=""
loaded=$(awk '{print $1}' /proc/modules | sort | tr '\n' ' ')
debug 0 "currently loaded modules: $loaded"
return 0
}

Expand All @@ -79,10 +82,12 @@ parse_modules() {
amd64|x86_64) march=",x86_64,x86,";;
ppc64|powerpc) march=",powerpc,ppc64,";;
arm*) march=",arm,$arch,";;
*) march=",$arch,";;
esac
while read line; do
[ -n "$line" ] || continue
modinfo=${line%%#*}
[ -n "$modinfo" ] || continue
[ "$modinfo" = "$line" ] && comment="" ||
comment="${line#${modinfo}#}"
[ "${comment#*arch=}" = "$comment" ] &&
Expand Down

0 comments on commit 7a2b0c3

Please sign in to comment.