Package: sysfsutils
Version: 2.1.0+repack-1
Severity: normal
If the file does not end in a newline, then the last line is silently
ignored. This is because the "read" command in /etc/init.d/sysfsutils does not
match lines without a trailing newline.
A patch to fix this:
--- init.d/sysfsutils 2010-08-06 19:16:17.000000000 +0200
+++ /etc/init.d/sysfsutils 2011-08-21 17:02:39.000000000 +0200
@@ -27,9 +27,9 @@
start|restart|force-reload)
log_begin_msg "Setting sysfs variables..."
+ (cat $CONFFILE;echo) | #add a trailing newline
sed 's/#.*$//; /^[[:space:]]*$/d;
-
s/^[[:space:]]*\([^=[:space:]]*\)[[:space:]]*\([^=[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1
\2 \3/' \
- $CONFFILE | {
+
s/^[[:space:]]*\([^=[:space:]]*\)[[:space:]]*\([^=[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1
\2 \3/' | {
while read f1 f2 f3; do
if [ "$f1" = "mode" -a -n "$f2" -a -n "$f3" ]; then
if [ -f "/sys/$f2" ]; then
Regards, Thue
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=da_DK.UTF-8, LC_CTYPE=da_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages sysfsutils depends on:
ii libc6 2.13-16 Embedded GNU C Library: Shared lib
ii libsysfs2 2.1.0+repack-1 interface library to sysfs
sysfsutils recommends no packages.
sysfsutils suggests no packages.
-- Configuration Files:
/etc/init.d/sysfsutils changed:
CONFFILE=/etc/sysfs.conf
[ -r "$CONFFILE" ] || exit 0
. /lib/lsb/init-functions
case "$1" in
start|restart|force-reload)
log_begin_msg "Setting sysfs variables..."
(cat $CONFFILE;echo) | #add a trailing newline
sed 's/#.*$//; /^[[:space:]]*$/d;
s/^[[:space:]]*\([^=[:space:]]*\)[[:space:]]*\([^=[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1
\2 \3/' | {
while read f1 f2 f3; do
if [ "$f1" = "mode" -a -n "$f2" -a -n "$f3" ]; then
if [ -f "/sys/$f2" ]; then
chmod "$f3" "/sys/$f2"
else
log_failure_msg "unknown attribute $f2"
fi
elif [ "$f1" = "owner" -a -n "$f2" -a -n "$f3" ]; then
if [ -f "/sys/$f2" ]; then
chown "$f3" "/sys/$f2"
else
log_failure_msg "unknown attribute $f2"
fi
elif [ "$f1" -a -n "$f2" -a -z "$f3" ]; then
if [ -f "/sys/$f1" ]; then
# Some fields need a terminating newline, others
# need the terminating newline to be absent :-(
echo -n "$f2" > "/sys/$f1" 2>/dev/null ||
echo "$f2" > "/sys/$f1"
else
log_failure_msg "unknown attribute $f1"
fi
else
log_failure_msg "syntax error in $CONFFILE: '$f1' '$f2'
'$f3'"
log_end_msg 1
exit 1
fi
done
}
log_end_msg 0
;;
stop)
;;
*)
echo "Usage: /etc/init.d/sysfsutils {start|stop|force-reload|restart}"
exit 1
;;
esac
/etc/sysfs.conf changed:
class/drm/card0/device/power_profile = auto
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]