Package: kmod
Version: 6-1
Severity: minor
Tags: patch
Please find attached some initscript adjustment suggestions, mainly for
better performance.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages kmod depends on:
ii libc6 2.13-27
ii libkmod2 6-1
ii lsb-base 3.2+Debian29
kmod recommends no packages.
kmod suggests no packages.
-- no debconf information
Cheers,
--
Cristian
commit 731913925679597c8a0249be6b070c50630067f6
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:26:28 2012 +0100
Removed useless whitespace.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index bfb2eeb..0846f50 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -1,8 +1,8 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: kmod
-# Required-Start:
-# Required-Stop:
+# Required-Start:
+# Required-Stop:
# Should-Start: checkroot
# Should-Stop:
# Default-Start: S
@@ -63,4 +63,3 @@ if [ "$VERBOSE" = no ]; then
fi
exit 0
-
commit 106a6d9422eea18b0c564083f8fe90dc0bfa60f5
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:28:37 2012 +0100
Removed some useless quotes.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index 0846f50..d7f416b 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -18,9 +18,9 @@
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions
-PATH="/sbin:/bin"
+PATH=/sbin:/bin
-case "$1" in
+case $1 in
start)
;;
@@ -36,8 +36,8 @@ esac
load_module() {
local module args
- module="$1"
- args="$2"
+ module=$1
+ args=$2
if [ "$VERBOSE" != no ]; then
log_action_msg "Loading kernel module $module"
commit 9ad4ead14a5242ee7c595f72b6dbcc6a7307087f
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:32:04 2012 +0100
Remove useless local variables.
Arguments aren't modified inside the function.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index d7f416b..2339a27 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -35,15 +35,14 @@ case $1 in
esac
load_module() {
- local module args
- module=$1
- args=$2
+ # $1 - module
+ # $2 - args
if [ "$VERBOSE" != no ]; then
- log_action_msg "Loading kernel module $module"
- modprobe $module $args || true
+ log_action_msg "Loading kernel module $1"
+ modprobe $1 $2 || true
else
- modprobe $module $args > /dev/null 2>&1 || true
+ modprobe $1 $2 > /dev/null 2>&1 || true
fi
}
commit 82dbb8a7500740699fabafd6d947a97a11e29187
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:34:58 2012 +0100
Show usage for the true command.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index 2339a27..2977e64 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -30,7 +30,7 @@ case $1 in
;;
*)
- log_success_msg "Usage: /etc/init.d/kmod start"
+ log_success_msg "Usage: $0 start"
exit 1
esac
commit 473eff6fe3f95a3d9c225fd702042f8b90f328a7
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:35:37 2012 +0100
Remove useless space.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index 2977e64..5500f20 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -42,7 +42,7 @@ load_module() {
log_action_msg "Loading kernel module $1"
modprobe $1 $2 || true
else
- modprobe $1 $2 > /dev/null 2>&1 || true
+ modprobe $1 $2 >/dev/null 2>&1 || true
fi
}
commit d7b607754d237f1ff3ab2c633edb472cadcfd674
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:36:42 2012 +0100
Use shell builtin ':' equivalent to 'true'.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index 5500f20..cded673 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -40,9 +40,9 @@ load_module() {
if [ "$VERBOSE" != no ]; then
log_action_msg "Loading kernel module $1"
- modprobe $1 $2 || true
+ modprobe $1 $2 || :
else
- modprobe $1 $2 >/dev/null 2>&1 || true
+ modprobe $1 $2 >/dev/null 2>&1 || :
fi
}
commit 4c61570d26eb9b849975b6879d8fd3910e4cb173
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:39:19 2012 +0100
Remove useless line continuation char after control operator.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index cded673..ae522eb 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -51,7 +51,7 @@ if [ "$VERBOSE" = no ]; then
fi
# Loop over every line in /etc/modules.
-grep '^[^#]' /etc/modules | \
+grep '^[^#]' /etc/modules |
while read module args; do
[ "$module" ] || continue
load_module "$module" "$args"
commit fbd511376b1cfb8ceb4a92690729137464bea31e
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:43:41 2012 +0100
Remove a grep fork.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index ae522eb..6970991 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -51,10 +51,15 @@ if [ "$VERBOSE" = no ]; then
fi
# Loop over every line in /etc/modules.
-grep '^[^#]' /etc/modules |
while read module args; do
- [ "$module" ] || continue
- load_module "$module" "$args"
+ case $module in
+ \#*|'')
+ continue
+ ;;
+ *)
+ load_module "$module" "$args"
+ ;;
+ esac
done
if [ "$VERBOSE" = no ]; then
commit 38fc164e0f096009926ab2f73d8873eb5dc8a08c
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:44:31 2012 +0100
Remove useless 'exit 0'; shell running under 'errexit'.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index 6970991..1c2a405 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -65,5 +65,3 @@ done
if [ "$VERBOSE" = no ]; then
log_action_end_msg 0
fi
-
-exit 0
commit ab646fb2aa82cd261f8e430aced7dceae56a7c93
Author: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun Mar 4 23:50:33 2012 +0100
Slightly faster tests.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
diff --git a/debian/kmod.init b/debian/kmod.init
index 1c2a405..753e60c 100644
--- a/debian/kmod.init
+++ b/debian/kmod.init
@@ -46,9 +46,7 @@ load_module() {
fi
}
-if [ "$VERBOSE" = no ]; then
- log_action_begin_msg 'Loading kernel modules'
-fi
+[ "$VERBOSE" != no ] || log_action_begin_msg 'Loading kernel modules'
# Loop over every line in /etc/modules.
while read module args; do
@@ -62,6 +60,4 @@ while read module args; do
esac
done
-if [ "$VERBOSE" = no ]; then
- log_action_end_msg 0
-fi
+[ "$VERBOSE" != no ] || log_action_end_msg 0