[Pkg-ltsp-devel] Bug#575031: Bug#575031: Bug#575031: ltspfs: issue KDE popups

Petter Reinholdtsen pere at hungry.com
Thu May 6 08:41:37 UTC 2010


[Petter Reinholdtsen]
> This script work, and causes a LTSP entry to show up in the list of
> removable devices:

But it only work for root, and the ltspfs hook run as the user.  I
tried using this trick in a /etc/ltspfs/mounter.d/hal-notify script,
and hal-device fail because only root can run it.  Hm, back to the
drawing board. :(

This is the script I tested:

tjener:~# cat /etc/ltspfs/mounter.d/hal-notify
#!/bin/sh

case "$1" in
    add)
        mountpoint="$2"
        devname=$(basename "$mountpoint")
        halname="storage_serial_LTSP_$devname"
        cat <<EOF | hal-device --add "$halname"
block.is_volume = true  (bool)
block.storage_device = '/org/freedesktop/Hal/devices/$halname'  (string)
storage.removable = true  (bool)
storage.hotpluggable = true  (bool)
info.capabilities = {'volume', 'block'} (string list)
info.category = 'volume'  (string)
info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
info.product = 'LTSP $devname'  (string)
info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
volume.fstype = 'ltspfs'  (string)
volume.fsusage = 'filesystem'  (string)
volume.ignore = false  (bool)
volume.is_disc = false  (bool)
volume.is_mounted = true  (bool)
volume.is_mounted_read_only = false  (bool)
volume.is_partition = false  (bool)
volume.label = ''  (string)
volume.mount_point = '$mountpoint'  (string)
EOF
        ;;
    remove)
        mountpoint="$2"
        devname=$(basename "$mountpoint")
        halname="storage_serial_LTSP_$devname"
        hal-device --remove "$halname"
        ;;
    cleanup)
        # XXX Not quite sure what is supposed to happen here
        ;;
esac
tjener:~#

Happy hacking,
-- 
Petter Reinholdtsen





More information about the Pkg-ltsp-devel mailing list