Code: Select all
cat /var/log/messages | grep Direct-Access -A 1 -B 1 | sed -e 's/.*kernel:/:/g'
Code: Select all
cat /proc/partitions | grep sd | sed -e 's/[0-9]//g' | sed -e 's/ //g' | sort -u
Code: Select all
cat /var/log/messages | grep Direct-Access -A 1 -B 1 | sed -e 's/.*kernel:/:/g'
Code: Select all
cat /proc/partitions | grep sd | sed -e 's/[0-9]//g' | sed -e 's/ //g' | sort -u
I've done some testing and the 'merged' pmount seems to work well, even on the eBox. It is faster and now includes buttons to launch rox for mounted partitions, along with other small improvements. I have sent it off to Barry with the hope that he can include it in 2.13beta2.plinej wrote:On a side note I've revised dougal's revised pmount to include a rox launcher and a couple of other minor things and sent it off to pakt.
Code: Select all
cat /var/log/messages | grep Direct-Access -A 1 -B 1 | sed -e 's/.*kernel:/:/g' | grep -v Direct-Access
Code: Select all
cat /proc/partitions | grep sd | sed -e 's/[0-9]//g' | sed -e 's/ //g' | sort -u
Code: Select all
sh-3.00# cd /usr/lib/mut
sh-3.00# grep -i "/proc" mut.tcl
if {[file exists /proc/bus/usb/devices]} {
set ::last_hotplug [file mtime /proc/bus/usb/devices]
set fid [open "/proc/devices" r]
set bd_fd [open "/proc/ide/$bus/$lun/$scan_me" r]
set fid [open "/proc/diskstats" r]
set fid [open "/proc/partitions" r]
set gl [split [glob "/proc/ide/ide*/$dev"] /]
set fid [open "/proc/swaps" r]
set fid [open "/proc/scsi/scsi" r]
set fid [open "/proc/scsi/usb-storage/$ctrlr" r]
if {[file exists /proc/bus/usb/devices]} {
set hotplug [file mtime /proc/bus/usb/devices]
array unset partitions ; # List of info from /proc/partitions
array unset mounteds ; # List of info from /proc/mounts
set grabdevs {fd hd sd scd sr} ; # list of device types to scan in /proc/diskstats & /proc/partitions
array unset majorBus ; # block device info from /proc/devices
if {[file exists /proc/bus/usb/devices]} {
Code: Select all
sh-3.00# cat /proc/scsi/scsi
Attached devices:
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: LEXAR Model: JD FIREFLY Rev: 3000
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: I-Stick2 Model: IntelligentStick Rev: 0.00
Type: Direct-Access ANSI SCSI revision: 02
Code: Select all
T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=3538 ProdID=0042 Rev= 1.00
S: Product=USB Mass Storage Device
S: SerialNumber=00000000000287
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 98mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=8ms
T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=05dc ProdID=a560 Rev=30.00
S: Manufacturer=LEXAR MEDIA
S: Product=JD FIREFLY
S: SerialNumber=1069A701072609160706
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
Code: Select all
#!/bin/sh
if [ -d /tmp/probedisk ]; then
rm -r /tmp/probedisk
fi
mkdir /tmp/probedisk
probedisk2 | grep -v 'dev/sd' > /tmp/probedisk/probedisk
cat /proc/partitions | grep sd | sed -e 's/[0-9]//g' | sed -e 's/ //g' | sort -u > /tmp/probedisk/usbdevices
cat /tmp/probedisk/usbdevices | while read DEV
do
echo Vendor > /tmp/probedisk/"$DEV"
cat /var/log/messages | grep Direct-Access -A 1 -B 1 | sed -e 's/.*kernel:/:/g' | grep -v Direct-Access | sed '/^$/d' | sed '/^--/d' | grep "$DEV" -B 1 >> /tmp/probedisk/"$DEV"
NUMLINES=`cat /tmp/probedisk/"$DEV" | wc -l | sed -e 's/ *//' | sed -e 's/ .*//g'`
NUMLINES2=`expr "$NUMLINES" - 1`
while [ "`cat /tmp/probedisk/"$DEV" | sed -n "$NUMLINES2"p | grep Vendor`" = "" ]
do
NUMLINES2=`expr "$NUMLINES2" - 1`
done
VENDOR=`cat /tmp/probedisk/"$DEV" | sed -n ""$NUMLINES2"p" > /tmp/probedisk/"$DEV"-vendor`
BRAND=`cat /tmp/probedisk/"$DEV"-vendor | cut -f 3 -d ':' | sed -e 's/Model//g' | sed -e 's/ *//' | tr -s ' '`
NAME=`cat /tmp/probedisk/"$DEV"-vendor | cut -f 4 -d ':' | sed -e 's/Rev//g' | sed -e 's/ *//' | tr -s ' '`
echo \/dev\/"$DEV"\|Direct-Access\|"$BRAND""$NAME" >> /tmp/probedisk/probedisk
done
cat /tmp/probedisk/probedisk
rm -r /tmp/probedisk
Code: Select all
#!/bin/sh
### a re-write for probedisk (usb portion)
### the original probedisk has problems with usb information
### http://www.murga-linux.com/puppy/viewtopic.php?t=13267
### Rename the original probedisk at /sbin/ to probedisk2
### save this script as /sbin/probedisk
if [ -d /tmp/probedisk ]; then
rm -r /tmp/probedisk
fi
mkdir /tmp/probedisk
cp /var/log/messages /tmp/probedisk
probedisk2 | grep -v 'dev/sd' > /tmp/probedisk/probedisk ### use the original probedisk (renamed to probedisk2) to get all non-usb information
cat /proc/partitions | grep sd | sed -e 's/[0-9]//g' | sed -e 's/ //g' | sort -u > /tmp/probedisk/usbdevices ### get current existing usb device names
cat /tmp/probedisk/usbdevices | while read DEV
do
cat /tmp/probedisk/messages | grep Direct-Access -A 1 -B 1 | sed -e 's/.*kernel:/:/g' | grep -v Direct-Access | sed '/^$/d' | sed '/^--/d' | grep "$DEV" -B 1 > /tmp/probedisk/"$DEV" ### get necessary info from /tmp/probedisk/messages
NUMLINES=`cat /tmp/probedisk/"$DEV" | wc -l | sed -e 's/ *//' | sed -e 's/ .*//g'`
NUMLINES2=`expr "$NUMLINES" - 1`
if [ "`cat /tmp/probedisk/"$DEV" | grep Vendor`" != "" ]; then ### just incase Vendor info isn't on designated line
while [ "`cat /tmp/probedisk/"$DEV" | sed -n ""$NUMLINES2"p" | grep Vendor`" = "" ]
do
NUMLINES2=`expr "$NUMLINES2" - 1`
done
fi
if [ "`cat /tmp/probedisk/"$DEV" | grep Vendor`" = "" ]; then ### just incase Vendor info isn't in file we'll try to get it an alternate way
NUM=`cat /tmp/probedisk/messages | grep 'SCSI device "$DEV":' -n | cut -f 1 -d ':' | tail -n 1` ### get last line in /tmp/probedisk/messages that contains 'SCSI device (your device)'
NUM2=`expr "$NUM" - 1`
while [ "`cat /tmp/probedisk/messages | sed -n ""$NUM2"p" | grep Vendor`" = "" ]
do
NUM2=`expr "NUM2" - 1`
done
VENDOR=`cat /tmp/probedisk/messages | sed -n ""$NUM2"p" | sed -e 's/.*kernel:/:/g'`
else
VENDOR=`cat /tmp/probedisk/"$DEV" | sed -n ""$NUMLINES2"p" > /tmp/probedisk/"$DEV"-vendor`
fi
BRAND=`cat /tmp/probedisk/"$DEV"-vendor | cut -f 3 -d ':' | sed -e 's/Model//g' | sed -e 's/ *//' | tr -s ' '`
NAME=`cat /tmp/probedisk/"$DEV"-vendor | cut -f 4 -d ':' | sed -e 's/Rev//g' | sed -e 's/ *//' | tr -s ' '`
echo \/dev\/"$DEV"\|Direct-Access\|"$BRAND""$NAME" >> /tmp/probedisk/probedisk ### reorganize to output how original probedisk outputs
done
cat /tmp/probedisk/probedisk
rm -r /tmp/probedisk
Code: Select all
sh-3.00# /root/probedisk
/dev/hdc|cdrom|MATSHITADVD-ROM SR-8175
/dev/hda|disk|IC25N020ATDA04-0
/dev/sda|Direct-Access|LEXAR JD FIREFLY
sh-3.00# /root/probepart
libcfdisk: unable to open /dev/sda
/dev/hdc|iso9660|0|MATSHITADVD-ROM SR-8175
/dev/hda1|vfat|36968337|Win95 FAT32 (LBA)
/dev/hda2|swap|2086560|Linux Swap
Code: Select all
sh-3.00# probedisk
/dev/hdc|cdrom|MATSHITADVD-ROM SR-8175
/dev/hda|disk|IC25N020ATDA04-0
/dev/sda|Direct-Access|LEXAR JD FIREFLY
/dev/sdb|Direct-Access|LEXAR JD FIREFLY
Code: Select all
sh-3.00# probedisk
/dev/hda|disk|IC25N080ATMR04-0
/dev/hdc|cdrom|HL-DT-ST DVD-RW GWA-4040N
/dev/sda|Direct-Access|WD 1600JB External
/dev/sdb|Direct-Access|JetFlash TS1GJF110
/dev/sdc|Direct-Access|GENERIC USB Storage-CFC
Code: Select all
sh-3.00# probedisk
/dev/hda|disk|CF-ATA
/dev/sda|Direct-Access|SanDisk Cruzer Mini
/dev/sdb|Direct-Access|USB 2.0 Mobile Disk
sh-3.00#
sh-3.00# probedisk
/dev/hda|disk|CF-ATA
/dev/sdb|Direct-Access|USB 2.0 Mobile Disk
sh-3.00#
sh-3.00# probedisk
/dev/hda|disk|CF-ATA
/dev/sda|Direct-Access|SanDisk Cruzer Mini
/dev/sdb|Direct-Access|USB 2.0 Mobile Disk
sh-3.00#
Unfortunately, it does - no difference.plinej wrote:Does the newly updated pmount do that too?
Yes, probedisk gives the right results:plinej wrote:If not, does the modified probedisk report back correctly when pmount doesn't?
sh-3.00# probedisk
/dev/hda|disk|CF-ATA
/dev/sda|Direct-Access|SanDisk Cruzer Mini
/dev/sdb|Direct-Access|USB 2.0 Mobile Disk
sh-3.00#
sh-3.00# probedisk
/dev/hda|disk|CF-ATA
/dev/sdb|Direct-Access|USB 2.0 Mobile Disk
sh-3.00#
sh-3.00# probedisk
/dev/hda|disk|CF-ATA
/dev/sda|Direct-Access|SanDisk Cruzer Mini
/dev/sdb|Direct-Access|USB 2.0 Mobile Disk
sh-3.00#