Package: ethtool
Version: 6+20090323-2
Severity: minor
Tags: patch
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch
Hi folks,
The ethtool package currently installs if-up and if-pre-up hooks that
postprocess various env vars to tune the underlying ethernet device. This
obviously makes no sense to do when the interface is the loopback interface,
because we know lo never has ethernet hardware.
The attached patch has been applied in Ubuntu to short-circuit these
scripts, according to the convention used in other if-up scripts. Changelog
entry for this change is:
* debian/ethtool.if-up, debian/ethtool.if-pre-up: exit if the interface is
lo, there's no sense in spending time parsing the env with awk in this
case.
I would recommend doing the same in the Debian package, since this gives a
measurable reduction in boot time due to the overhead of the awk commands.
Cheers,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
[email protected] [email protected]
diff -u ethtool-6+20090323/debian/ethtool.if-pre-up ethtool-6+20090323/debian/ethtool.if-pre-up
--- ethtool-6+20090323/debian/ethtool.if-pre-up
+++ ethtool-6+20090323/debian/ethtool.if-pre-up
@@ -4,6 +4,8 @@
test -x $ETHTOOL || exit 0
+[ "$IFACE" != "lo" ] || exit 0
+
# Gather together the mixed bag of settings applied with -s/--change
SETTINGS="\
${IF_ETHERNET_PORT:+ port $IF_ETHERNET_PORT}\
diff -u ethtool-6+20090323/debian/ethtool.if-up ethtool-6+20090323/debian/ethtool.if-up
--- ethtool-6+20090323/debian/ethtool.if-up
+++ ethtool-6+20090323/debian/ethtool.if-up
@@ -4,6 +4,8 @@
test -x $ETHTOOL || exit 0
+[ "$IFACE" != "lo" ] || exit 0
+
# Find settings with a given prefix and print them as they appeared in
# /etc/network/interfaces, only with the prefix removed.
gather_settings () {