Lighweight pup_event_frontend_d Replacement

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#41 Post by Karl Godt »

The whole udevadm --trigger is complete garbage !
:

Code: Select all

for anU in `ls -1v /sys/block/*/*/uevent`; do
echo add >$anU; sleep 0.3; done;
and same for "echo remove" ie /sbin/clean_desk_icons

This uses the '-v' switch of `ls' to sort the partition numbers.


What is missing is maybe a second

#define PARTITION_DEVTYPE "partition"

for "disk" :

E: DEVTYPE=disk
E: DEVNAME=/dev/sr0
E: ID_CDROM=1
E: ID_TYPE=cd
E: ID_INSTANCE=0:0
E: ID_BUS=usb


And part-icon could have such code adjusts:

Code: Select all

# check the VARIABES
if [ "$DEVNAME" ]; then
        :
elif [ "$DEVPATH" ]; then
        DEVNAME="/dev/${DEVPATH##*/}"
else echo "$0:Error:Need UDEV's DEVNAME or DEVPATH"; exit 1;
fi
#DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda19
#echo "DEVPATH=$DEVPATH"
#echo "DEVNAME=$DEVNAME"

# create unique path for ROX
test -d $HOME/.pup_event/drive_${DEVNAME##*/} || mkdir -p $HOME/.pup_event/drive_${DEVNAME##*/}
test -f $HOME/.pup_event/drive_${DEVNAME##*/}/mount-and-open -a -x $HOME/.pup_event/drive_${DEVNAME##*/}/mount-and-open || cp -a /sbin/mount-and-open $HOME/.pup_event/drive_${DEVNAME##*/}/

case "$ACTION" in
    add)
        # guess the fs type and don't process further if undesired -
        # set guessfstype as you wish and adjust grep pattern
        guessfstype=guess_fstype
        $guessfstype $DEVNAME | grep -iE "unknown|none|swap|Extended|Ext'd" && exit 0

Code: Select all

        # check for usb
        if test -e /sys/block/${DEVNAME##*/}; then
        realPATH=`realpath /sys/block/${DEVNAME##*/}`
        elif test -e "/sys/block/`echo ${DEVNAME##*/} | sed 's/[0-9]*$//'`/${DEVNAME##*/}"; then
        realPATH=`realpath /sys/block/$(echo ${DEVNAME##*/} | sed 's/[0-9]*$//')/${DEVNAME##*/}`
        fi

        case "$realPATH" in
        *usb*) kDRIVE=usb;;
        *) :;;
        esac

        # check for removable
        if test -f /sys/block/${DEVNAME##*/}/removable; then
        read removABLE< /sys/block/${DEVNAME##*/}/removable
        fi

        case "$removeABLE" in
        1) kDRIVE="${kDRIVE}cd";;
        *) :;;
        esac

        case $ID_BUS in
        usb)  :;;
        scsi) :;; #SATA HDD
        esac

        case $ID_TYPE in
        cd)   :;; # CD
        disk) :;; # HDD USB flash pendrive
        esac

        case $ID_CDROM in
        1):;;
        esac

        case $ID_VENDOR in
        ATA)  :;; # internal (S)ATA
        USB)  :;; #
        esac
My experiences with Xorg s with udev dependencies brought me back here .

Have never encountered USB-FDD and such bizarre devices .
For IDE I could find out .

At the moment at reworking parts of /init - so am occupied with other things for the next times .

Post Reply