bashism in hal-system-lcd-get-brightness-linux

Bug #68617 reported by Jean-Christophe Baptiste
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HAL
Invalid
Undecided
Unassigned
hal (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

Binary package hint: gnome-power-manager

Hi,

I am using a Sony Vaio laptop and have sonypi module correctly set-up and working.
Using the command line, the brightness works well.

But, although it worked well on Dapper, Power Manager does not change the brightness anymore.

Regards,
JC

Revision history for this message
Pedro Martinez-Julia (pedromj) wrote : Re: [Bug 68617] [Edgy] PowerManager has no more effect on brightness

Please try to:

cd /bin
sudo mv sh sh.original
sudo ln -s /bin/bash /bin/sh

And then try to use gnome-power-manager to change the brightness.

I found that the scripts in hal uses "let" that is not implemented in
"dash".

--
Pedro Martínez Juliá
\ <email address hidden>
)| WebLog: http://www.pedromj.com/blog
/ Página web: http://www.pedromj.com
GoogleTalk: <email address hidden>
Socio HispaLinux #311
Usuario Linux #275438 - http://counter.li.org

Revision history for this message
Jean-Christophe Baptiste (jc-baptiste) wrote : Re: [Edgy] PowerManager has no more effect on brightness

Great ! It is working now indeed.

Thank you very much,
JC

Revision history for this message
Luka Renko (lure) wrote :

This is the issue in hal package as the following script uses /bin/sh, but should use /bin/bash instead:

/usr/share/hal/scripts/hal-system-lcd-get-brightness

I think thic could be considred for edgy-updates as it is regression and simple, obvious fix.

Changed in gnome-power-manager:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Luka Renko (lure) wrote :

BTW, proper workaround is to change the script and not to globally replace /bin/sh with /bin/bash (as mentioned in above comment).

Revision history for this message
Tom (tom-ranson) wrote :

I confirm the same issue on a Sony VGN-TX3XP with Edgy (fresh install),

"BTW, proper workaround is to change the script and not to globally replace /bin/sh with /bin/bash (as mentioned in above comment)."

Please can you enlighten me as to how I could change the hal script(s) rather than globally replacing /bin/sh with /bin/bash?

Revision history for this message
Jan Vlnas (jnv) wrote :

> Please can you enlighten me as to how I could change the hal script(s) rather than globally replacing /bin/sh with /bin/bash?

Edit the mentioned script as root. In the script on the first line there is:
#!/bin/sh

Just change this line on:
#!/bin/bash

Martin Pitt (pitti)
Changed in hal:
assignee: nobody → pitti
status: Confirmed → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in bzr head, will upload after Herd-2 freeze.

Changed in hal:
status: In Progress → Fix Committed
Revision history for this message
Daniel Lombraña González (teleyinex) wrote :

I have a Sony Vaio SZ2M/B and I have changed the dash line of the scripts of hal to bash and it was working. After the last upgrade the brightness is not working again. I have tried with bash/dash and it's not working, so I think this bug should continue open.

Revision history for this message
Martin Pitt (pitti) wrote :

I did not yet upload the fixed version, thus this is 'fix committed', not 'fix released'.

Revision history for this message
Martin Pitt (pitti) wrote :

 hal (0.5.8.1-4ubuntu3) feisty; urgency=low
 .
   * debian/patches/30-mp3-player-fdi.patch: Clean up a bit.
   * Add debian/patches/17_hdm_bus_type.patch: Fix 'bus type' display in
     hal-device-manager. Closes: LP#26362
   * Add debian/patches/18_set-brightness_bashism.patch: Fix bashism in
     tools/linux/hal-system-lcd-get-brightness-linux to make brightness setting
     on Sony Vaio laptops work again. Closes: LP#68617
   * debian/hal-device-manager.desktop{,.in}: Since hal-device-manager does not
     actually manage anything, rename it to 'Hardware information'.
     Closes: LP#45247
   * debian/patches/30-mp3-player-fdi.patch: Add iAudio F2. Closes: LP#78546
   * debian/control: Add alternative build dependency 'libvolumeid-dev' for
     backportability.
   * Rename debian/patches/16_ntfs_allow_local_mount_option.patch to
     16_ntfs_allowed_mount_options.patch and add 'utf8'. Closes: LP#78142

Changed in hal:
status: Fix Committed → Fix Released
Revision history for this message
Carlo Luzi (carlo-luzi) wrote :

I'm on a VAIO VGN-FS215M that use the module sony_acpi.

To make the brightness control work I've change the first line in:
  /usr/lib/hal/scripts/linux/hal-system-lcd-get-brightness-linux
  /usr/lib/hal/scripts/linux/hal-system-lcd-set-brightness-linux
from:
  #!/bin/sh
to:
  #!/bin/bash
and now the control work.

Revision history for this message
Ernesto (ernestoongaro) wrote :

Changing to bash on Feisty final worked for my Vaio VGN-FS810/w

Revision history for this message
omer (omer-xerolabs) wrote :

I'm running 7.10 beta Gutsy Gibbon and experiencing this problem on my Sony Vaio VGN-N250e. I can't change brightness through gnome-power-manager or the brightness applet. I have changed the above mentioned files to /bin/bash from /bin/sh but to no avail. I can still change the brightness by manually writing to the /sys/class/backlight/sony/brightness file... I have to chown the file first and then echo 1-8 to the file and it works. Would like it to work through gnome, however.
It did work for a short period of time but after a recent update (on October 4) it stopped working again.

Revision history for this message
dino99 (9d9) wrote :

outdated report & no more maintained distro; please send a new one if that issue still exist (using ubuntu-bug)

hal is only used into the maintained Precise & Lucid (no more used with recent ubuntu)

Changed in hal:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.