Package: laptop-mode-tools Version: 1.10-1 Severity: normal Tags: patch When I run '/etc/init.d/laptop-mode', I obtain:
.... Readahead states: /dev/hda3: 128 kB BLKRAGET: Inappropriate ioctl for device /usr/sbin/laptop_mode: line 261: / 2: syntax error: operand expected (error token is "/ 2") .... I am running Debiain on an amd64 architecture. I have also a chroot with Debian i386. My /etc/mtab contains: /dev/hda3 / reiserfs rw,notail 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 devpts /dev/pts devpts rw,gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs rw 0 0 usbfs /proc/bus/usb usbfs rw 0 0 /home /var/chroot/ia32/home none rw,bind 0 0 /tmp /var/chroot/ia32/tmp none rw,bind 0 0 proc /var/chroot/ia32/proc proc rw 0 0 tmpfs /dev tmpfs rw,size=10M,mode=0755 0 0 /dev/hda1 /mnt/WindowsXP ntfs ro,noexec,nosuid,nodev,umask=0222,user=username 0 0 The problems is due to the bind mount of my directory /home into /var/chroot/ia32/home. /usr/sbin/laptop_mode checks only if /home exists (line 260 - 'if [ -e $DEV]'), not if it is a block device (if [ -b $DEV ]). In fact, 'blockdev--getra /home' returns: BLKRAGET: Inappropriate ioctl for device Halva -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (800, 'testing'), (500, 'proposed-updates'), (400, 'unstable'), (200, 'stable'), (1, 'sarge-unsupported') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.13.1-amd64 Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Versions of packages laptop-mode-tools depends on: ii powermgmt-base 1.22 Common utils and configs for power Versions of packages laptop-mode-tools recommends: ii acpid 1.0.4-2 Utilities for using ACPI power man ii hdparm 6.1-2 tune hard disk parameters for high -- no debconf information
--- laptop_mode.orig 2005-09-15 10:25:21.000000000 +0200 +++ laptop_mode 2005-09-15 10:25:00.000000000 +0200 @@ -257,7 +257,7 @@ echo echo Readahead states: cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do - if [ -e $DEV ] ; then + if [ -b $DEV ] ; then echo " $DEV: $((`blockdev --getra $DEV` / 2)) kB" fi done