THE apm WRAPPER THAT BROKE THE POWER BUTTON
===========================================
apm-wrapper-card.sh Debian's shell-script wrapper
apm-wrapper-card-archival.sh the same, from the other tree
apm.orig-card PSION'S REAL apm BINARY, 8,664 bytes
apm.orig-card-archival the same
A good illustration of why parked files are worth keeping.
The red power button on the right-hand strip suspends the machine. It kept
failing, through three separate causes, and this was the last one.
1. The wrong command -- pm -pp, which does not work here.
2. No device access -- /dev/apm_bios was 0660 root:root, and the desktop
runs as lx. Fixed in 99psion-session.
3. *** LINUX IGNORES setuid ON SCRIPTS. ***
Psion's /usr/bin/apm is a setuid-root BINARY. At some point it had been
replaced by Debian's wrapper, which is a shell script -- and the kernel
refuses to honour the setuid bit on an interpreted file, for good security
reasons. So the ioctl was capability-gated and the suspend silently failed,
with no error that pointed anywhere near the real cause.
Psion's binary was recovered from the JFFS2, reinstalled, and given mode 4577
by the SETUID table in mkimage.sh. The button works.
If suspend ever stops working again, check that /usr/bin/apm is an ELF
binary with the setuid bit, not a script:
ls -l /usr/bin/apm # -rwsr-xr-x, and file(1) should say ELF