From 71b45b386a0418d417f065c9a8703b956e65ea8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=27yanosz=27=20L=C3=BChr?= Date: Mon, 27 Feb 2017 17:11:18 +0100 Subject: [PATCH] base-files: don't fail on inserting loaded module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When installing kmod-* packages, insert_modules modprobes all modules. modprobe fails, if the module is already loaded and succeeds if the module doesn't exists. Ignoring its return code appears reasonable. This causes package installation to fail Fix FS#433 - kmod-ebtables, kmod-br-netfilter opkg install failed Related to Busybox bug 9676 Signed-off-by: Jan 'yanosz' Lühr --- package/base-files/files/lib/functions.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index b68db6b6bd7e..8a611cf72e60 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -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 fi done }