Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion package/base-files/files/lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ insert_modules() {
if [ -f /etc/modules.d/$m ]; then
sed 's/^[^#]/insmod &/' /etc/modules.d/$m | ash 2>&- || :
else
modprobe $m
# Since busybox modprobe returns 0 on loading non-existing
# and 255 on loading already loaded modules
# its return-code is not useful
modprobe $m || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better make it modprobe; [ "$?" = 0 -o "$?" = 255 ] and adapt the comment accordingly

Copy link
Author

@yanosz yanosz Mar 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... I don't agree.
This code doesn't ignore modprobe's return code. I think, we should do so, since its bogus

Thus I don't like to make "255" explicit and go for ignoring modprobe's return code at all.
I think, that there's a semantic difference.

If you are aware of specific return code, that should be taken into account, I'm happy with mapping that option to some error value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it. thanks for the efforts ;)

fi
done
}
Expand Down