/
usr
/
sbin
/
/usr/sbin
mkdir
upload
Name
Size
Mode
Actions
aa-load
39680
0755
edit
dl
rm
aa-remove-unknown
3225
0755
edit
dl
rm
aa-status
40000
0755
edit
dl
rm
aa-teardown
137
0755
edit
dl
rm
accessdb
14904
0755
edit
dl
rm
acpid
53920
0755
edit
dl
rm
add-shell
1053
0755
edit
dl
rm
addgnupghome
3075
0755
edit
dl
rm
addgroup
55191
0755
edit
dl
rm
adduser
55191
0755
edit
dl
rm
agetty
60992
0755
edit
dl
rm
apparmor_parser
1629848
0755
edit
dl
rm
apparmor_status
40000
0755
edit
dl
rm
applygnupgdefaults
2217
0755
edit
dl
rm
argdist-bpfcc
36862
0755
edit
dl
rm
arpd
26960
0755
edit
dl
rm
arptables
224424
0755
edit
dl
rm
arptables-nft
224424
0755
edit
dl
rm
arptables-nft-restore
224424
0755
edit
dl
rm
arptables-nft-save
224424
0755
edit
dl
rm
arptables-restore
224424
0755
edit
dl
rm
arptables-save
224424
0755
edit
dl
rm
badblocks
35144
0755
edit
dl
rm
bashreadline-bpfcc
2380
0755
edit
dl
rm
bashreadline.bt
698
0755
edit
dl
rm
bcache-super-show
14648
0755
edit
dl
rm
bindsnoop-bpfcc
16346
0755
edit
dl
rm
biolatency-bpfcc
11365
0755
edit
dl
rm
biolatency-kp.bt
664
0755
edit
dl
rm
biolatency.bt
681
0755
edit
dl
rm
biolatpcts-bpfcc
10248
0755
edit
dl
rm
biopattern-bpfcc
3957
0755
edit
dl
rm
biosdecode
27856
0755
edit
dl
rm
biosnoop-bpfcc
10833
0755
edit
dl
rm
biosnoop.bt
1148
0755
edit
dl
rm
biostacks.bt
915
0755
edit
dl
rm
biotop-bpfcc
9567
0755
edit
dl
rm
bitesize-bpfcc
1166
0755
edit
dl
rm
bitesize.bt
567
0755
edit
dl
rm
blkdeactivate
16351
0755
edit
dl
rm
blkdiscard
22912
0755
edit
dl
rm
blkid
55720
0755
edit
dl
rm
blkzone
35200
0755
edit
dl
rm
blockdev
35200
0755
edit
dl
rm
bpflist-bpfcc
2601
0755
edit
dl
rm
bpftool
1622
0755
edit
dl
rm
bridge
111096
0755
edit
dl
rm
btrfsdist-bpfcc
6627
0755
edit
dl
rm
btrfsslower-bpfcc
9985
0755
edit
dl
rm
cachestat-bpfcc
6531
0755
edit
dl
rm
cachetop-bpfcc
9367
0755
edit
dl
rm
cache_check
1430568
0755
edit
dl
rm
cache_dump
1430568
0755
edit
dl
rm
cache_metadata_size
1430568
0755
edit
dl
rm
cache_repair
1430568
0755
edit
dl
rm
cache_restore
1430568
0755
edit
dl
rm
cache_writeback
1430568
0755
edit
dl
rm
capable-bpfcc
8477
0755
edit
dl
rm
capable.bt
1926
0755
edit
dl
rm
capsh
58456
0755
edit
dl
rm
cfdisk
97008
0755
edit
dl
rm
cgdisk
170480
0755
edit
dl
rm
chcpu
31104
0755
edit
dl
rm
chgpasswd
59720
0755
edit
dl
rm
chmem
35200
0755
edit
dl
rm
chpasswd
55736
0755
edit
dl
rm
chronyd
306232
0755
edit
dl
rm
chroot
39432
0755
edit
dl
rm
cobjnew-bpfcc
53
0755
edit
dl
rm
compactsnoop-bpfcc
11369
0755
edit
dl
rm
cpgr
49608
0755
edit
dl
rm
cppw
49608
0755
edit
dl
rm
cpudist-bpfcc
7013
0755
edit
dl
rm
cpuunclaimed-bpfcc
14938
0755
edit
dl
rm
cpuwalk.bt
497
0755
edit
dl
rm
criticalstat-bpfcc
8607
0755
edit
dl
rm
cron
60080
0755
edit
dl
rm
cryptdisks_start
1544
0755
edit
dl
rm
cryptdisks_stop
844
0755
edit
dl
rm
cryptsetup
231320
0755
edit
dl
rm
ctrlaltdel
14720
0755
edit
dl
rm
dbslower-bpfcc
7391
0755
edit
dl
rm
dbstat-bpfcc
3790
0755
edit
dl
rm
dcb
82448
0755
edit
dl
rm
dcsnoop-bpfcc
4126
0755
edit
dl
rm
dcsnoop.bt
1261
0755
edit
dl
rm
dcstat-bpfcc
3859
0755
edit
dl
rm
deadlock-bpfcc
20943
0755
edit
dl
rm
debugfs
231288
0755
edit
dl
rm
delgroup
18977
0755
edit
dl
rm
deluser
18977
0755
edit
dl
rm
depmod
174328
0755
edit
dl
rm
devlink
154480
0755
edit
dl
rm
dhcpcd
404888
0755
edit
dl
rm
dirtop-bpfcc
8568
0755
edit
dl
rm
dmeventd
51592
0755
edit
dl
rm
dmidecode
138496
0755
edit
dl
rm
dmsetup
175160
0755
edit
dl
rm
dmstats
175160
0755
edit
dl
rm
dosfsck
80264
0755
edit
dl
rm
dosfslabel
39304
0755
edit
dl
rm
dpkg-preconfigure
4356
0755
edit
dl
rm
dpkg-reconfigure
4536
0755
edit
dl
rm
drsnoop-bpfcc
6889
0755
edit
dl
rm
dumpe2fs
35136
0755
edit
dl
rm
e2freefrag
18744
0755
edit
dl
rm
e2fsck
373080
0755
edit
dl
rm
e2image
43328
0755
edit
dl
rm
e2label
113216
0755
edit
dl
rm
e2mmpstatus
35136
0755
edit
dl
rm
e2scrub
7294
0755
edit
dl
rm
e2scrub_all
5394
0755
edit
dl
rm
e2undo
22840
0755
edit
dl
rm
e4crypt
31104
0755
edit
dl
rm
e4defrag
35128
0755
edit
dl
rm
ebtables
224424
0755
edit
dl
rm
ebtables-nft
224424
0755
edit
dl
rm
ebtables-nft-restore
224424
0755
edit
dl
rm
ebtables-nft-save
224424
0755
edit
dl
rm
ebtables-restore
224424
0755
edit
dl
rm
ebtables-save
224424
0755
edit
dl
rm
ebtables-translate
224424
0755
edit
dl
rm
era_check
1430568
0755
edit
dl
rm
era_dump
1430568
0755
edit
dl
rm
era_invalidate
1430568
0755
edit
dl
rm
era_restore
1430568
0755
edit
dl
rm
ethtool
667320
0755
edit
dl
rm
execsnoop-bpfcc
10059
0755
edit
dl
rm
execsnoop.bt
928
0755
edit
dl
rm
exitsnoop-bpfcc
9646
0755
edit
dl
rm
ext4dist-bpfcc
6683
0755
edit
dl
rm
ext4slower-bpfcc
9948
0755
edit
dl
rm
faillock
22848
0755
edit
dl
rm
fatlabel
39304
0755
edit
dl
rm
fdisk
117168
0755
edit
dl
rm
filefrag
18760
0755
edit
dl
rm
filegone-bpfcc
5776
0755
edit
dl
rm
filelife-bpfcc
6528
0755
edit
dl
rm
fileslower-bpfcc
7372
0755
edit
dl
rm
filetop-bpfcc
6499
0755
edit
dl
rm
findfs
14720
0755
edit
dl
rm
fixparts
59880
0755
edit
dl
rm
fsadm
24580
0755
edit
dl
rm
fsck
43440
0755
edit
dl
rm
fsck.btrfs
1185
0755
edit
dl
rm
fsck.cramfs
31168
0755
edit
dl
rm
fsck.ext2
373080
0755
edit
dl
rm
fsck.ext3
373080
0755
edit
dl
rm
fsck.ext4
373080
0755
edit
dl
rm
fsck.fat
80264
0755
edit
dl
rm
fsck.minix
55712
0755
edit
dl
rm
fsck.msdos
80264
0755
edit
dl
rm
fsck.vfat
80264
0755
edit
dl
rm
fsck.xfs
2566
0755
edit
dl
rm
fsfreeze
14720
0755
edit
dl
rm
fstab-decode
14648
0755
edit
dl
rm
fstrim
43392
0755
edit
dl
rm
funccount-bpfcc
12981
0755
edit
dl
rm
funcinterval-bpfcc
5590
0755
edit
dl
rm
funclatency-bpfcc
11549
0755
edit
dl
rm
funcslower-bpfcc
10630
0755
edit
dl
rm
gdisk
203248
0755
edit
dl
rm
genl
123472
0755
edit
dl
rm
getcap
14648
0755
edit
dl
rm
gethostlatency-bpfcc
3914
0755
edit
dl
rm
gethostlatency.bt
1222
0755
edit
dl
rm
getpcaps
14648
0755
edit
dl
rm
getty
60992
0755
edit
dl
rm
groupadd
72840
0755
edit
dl
rm
groupdel
64424
0755
edit
dl
rm
groupmems
59744
0755
edit
dl
rm
groupmod
72744
0755
edit
dl
rm
grpck
59720
0755
edit
dl
rm
grpconv
51368
0755
edit
dl
rm
grpunconv
51368
0755
edit
dl
rm
grub-bios-setup
981552
0755
edit
dl
rm
grub-install
1225824
0755
edit
dl
rm
grub-macbless
969128
0755
edit
dl
rm
grub-mkconfig
8840
0755
edit
dl
rm
grub-mkdevicemap
72384
0755
edit
dl
rm
grub-probe
977576
0755
edit
dl
rm
grub-reboot
4841
0755
edit
dl
rm
grub-set-default
3556
0755
edit
dl
rm
halt
1501304
0755
edit
dl
rm
hardirqs-bpfcc
7019
0755
edit
dl
rm
hdparm
142776
0755
edit
dl
rm
iconvconfig
35296
0755
edit
dl
rm
init
100816
0755
edit
dl
rm
inject-bpfcc
16445
0755
edit
dl
rm
insmod
174328
0755
edit
dl
rm
install-sgmlcatalog
4551
0755
edit
dl
rm
installkernel
2659
0755
edit
dl
rm
integritysetup
68672
0755
edit
dl
rm
invoke-rc.d
16517
0755
edit
dl
rm
ip
772920
0755
edit
dl
rm
ip6tables
224424
0755
edit
dl
rm
ip6tables-apply
7052
0755
edit
dl
rm
ip6tables-legacy
95176
0755
edit
dl
rm
ip6tables-legacy-restore
95176
0755
edit
dl
rm
ip6tables-legacy-save
95176
0755
edit
dl
rm
ip6tables-nft
224424
0755
edit
dl
rm
ip6tables-nft-restore
224424
0755
edit
dl
rm
ip6tables-nft-save
224424
0755
edit
dl
rm
ip6tables-restore
224424
0755
edit
dl
rm
ip6tables-restore-translate
224424
0755
edit
dl
rm
ip6tables-save
224424
0755
edit
dl
rm
ip6tables-translate
224424
0755
edit
dl
rm
iptables
224424
0755
edit
dl
rm
iptables-apply
7052
0755
edit
dl
rm
iptables-legacy
95176
0755
edit
dl
rm
iptables-legacy-restore
95176
0755
edit
dl
rm
iptables-legacy-save
95176
0755
edit
dl
rm
iptables-nft
224424
0755
edit
dl
rm
iptables-nft-restore
224424
0755
edit
dl
rm
iptables-nft-save
224424
0755
edit
dl
rm
iptables-restore
224424
0755
edit
dl
rm
iptables-restore-translate
224424
0755
edit
dl
rm
iptables-save
224424
0755
edit
dl
rm
iptables-translate
224424
0755
edit
dl
rm
irqbalance
60272
0755
edit
dl
rm
irqbalance-ui
39304
0755
edit
dl
rm
iscsi-iname
18744
0755
edit
dl
rm
iscsiadm
379320
0755
edit
dl
rm
iscsid
293432
0755
edit
dl
rm
iscsistart
281080
0755
edit
dl
rm
iscsi_discovery
5293
0755
edit
dl
rm
isosize
14720
0755
edit
dl
rm
iucode-tool
55640
0755
edit
dl
rm
iucode_tool
55640
0755
edit
dl
rm
javacalls-bpfcc
55
0755
edit
dl
rm
javaflow-bpfcc
54
0755
edit
dl
rm
javagc-bpfcc
52
0755
edit
dl
rm
javaobjnew-bpfcc
56
0755
edit
dl
rm
javastat-bpfcc
54
0755
edit
dl
rm
javathreads-bpfcc
57
0755
edit
dl
rm
kbdrate
18752
0755
edit
dl
rm
killall5
26856
0755
edit
dl
rm
killsnoop-bpfcc
4554
0755
edit
dl
rm
killsnoop.bt
873
0755
edit
dl
rm
klockstat-bpfcc
13356
0755
edit
dl
rm
kpartx
43176
0755
edit
dl
rm
kvmexit-bpfcc
11461
0755
edit
dl
rm
ldattach
27008
0755
edit
dl
rm
ldconfig
387
0755
edit
dl
rm
ldconfig.real
1051280
0755
edit
dl
rm
llcstat-bpfcc
4584
0755
edit
dl
rm
loads.bt
1127
0755
edit
dl
rm
locale-gen
4316
0755
edit
dl
rm
logrotate
96504
0755
edit
dl
rm
logsave
14496
0755
edit
dl
rm
losetup
76304
0755
edit
dl
rm
lsmod
174328
0755
edit
dl
rm
luksformat
3401
0755
edit
dl
rm
lvchange
3156712
0755
edit
dl
rm
lvconvert
3156712
0755
edit
dl
rm
lvcreate
3156712
0755
edit
dl
rm
lvdisplay
3156712
0755
edit
dl
rm
lvextend
3156712
0755
edit
dl
rm
lvm
3156712
0755
edit
dl
rm
lvmconfig
3156712
0755
edit
dl
rm
lvmdiskscan
3156712
0755
edit
dl
rm
lvmdump
10364
0755
edit
dl
rm
lvmpolld
241632
0755
edit
dl
rm
lvmsadc
3156712
0755
edit
dl
rm
lvmsar
3156712
0755
edit
dl
rm
lvreduce
3156712
0755
edit
dl
rm
lvremove
3156712
0755
edit
dl
rm
lvrename
3156712
0755
edit
dl
rm
lvresize
3156712
0755
edit
dl
rm
lvs
3156712
0755
edit
dl
rm
lvscan
3156712
0755
edit
dl
rm
lxc
589
0755
edit
dl
rm
lxd
589
0755
edit
dl
rm
make-bcache
22912
0755
edit
dl
rm
mdadm
637144
0755
edit
dl
rm
mdflush-bpfcc
2295
0755
edit
dl
rm
mdflush.bt
775
0755
edit
dl
rm
mdmon
265016
0755
edit
dl
rm
memleak-bpfcc
21298
0755
edit
dl
rm
mkdosfs
52048
0755
edit
dl
rm
mke2fs
133752
0755
edit
dl
rm
mkfs
14720
0755
edit
dl
rm
mkfs.bfs
22912
0755
edit
dl
rm
mkfs.btrfs
573752
0755
edit
dl
rm
mkfs.cramfs
35144
0755
edit
dl
rm
mkfs.ext2
133752
0755
edit
dl
rm
mkfs.ext3
133752
0755
edit
dl
rm
mkfs.ext4
133752
0755
edit
dl
rm
mkfs.fat
52048
0755
edit
dl
rm
mkfs.minix
43408
0755
edit
dl
rm
mkfs.msdos
52048
0755
edit
dl
rm
mkfs.ntfs
67976
0755
edit
dl
rm
mkfs.vfat
52048
0755
edit
dl
rm
mkfs.xfs
449528
0755
edit
dl
rm
mkhomedir_helper
22872
0755
edit
dl
rm
mkinitramfs
15762
0755
edit
dl
rm
mklost+found
14648
0755
edit
dl
rm
mkntfs
67976
0755
edit
dl
rm
mkswap
51592
0755
edit
dl
rm
ModemManager
2165576
0755
edit
dl
rm
modinfo
174328
0755
edit
dl
rm
modprobe
174328
0755
edit
dl
rm
mount.fuse
18736
0755
edit
dl
rm
mount.fuse3
18736
0755
edit
dl
rm
mount.lowntfs-3g
121832
0755
edit
dl
rm
mount.ntfs
162824
0755
edit
dl
rm
mount.ntfs-3g
162824
0755
edit
dl
rm
mountsnoop-bpfcc
14968
0755
edit
dl
rm
mpathpersist
31960
0755
edit
dl
rm
multipath
35128
0755
edit
dl
rm
multipathc
18744
0755
edit
dl
rm
multipathd
145880
0755
edit
dl
rm
mysqld
55467944
0755
edit
dl
rm
mysqld_qslower-bpfcc
3125
0755
edit
dl
rm
naptime.bt
1035
0755
edit
dl
rm
needrestart
41092
0755
edit
dl
rm
netplan
802
0755
edit
dl
rm
netqtop-bpfcc
5725
0755
edit
dl
rm
newusers
89048
0755
edit
dl
rm
nfnl_osf
18736
0755
edit
dl
rm
nfsdist-bpfcc
5068
0755
edit
dl
rm
nfsslower-bpfcc
13939
0755
edit
dl
rm
nft
26856
0755
edit
dl
rm
nginx
1314168
0755
edit
dl
rm
nodegc-bpfcc
52
0755
edit
dl
rm
nodestat-bpfcc
54
0755
edit
dl
rm
nologin
14640
0755
edit
dl
rm
ntfsclone
51592
0755
edit
dl
rm
ntfscp
31104
0755
edit
dl
rm
ntfslabel
22912
0755
edit
dl
rm
ntfsresize
63888
0755
edit
dl
rm
ntfsundelete
51592
0755
edit
dl
rm
offcputime-bpfcc
13779
0755
edit
dl
rm
offwaketime-bpfcc
15676
0755
edit
dl
rm
on_ac_power
3788
0755
edit
dl
rm
oomkill-bpfcc
2084
0755
edit
dl
rm
oomkill.bt
1198
0755
edit
dl
rm
opensnoop-bpfcc
14581
0755
edit
dl
rm
opensnoop.bt
953
0755
edit
dl
rm
overlayroot-chroot
2510
0755
edit
dl
rm
ownership
14792
0755
edit
dl
rm
pam-auth-update
21465
0755
edit
dl
rm
pam_extrausers_chkpwd
26944
2755
edit
dl
rm
pam_extrausers_update
35136
0755
edit
dl
rm
pam_getenv
2890
0755
edit
dl
rm
pam_namespace_helper
467
0755
edit
dl
rm
pam_timestamp_check
14656
0755
edit
dl
rm
parted
96664
0755
edit
dl
rm
partprobe
14720
0755
edit
dl
rm
pdata_tools
1430568
0755
edit
dl
rm
perlcalls-bpfcc
55
0755
edit
dl
rm
perlflow-bpfcc
54
0755
edit
dl
rm
perlstat-bpfcc
54
0755
edit
dl
rm
php-fpm7.4
4803376
0755
edit
dl
rm
phpcalls-bpfcc
54
0755
edit
dl
rm
phpdismod
7278
0755
edit
dl
rm
phpenmod
7278
0755
edit
dl
rm
phpflow-bpfcc
53
0755
edit
dl
rm
phpquery
6389
0755
edit
dl
rm
phpstat-bpfcc
53
0755
edit
dl
rm
pidpersec-bpfcc
1111
0755
edit
dl
rm
pidpersec.bt
628
0755
edit
dl
rm
pivot_root
14720
0755
edit
dl
rm
plymouthd
150088
0755
edit
dl
rm
poweroff
1501304
0755
edit
dl
rm
ppchcalls-bpfcc
14224
0755
edit
dl
rm
profile-bpfcc
14756
0755
edit
dl
rm
pvchange
3156712
0755
edit
dl
rm
pvck
3156712
0755
edit
dl
rm
pvcreate
3156712
0755
edit
dl
rm
pvdisplay
3156712
0755
edit
dl
rm
pvmove
3156712
0755
edit
dl
rm
pvremove
3156712
0755
edit
dl
rm
pvresize
3156712
0755
edit
dl
rm
pvs
3156712
0755
edit
dl
rm
pvscan
3156712
0755
edit
dl
rm
pwck
55592
0755
edit
dl
rm
pwconv
47272
0755
edit
dl
rm
pwhistory_helper
22848
0755
edit
dl
rm
pwunconv
47272
0755
edit
dl
rm
pythoncalls-bpfcc
57
0755
edit
dl
rm
pythonflow-bpfcc
56
0755
edit
dl
rm
pythongc-bpfcc
54
0755
edit
dl
rm
pythonstat-bpfcc
56
0755
edit
dl
rm
rdmaucma-bpfcc
5073
0755
edit
dl
rm
readahead-bpfcc
6694
0755
edit
dl
rm
readprofile
22944
0755
edit
dl
rm
reboot
1501304
0755
edit
dl
rm
remove-shell
1111
0755
edit
dl
rm
reset-trace-bpfcc
3498
0755
edit
dl
rm
resize2fs
71992
0755
edit
dl
rm
resolvconf
162480
0755
edit
dl
rm
rmmod
174328
0755
edit
dl
rm
rmt
56024
0755
edit
dl
rm
rmt-tar
56024
0755
edit
dl
rm
rsyslogd
790192
0755
edit
dl
rm
rtacct
28992
0755
edit
dl
rm
rtcwake
35200
0755
edit
dl
rm
rtmon
119312
0755
edit
dl
rm
rubycalls-bpfcc
55
0755
edit
dl
rm
rubyflow-bpfcc
54
0755
edit
dl
rm
rubygc-bpfcc
52
0755
edit
dl
rm
rubyobjnew-bpfcc
56
0755
edit
dl
rm
rubystat-bpfcc
54
0755
edit
dl
rm
runlevel
1501304
0755
edit
dl
rm
runqlat-bpfcc
9526
0755
edit
dl
rm
runqlat.bt
788
0755
edit
dl
rm
runqlen-bpfcc
8248
0755
edit
dl
rm
runqlen.bt
1037
0755
edit
dl
rm
runqslower-bpfcc
9225
0755
edit
dl
rm
runuser
55680
0755
edit
dl
rm
service
9104
0755
edit
dl
rm
setcap
14648
0755
edit
dl
rm
setuids.bt
1799
0755
edit
dl
rm
setvesablank
14712
0755
edit
dl
rm
setvtrgb
14776
0755
edit
dl
rm
sfdisk
108928
0755
edit
dl
rm
sgdisk
182768
0755
edit
dl
rm
shadowconfig
2273
0755
edit
dl
rm
shmsnoop-bpfcc
7985
0755
edit
dl
rm
shutdown
1501304
0755
edit
dl
rm
slabratetop-bpfcc
6537
0755
edit
dl
rm
sofdsnoop-bpfcc
8255
0755
edit
dl
rm
softirqs-bpfcc
5723
0755
edit
dl
rm
solisten-bpfcc
6103
0755
edit
dl
rm
sshd
921416
0755
edit
dl
rm
ssllatency.bt
2133
0755
edit
dl
rm
sslsniff-bpfcc
14013
0755
edit
dl
rm
sslsnoop.bt
2041
0755
edit
dl
rm
stackcount-bpfcc
16655
0755
edit
dl
rm
start-stop-daemon
48632
0755
edit
dl
rm
statsnoop-bpfcc
5041
0755
edit
dl
rm
statsnoop.bt
1294
0755
edit
dl
rm
sudo_logsrvd
254464
0755
edit
dl
rm
sudo_sendlog
134832
0755
edit
dl
rm
sulogin
43392
0755
edit
dl
rm
swapin.bt
600
0755
edit
dl
rm
swaplabel
18816
0755
edit
dl
rm
swapoff
22912
0755
edit
dl
rm
swapon
43392
0755
edit
dl
rm
switch_root
22912
0755
edit
dl
rm
syncsnoop-bpfcc
1300
0755
edit
dl
rm
syncsnoop.bt
839
0755
edit
dl
rm
syscount-bpfcc
8771
0755
edit
dl
rm
syscount.bt
872
0755
edit
dl
rm
sysctl
31112
0755
edit
dl
rm
tarcat
936
0755
edit
dl
rm
tc
645200
0755
edit
dl
rm
tclcalls-bpfcc
54
0755
edit
dl
rm
tclflow-bpfcc
53
0755
edit
dl
rm
tclobjnew-bpfcc
55
0755
edit
dl
rm
tclstat-bpfcc
53
0755
edit
dl
rm
tcpaccept-bpfcc
9220
0755
edit
dl
rm
tcpaccept.bt
1756
0755
edit
dl
rm
tcpcong-bpfcc
20591
0755
edit
dl
rm
tcpconnect-bpfcc
18902
0755
edit
dl
rm
tcpconnect.bt
1615
0755
edit
dl
rm
tcpconnlat-bpfcc
9285
0755
edit
dl
rm
tcpdrop-bpfcc
7616
0755
edit
dl
rm
tcpdrop.bt
2469
0755
edit
dl
rm
tcplife-bpfcc
16949
0755
edit
dl
rm
tcplife.bt
2785
0755
edit
dl
rm
tcpretrans-bpfcc
14098
0755
edit
dl
rm
tcpretrans.bt
2120
0755
edit
dl
rm
tcprtt-bpfcc
8913
0755
edit
dl
rm
tcpstates-bpfcc
14064
0755
edit
dl
rm
tcpsubnet-bpfcc
7814
0755
edit
dl
rm
tcpsynbl-bpfcc
2175
0755
edit
dl
rm
tcpsynbl.bt
962
0755
edit
dl
rm
tcptop-bpfcc
12943
0755
edit
dl
rm
tcptracer-bpfcc
18130
0755
edit
dl
rm
telinit
1501304
0755
edit
dl
rm
thin_check
1430568
0755
edit
dl
rm
thin_delta
1430568
0755
edit
dl
rm
thin_dump
1430568
0755
edit
dl
rm
thin_ls
1430568
0755
edit
dl
rm
thin_metadata_size
1430568
0755
edit
dl
rm
thin_repair
1430568
0755
edit
dl
rm
thin_restore
1430568
0755
edit
dl
rm
thin_rmap
1430568
0755
edit
dl
rm
thin_trim
1430568
0755
edit
dl
rm
threadsnoop-bpfcc
1858
0755
edit
dl
rm
threadsnoop.bt
712
0755
edit
dl
rm
tipc
92688
0755
edit
dl
rm
tplist-bpfcc
4157
0755
edit
dl
rm
trace-bpfcc
43892
0755
edit
dl
rm
ttysnoop-bpfcc
7694
0755
edit
dl
rm
tune2fs
113216
0755
edit
dl
rm
ucalls
11970
0755
edit
dl
rm
uflow
8115
0755
edit
dl
rm
ufw
4959
0755
edit
dl
rm
ugc
7823
0755
edit
dl
rm
umount.udisks2
14640
0755
edit
dl
rm
undump.bt
789
0755
edit
dl
rm
unix_chkpwd
31040
2755
edit
dl
rm
unix_update
35136
0755
edit
dl
rm
uobjnew
6181
0755
edit
dl
rm
update-ca-certificates
5446
0755
edit
dl
rm
update-catalog
9393
0755
edit
dl
rm
update-grub
64
0755
edit
dl
rm
update-grub-gfxpayload
301
0755
edit
dl
rm
update-grub2
64
0755
edit
dl
rm
update-ieee-data
3492
0755
edit
dl
rm
update-info-dir
1700
0755
edit
dl
rm
update-initramfs
6908
0755
edit
dl
rm
update-locale
3057
0755
edit
dl
rm
update-passwd
35392
0755
edit
dl
rm
update-pciids
1778
0755
edit
dl
rm
update-rc.d
18147
0755
edit
dl
rm
update-secureboot-policy
7605
0755
edit
dl
rm
update-shells
3984
0755
edit
dl
rm
update-xmlcatalog
17284
0755
edit
dl
rm
upgrade-from-grub-legacy
1596
0755
edit
dl
rm
usb_modeswitch
61096
0755
edit
dl
rm
usb_modeswitch_dispatcher
27418
0755
edit
dl
rm
useradd
143232
0755
edit
dl
rm
userdel
93192
0755
edit
dl
rm
usermod
130712
0755
edit
dl
rm
ustat
12412
0755
edit
dl
rm
uthreads
4100
0755
edit
dl
rm
uuidd
31624
0755
edit
dl
rm
validlocale
1773
0755
edit
dl
rm
vcstime
14640
0755
edit
dl
rm
vdpa
35392
0755
edit
dl
rm
veritysetup
44992
0755
edit
dl
rm
vfscount-bpfcc
1390
0755
edit
dl
rm
vfscount.bt
515
0755
edit
dl
rm
vfsstat-bpfcc
4159
0755
edit
dl
rm
vfsstat.bt
721
0755
edit
dl
rm
vgcfgbackup
3156712
0755
edit
dl
rm
vgcfgrestore
3156712
0755
edit
dl
rm
vgchange
3156712
0755
edit
dl
rm
vgck
3156712
0755
edit
dl
rm
vgconvert
3156712
0755
edit
dl
rm
vgcreate
3156712
0755
edit
dl
rm
vgdisplay
3156712
0755
edit
dl
rm
vgexport
3156712
0755
edit
dl
rm
vgextend
3156712
0755
edit
dl
rm
vgimport
3156712
0755
edit
dl
rm
vgimportclone
3156712
0755
edit
dl
rm
vgmerge
3156712
0755
edit
dl
rm
vgmknodes
3156712
0755
edit
dl
rm
vgreduce
3156712
0755
edit
dl
rm
vgremove
3156712
0755
edit
dl
rm
vgrename
3156712
0755
edit
dl
rm
vgs
3156712
0755
edit
dl
rm
vgscan
3156712
0755
edit
dl
rm
vgsplit
3156712
0755
edit
dl
rm
vigr
62144
0755
edit
dl
rm
vipw
62144
0755
edit
dl
rm
virtiostat-bpfcc
8900
0755
edit
dl
rm
visudo
258776
0755
edit
dl
rm
vpddecode
14928
0755
edit
dl
rm
wakeuptime-bpfcc
8291
0755
edit
dl
rm
wipefs
39296
0755
edit
dl
rm
writeback.bt
1699
0755
edit
dl
rm
xfsdist-bpfcc
4723
0755
edit
dl
rm
xfsdist.bt
972
0755
edit
dl
rm
xfsslower-bpfcc
7964
0755
edit
dl
rm
xfs_admin
2174
0755
edit
dl
rm
xfs_bmap
695
0755
edit
dl
rm
xfs_copy
92608
0755
edit
dl
rm
xfs_db
705088
0755
edit
dl
rm
xfs_estimate
14504
0755
edit
dl
rm
xfs_freeze
800
0755
edit
dl
rm
xfs_fsr
43192
0755
edit
dl
rm
xfs_growfs
39152
0755
edit
dl
rm
xfs_info
1294
0755
edit
dl
rm
xfs_io
208536
0755
edit
dl
rm
xfs_logprint
80144
0755
edit
dl
rm
xfs_mdrestore
35048
0755
edit
dl
rm
xfs_metadump
816
0755
edit
dl
rm
xfs_mkfile
1040
0755
edit
dl
rm
xfs_ncheck
685
0755
edit
dl
rm
xfs_quota
92328
0755
edit
dl
rm
xfs_repair
658760
0755
edit
dl
rm
xfs_rtcp
18584
0755
edit
dl
rm
xfs_scrub
108816
0755
edit
dl
rm
xfs_scrub_all
7841
0755
edit
dl
rm
xfs_spaceman
43320
0755
edit
dl
rm
xtables-legacy-multi
95176
0755
edit
dl
rm
xtables-monitor
224424
0755
edit
dl
rm
xtables-nft-multi
224424
0755
edit
dl
rm
zerofree
14488
0755
edit
dl
rm
zfsdist-bpfcc
5427
0755
edit
dl
rm
zfsslower-bpfcc
8657
0755
edit
dl
rm
zic
67984
0755
edit
dl
rm
zramctl
55824
0755
edit
dl
rm
Edit:
/usr/sbin/usb_modeswitch_dispatcher
(27418B)
#!/usr/bin/tclsh # Wrapper (tcl) for usb_modeswitch, called from # /lib/udev/rules.d/40-usb_modeswitch.rules # (part of data pack "usb-modeswitch-data") via # /lib/udev/usb_modeswitch # # Does ID check on newly discovered USB devices and calls # the mode switching program with the matching parameter # file from /usr/share/usb_modeswitch # # Part of usb-modeswitch-2.6.1 package, 2020/07/10 # (C) Josua Dietze 2009 - 2020 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details: # # http://www.gnu.org/licenses/gpl.txt set arg0 [lindex $argv 0] if [regexp {\.tcl$} $arg0] { if [file exists $arg0] { set argv [lrange $argv 1 end] source $arg0 exit } } # Setting of these switches is done in the global config # file (/etc/usb_modeswitch.conf) if available set flags(logging) 0 set flags(noswitching) 0 set flags(stordelay) 0 set flags(nombim) 0 set flags(logwrite) 0 # also settable in device config files set flags(nombim) 0 set flags(althuawei) 0 # Execution starts at file bottom proc {Main} {argv argc} { global scsi usb config match device flags setup devdir loginit set flags(config) "" # arg0: optional custom location of configuration file # arg1: the "kernel name" for the device to switch (udev: %k) # The parameter "bus id" for the device (udev: %b) is now deprecated # # From version 2.5.0 upward %b is removed by udev sh script # which can handle old and new udev params ('%b/%k' and '%k') Log "Raw parameters: $argv" set device "noname" set arg0 "" for {set i 0} {$i < [llength $argv]} {incr i} { set option [lindex $argv $i] switch -glob -- $option { "--config-file" { if [regexp {config-file=(\"[^\"]+\"|[^ ]+)} $option d param] { set arg0 [string trim $param {"}] } else { set arg0 [lindex $argv $i+1] } } "--switch-mode" { if [regexp {switch-mode=(.+)} $option d param] { set arg1 $param } else { set arg1 [lindex $argv $i+1] } } } } Log "[ParseGlobalConfig $arg0]" set flags(logwrite) 1 # The facility to add a symbolic link pointing to the # ttyUSB port which provides interrupt transfer, i.e. # the port to connect through. # Will check for interrupt endpoint in ttyUSB port (lowest if # there is more than one); if found, return "gsmmodem[n]" name # to udev for symlink creation # This is run once for every port of LISTED devices by # a udev rule if {[lindex $argv 0] == "--symlink-name"} { puts -nonewline [SymLinkName [lindex $argv 1]] SafeExit } if {$flags(stordelay) > 0} { SetStorageDelay $flags(stordelay) } if [info exists arg1] { if {[string length $arg1] == 0} { ShowUsage Log "\nNo device provided for mode-switching. Exit" SafeExit } } else { ShowUsage Log "\nNo command option given. Exit" SafeExit } if {![regexp {(.*?):.*$} $arg1 d device]} { if {![regexp {([0-9]+-[0-9]+\.?[0-9]*.*)} $arg1 d device]} { ShowUsage Log "Could not determine device dir from udev values! Exit" SafeExit } } set setup(dbdir) /usr/share/usb_modeswitch set setup(dbdir_etc) /etc/usb_modeswitch.d if {![file exists $setup(dbdir)] && ![file exists $setup(dbdir_etc)]} { Log "\nError: no config database found in /usr/share or /etc. Exit" SafeExit } set bindir /usr/sbin set devList1 {} set devList2 {} set ifChk 0 set devdir /sys/bus/usb/devices/$device if {![file isdirectory $devdir]} { Log "Top device directory not found ($devdir)! Exit" SafeExit } Log "Use top device dir $devdir" set iface 0 Log "Check class of first interface ..." set config(class) [IfClass 0 $devdir] if {$config(class) < 0} { Log " No access to first interface. Exit" SafeExit } Log " Interface class is $config(class)." set ifdir [file tail [IfDir $iface $devdir]] regexp {:([0-9]+\.[0-9]+)$} $ifdir d iface # Mapping of the short string identifiers (in the config # file names) to the long name used here # # If we need them it's a snap to add new attributes here! set match(sVe) scsi(vendor) set match(sMo) scsi(model) set match(sRe) scsi(rev) set match(uMa) usb(manufacturer) set match(uPr) usb(product) set match(uSe) usb(serial) # Now reading the USB attributes if {![ReadUSBAttrs $devdir]} { Log "USB attributes not found in sysfs tree. Exit" SafeExit } set config(vendor) $usb(idVendor) set config(product) $usb(idProduct) if $flags(logging) { Log "\n----------------\nUSB values from sysfs:" foreach attr {manufacturer product serial} { Log " $attr\t$usb($attr)" } Log "----------------" } if $flags(noswitching) { SysLog "usb_modeswitch: switching disabled, no action for $usb(idVendor):$usb(idProduct)" Log "\nSwitching globally disabled. Exit" SafeExit } if {$usb(bNumConfigurations) == "1"} { set configParam "-u -1" Log "bNumConfigurations is 1 - don't check for active configuration" } else { set configParam "" } # Check (and switch) for operating system if Huawei device present set flags(os) "linux" if {$usb(idVendor) == "12d1" && [regexp -nocase {android} [exec cat /proc/version]]} { set flags(os) "android" } if {$flags(os) == "android"} { set configList [ConfigGet conflist $usb(idVendor):#android] } else { set configList [ConfigGet conflist $usb(idVendor):$usb(idProduct)] } if {[llength $configList] == 0} { Log "Aargh! Config file missing for $usb(idVendor):$usb(idProduct)! Exit" SafeExit } Log "ConfigList: $configList" # Check if there is more than one config file for this USB ID, # which would make an attribute test necessary. If so, check if # SCSI values are needed set scsiNeeded 0 if {[llength $configList] > 1} { if [regexp {:s} $configList] { set scsiNeeded 1 } } if $scsiNeeded { if [ReadSCSIAttrs $devdir:$iface] { Log "----------------\nSCSI values from sysfs:" foreach attr {vendor model rev} { Log " $attr\t$scsi($attr)" } Log "----------------" } else { Log "Could not get SCSI attributes, exclude devices with SCSI match" } } else { Log "SCSI attributes not needed, move on" } # Now check for a matching config file. Matching is done # by MatchDevice set report "" foreach mconfig $configList { # skipping installer leftovers like "*.rpmnew" if [regexp {\.(dpkg|rpm)} $mconfig] {continue} Log "Check config: $mconfig" if [MatchDevice $mconfig] { Log "! matched. Read config data" set flags(config) [ConfigGet conffile $mconfig] break } else { Log "* no match, don't use this config" } } if {$flags(config) == ""} { Log "No matching config file found. Exit" SafeExit } ParseDeviceConfig $flags(config) if [regexp -nocase {0x([0-9a-f]+)} $config(TargetClass) d tc] { if {$tc == $config(class)} { Log "Class of interface 0 matches target. Do nothing" set report "ok:busdev" } } if [string length $usb(busnum)] { set busParam "-b [string trimleft $usb(busnum) 0]" set devParam "-g [string trimleft $usb(devnum) 0]" } else { set busParam "" set devParam "" } if [regexp -nocase $flags(os) $flags(config)] { Log "Note: Using generic manufacturer configuration for \"$flags(os)\"" } if $flags(althuawei) { regsub {HuaweiNewMode} $flags(config) {HuaweiAltMode} flags(config) Log "Alternative Huawei mode set globally, modify config" } if $flags(nombim) { set config(NoMBIMCheck) 1 } if {$config(NoMBIMCheck)==0 && $usb(bNumConfigurations) > 1} { Log "Device may have an MBIM configuration, check driver ..." if [CheckMBIM] { Log " driver for MBIM devices is available" Log "Find MBIM configuration number ..." if [catch {set cfgno [exec /usr/sbin/usb_modeswitch -j -Q $busParam $devParam -v $usb(idVendor) -p $usb(idProduct)]} err] { Log "Error when trying to find MBIM configuration, switch to legacy modem mode" } else { set cfgno [string trim $cfgno] if {$cfgno > 0} { set config(Configuration) $cfgno set flags(config) "Configuration=$cfgno" } else { Log " No MBIM configuration found, switch to legacy modem mode" } } } else { Log " no MBIM driver found, switch to legacy modem mode" } } if [PantechAutoSwitch] { Log "Waiting for Pantech auto-modeswitch" set report "ok:busdev" } if {$config(Configuration) == 0} { Log "Config file contains dummy method, do nothing. Exit" SafeExit } # General wait - some devices need this after 500 if {$config(WaitBefore) != ""} { Log "Delay time of $config(WaitBefore) seconds" append config(WaitBefore) "000" after $config(WaitBefore) } if {$report == ""} { # Now we are actually switching if $flags(logging) { Log "Command line:\nusb_modeswitch -W -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f \$flags(config)" catch {set report [exec /usr/sbin/usb_modeswitch -W -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f "$flags(config)" 2>@1]} report Log "\nVerbose debug output of usb_modeswitch and libusb follows" Log "(Note that some USB errors are to be expected in the process)" Log "--------------------------------" Log $report Log "--------------------------------" Log "(end of usb_modeswitch output)\n" } else { catch {set report [exec /usr/sbin/usb_modeswitch -Q -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f "$flags(config)" 2>@1]} report } } # Switching is complete; success checking was either # done by usb_modeswitch and logged via syslog OR bus/dev # parameter were used; then we do check for success HERE if {$config(Configuration) != ""} { set ifdir [regsub {(\d):\d+\.0} $ifdir "\\1:$config(Configuration).0"] } if [regexp {ok:busdev} $report] { if [CheckSuccess $devdir] { Log "Mode switching was successful, found $usb(idVendor):$usb(idProduct) ($usb(manufacturer): $usb(product))" SysLog "usb_modeswitch: switched to $usb(idVendor):$usb(idProduct) on [format %03d $usb(busnum)]/[format %03d $usb(devnum)]" } else { Log "\nTarget config not matching - current values are" LogAttributes Log "\nMode switching may have failed. Exit" SafeExit } } else { if {![file isdirectory $devdir]} { Log "Device directory in sysfs is gone! Something went wrong, abort" SafeExit } if {![regexp {ok:} $report]} { Log "\nCore program reported switching failure. Exit" SafeExit } # Give the device another second if it's not fully back yet if {![file exists $devdir/idProduct]} { after 1000 } ReadUSBAttrs $devdir $ifdir } # driver binding removed !! if {[string length "$usb(idVendor)$usb(idProduct)"] < 8} { if {![regexp {ok:(\w{4}):(\w{4})} $report d usb(idVendor) usb(idProduct)]} { Log "No target vendor/product ID found or given, can't continue. Abort" SafeExit } } # wait for drivers to bind after 500 if {[llength [glob -nocomplain $devdir/$ifdir/ttyUSB*]] > 0} { Log "Serial USB driver bound to interface 0\n will try to guess and symlink modem port on next connect" AddToList link_list $usb(idVendor):$usb(idProduct) } # In newer kernels there is a switch to avoid the use of a device # reset (e.g. from usb-storage) which would possibly switch back # a mode-switching device to initial mode if [regexp {ok:} $report] { Log "Check for AVOID_RESET_QUIRK kernel attribute" if [file exists $devdir/avoid_reset_quirk] { if [catch {exec echo "1" >$devdir/avoid_reset_quirk 2>/dev/null} err] { Log " Error setting the attribute: $err" } else { Log " AVOID_RESET_QUIRK activated" } } else { Log " not present in this kernel" } } Log "\nAll done, exit\n" SafeExit } # end of proc {Main} proc {ReadSCSIAttrs} {topdir} { global scsi set counter 0 set sysdir $topdir Log "Check storage tree in sysfs ..." while {$counter < 20} { Log " loop $counter/20" if {![file isdirectory $sysdir]} { # Device is gone. Unplugged? Switched by kernel? Log " sysfs device tree is gone; abort SCSI value check" return 0 } # Searching the storage/SCSI tree; might take a while if {[set dirList [glob -nocomplain $topdir/host*]] != ""} { set sysdir [lindex $dirList 0] if {[set dirList [glob -nocomplain $sysdir/target*]] != ""} { set sysdir [lindex $dirList 0] regexp {.*target(.*)} $sysdir d subdir if {[set dirList [glob -nocomplain $sysdir/$subdir*]] != ""} { set sysdir [lindex $dirList 0] if [file exists $sysdir/vendor] { Log " Storage tree is ready" break } } } } after 500 incr counter } if {$counter == 20} { Log "SCSI tree not found; you may want to check if this path/file exists:" Log "$sysdir/vendor\n" return 0 } Log "Read SCSI values ..." foreach attr {vendor model rev} { if [file exists $sysdir/$attr] { set rc [open $sysdir/$attr r] set scsi($attr) [read -nonewline $rc] close $rc } else { set scsi($attr) "" Log "Warning: SCSI attribute \"$attr\" not found." } } return 1 } # end of proc {ReadSCSIAttrs} proc {ReadUSBAttrs} {dir args} { global usb set attrList {idVendor idProduct bConfigurationValue manufacturer product serial devnum busnum bNumConfigurations} set mandatoryList {idVendor idProduct bNumConfigurations} set result 1 if {$args != ""} { lappend attrList "$args/bInterfaceClass" lappend mandatoryList "$args/bInterfaceClass" } foreach attr $attrList { if [file exists $dir/$attr] { set rc [open $dir/$attr r] set usb($attr) [string trim [read -nonewline $rc]] close $rc } else { set usb($attr) "" if {[lsearch $mandatoryList $attr] > -1} { set result 0 } if {$attr == "serial"} {continue} Log " Warning: USB attribute \"$attr\" not found" } } return $result } # end of proc {ReadUSBAttrs} proc {MatchDevice} {config} { global scsi usb match set devinfo [file tail $config] set infoList [split $devinfo :] set stringList [lrange $infoList 2 end] if {[llength $stringList] == 0} {return 1} foreach teststring $stringList { if {$teststring == "?"} {return 0} set tokenList [split $teststring =] set id [lindex $tokenList 0] set matchstring [lindex $tokenList 1] set blankstring "" regsub -all {_} $matchstring { } blankstring Log "match $match($id)" Log " string1 (exact): $matchstring" Log " string2 (blanks): $blankstring" Log " device string: [set $match($id)]" if {!([string match *$matchstring* [set $match($id)]] || [string match *$blankstring* [set $match($id)]])} { return 0 } } return 1 } # end of proc {MatchDevice} proc {ParseGlobalConfig} {path} { global flags set configFile "" if [string length $path] { set places [list $path] } else { set places [list /etc/usb_modeswitch.conf /etc/sysconfig/usb_modeswitch /etc/default/usb_modeswitch] } foreach cfg $places { if [file exists $cfg] { set configFile $cfg break } } if {$configFile == ""} {return "No configuration file found, using defaults"} set rc [open $configFile r] while {![eof $rc]} { gets $rc line if [regexp {^#} [string trim $line]] {continue} if [regexp {DisableMBIMGlobal\s*=\s*([^\s]+)} $line d val] { set flags(nombim) [regexp -nocase {1|yes|true} $val] } if [regexp {DisableSwitching\s*=\s*([^\s]+)} $line d val] { set flags(noswitching) [regexp -nocase {1|yes|true} $val] } if [regexp {EnableLogging\s*=\s*([^\s]+)} $line d val] { set flags(logging) [regexp -nocase {1|yes|true} $val] } if [regexp {SetStorageDelay\s*=\s*([^\s]+)} $line d val] { if [regexp {\d+} $val] { set flags(stordelay) $val } } if [regexp {HuaweiAltModeGlobal\s*=\s*([^\s]+)} $line d val] { set flags(althuawei) [regexp -nocase {1|yes|true} $val] } } return "Use global config file: $configFile" } # end of proc {ParseGlobalConfig} proc ParseDeviceConfig {cfg} { global config set config(WaitBefore) "" set config(TargetVendor) "" set config(TargetProduct) "" set config(TargetClass) "" set config(Configuration) "" set config(NoMBIMCheck) 0 set config(PantechMode) 0 set config(CheckSuccess) 20 foreach pname [lsort [array names config]] { if [regexp -line "^\[^# \]*?$pname.*?= *(0x(\\w+)|\"(\[0-9a-fA-F,\]+)\"|(\[0-9\]+)) *\$" $cfg d config($pname)] { # Log "config: $pname set to $config($pname)" } } set config(WaitBefore) [string trimleft $config(WaitBefore) 0] } # end of proc {ParseDeviceConfig} proc ConfigGet {command config} { global setup usb flags switch $command { conflist { # Unpackaged configs first; sorting is essential for priority set configList [lsort -decreasing [glob -nocomplain $setup(dbdir_etc)/$config*]] set configList [concat $configList [lsort -decreasing [glob -nocomplain $setup(dbdir)/$config*]]] eval lappend configList [glob -nocomplain $setup(dbdir)/$usb(idVendor):#$flags(os)] if [file exists $setup(dbdir)/configPack.tar.gz] { Log "Found packed config collection $setup(dbdir)/configPack.tar.gz" if [catch {set packedList [exec tar -tzf $setup(dbdir)/configPack.tar.gz 2>/dev/null]} err] { Log "Error: problem opening config package; tar returned\n $err" return {} } set packedList [split $packedList \n] set packedConfigList [lsort -decreasing [lsearch -glob -all -inline $packedList $config*]] lappend packedConfigList [lsearch -inline $packedList $usb(idVendor):#$flags(os)] # Now add packaged configs with a mark, again sorted for priority foreach packedConfig $packedConfigList { lappend configList "pack/$packedConfig" } } return $configList } conffile { if [regexp {^pack/} $config] { set config [regsub {pack/} $config {}] Log "Extract config $config from collection $setup(dbdir)/configPack.tar.gz" set configContent [exec tar -xzOf $setup(dbdir)/configPack.tar.gz $config 2>/dev/null] } else { if [regexp [list $setup(dbdir_etc)] $config] { Log "Use config file from override folder $setup(dbdir_etc)" SysLog "usb_modeswitch: use overriding config file $config; make sure this is intended" SysLog "usb_modeswitch: please report any new or corrected settings; otherwise, check for outdated files" } set rc [open $config r] set configContent [read $rc] close $rc } return $configContent } } } # end of proc {ConfigGet} proc {Log} {msg} { global flags device loginit if {$flags(logwrite) == 0} {append loginit $msg\n} if {$flags(logging) == 0} {return} if $flags(logwrite) { if [string length $loginit] { exec echo "\nUSB_ModeSwitch log from [clock format [clock seconds]]" >/var/log/usb_modeswitch_$device exec echo "$loginit" >>/var/log/usb_modeswitch_$device set loginit "" } exec echo $msg >>/var/log/usb_modeswitch_$device } else { append loginit "\n$msg" } } # end of proc {Log} # Writing the log file and exit proc {SafeExit} {} { global flags set flags(logwrite) 1 Log "" exit } # end of proc {SafeExit} proc {SymLinkName} {path} { global device flags proc {hasInterrupt} {ifDir} { if {[llength [glob -nocomplain $ifDir/ttyUSB*]] == 0} { Log " no ttyUSB interface - skip endpoint check" return 0 } foreach epDir [glob -nocomplain $ifDir/ep_*] { set e [file tail $epDir] Log " check $e ..." if [file exists $epDir/type] { set rc [open $epDir/type r] set type [read $rc] close $rc if [regexp {Interrupt} $type] { Log " $e has interrupt transfer type" return 1 } } } return 0 } # In case the device path is returned as /class/tty/ttyUSB, # get the USB device path from linked tree "device" set linkpath /sys$path/device if [file exists $linkpath] { if {[file type $linkpath] == "link"} { set rawpath [file readlink $linkpath] set trimpath [regsub -all {\.\./} $rawpath {}] if [file isdirectory /sys/$trimpath] { append loginit "\n Use path $path\n" set path /$trimpath } } } if {![regexp {([0-9]+-[0-9]+[\.0-9]*:[^/]*).*(ttyUSB[0-9]+)} $path d myDev myPort]} { if $flags(logging) { set device [clock clicks] Log "This is not a ttyUSB port. Abort" } return "" } set device ttyUSB_$myDev set flags(logwrite) 1 Log "My name is $myPort\n" if {![regexp {(.*?[0-9]+)\.([0-9]+)/ttyUSB} /sys$path d ifRoot ifNum]} { Log "Could not find interface in path\n $path. Abort" return "" } set ifDir $ifRoot.$ifNum Log "Check my endpoints ...\n in $ifDir" if [hasInterrupt $ifDir] { Log "\n--> I am an interrupt port" set rightPort 1 } else { Log "\n--> I am not an interrupt port\n" set rightPort 0 } # There are devices with more than one interrupt interface. # Assume that the lowest of these is usable. Check all # possible lower interfaces if { $rightPort && ($ifNum > 0) } { Log "\nLook for lower ports with interrupt endpoints" for {set i 0} {$i < $ifNum} {incr i} { set ifDir $ifRoot.$i Log " in ifDir $ifDir ..." if [hasInterrupt $ifDir] { Log "\n--> found an interrupt interface below me\n" set rightPort 0 break } } } if {$rightPort == 0} { Log "Return empty name and exit" return "" } Log "\n--> No interrupt interface below me\n" cd /dev set idx 2 set symlinkName "gsmmodem" while {$idx < 256} { if {![file exists $symlinkName]} { set placeholder [open /dev/$symlinkName w] close $placeholder break } set symlinkName gsmmodem$idx incr idx } if {$idx == 256} {return ""} Log "Return symlink name \"$symlinkName\" and exit" return $symlinkName } # end of proc {SymLinkName} # Add USB ID to list of devices needing later treatment proc {AddToList} {name id} { set listfile /var/lib/usb_modeswitch/$name if [file exists $listfile] { set rc [open $listfile r] set buffer [read $rc] close $rc if [string match *$id* $buffer] { return } set idList [split [string trim $buffer] \n] } lappend idList $id set buffer [join $idList "\n"] if [catch {set lc [open $listfile w]}] {return} puts $lc $buffer close $lc } # end of proc {AddToList} proc {CheckSuccess} {devdir} { global config usb flags # For Cisco AM10, target device not on same port if {$usb(idVendor) == "1307" && $usb(idProduct) == "1169"} { set devdir [string range $devdir 0 end-1]2 } set ifdir [file tail [IfDir 0 $devdir]] if {[string length $config(TargetClass)] || [string length $config(Configuration)]} { set config(TargetVendor) $usb(idVendor) set config(TargetProduct) $usb(idProduct) } Log "Check success of mode switch for max. $config(CheckSuccess) seconds ..." set expected 1 for {set i 1} {$i <= $config(CheckSuccess)} {incr i} { after 1000 if {![file isdirectory $devdir]} { Log " Wait for device file system ($i sec.) ..." continue } else { Log " Read attributes ..." } set ifdir [IfDir 0 $devdir] if {$ifdir == ""} {continue} set ifdir [file tail $ifdir] if {![ReadUSBAttrs $devdir $ifdir]} { Log " Essential attributes are missing, continue wait ..." continue } if [string length $config(Configuration)] { if {$usb(bConfigurationValue) != $config(Configuration)} {continue} } if [string length $config(TargetClass)] { if {![regexp -nocase $usb($ifdir/bInterfaceClass) $config(TargetClass)]} { if {$config(class) != $usb($ifdir/bInterfaceClass} { set expected 0 } else {continue} } } if {![regexp -nocase $usb(idVendor) $config(TargetVendor)]} { if {![regexp -nocase $usb(idVendor) $config(vendor)]} { set expected 0 } else {continue} } if {![regexp -nocase $usb(idProduct) $config(TargetProduct)]} { if {![regexp -nocase $usb(idProduct) $config(product)]} { set expected 0 } else {continue} } # Arriving here means that device attributes have changed if $expected { Log " All attributes matched" } else { if [regexp -nocase {/[0-9a-f]+:#} $flags(config)] { Log " idProduct has changed after generic mode-switch, assume success" } else { if [regexp {HuaweiAltMode} $flags(config)] { Log " Alternative target attributes found, assume success" } else { Log " Attributes are different but target values are unexpected:" LogAttributes } } } break } if {$i > 20} {return 0} else {return 1} } # end of proc {CheckSuccess} proc {IfDir} {iface devdir} { set files [glob -nocomplain $devdir/*] set iffiles [lsort [lsearch -all -inline -regexp $files {^.*/[^/]*[0-9]+\.[0-9]$}]] set sorted [concat $iffiles [lsort [lsearch -all -inline -regexp $files {^.*/[^/]*[0-9]+\.[0-9][0-9]$}]]] if {[llength $sorted] == 0} { return "" } set ifdir [lindex $sorted $iface] if {![string length $ifdir] || ![file isdirectory $ifdir]} { return "" } return $ifdir } # end of proc {IfDir} proc {IfClass} {iface devdir} { set ifdir [IfDir $iface $devdir] if {![file exists $ifdir/bInterfaceClass]} { return -1 } set rc [open $ifdir/bInterfaceClass r] set c [read $rc] close $rc return [string trim $c] } # end of proc {IfClass} proc {ShowUsage} {} { puts "Dispatcher for 'usb_modeswitch'; usually run by udev, not intended for interactive operation" puts "Usage: usb_modeswitch_dispatcher [--config-file=<path>] --switch-mode=<device kernel name>" puts " usb_modeswitch_dispatcher --symlink-name=<sys path to device>" } # end of proc {ShowUsage} proc {SysLog} {msg} { global flags if {![info exists flags(logger)]} { set flags(logger) "" foreach fn {/bin/logger /usr/bin/logger} { if [file exists $fn] { set flags(logger) $fn } } Log "Logger is $flags(logger)" } if {$flags(logger) == ""} { Log "Can't add system message, no syslog helper found" return } catch {exec $flags(logger) -p syslog.notice "$msg" 2>/dev/null} } # end of proc {SysLog} proc {SetStorageDelay} {secs} { Log "Adjust delay for USB storage devices ..." set attrib /sys/module/usb_storage/parameters/delay_use if {![file exists $attrib]} { Log "Error: could not find delay_use attribute" return } if [catch {set ch [open $attrib r+]} err] { Log "Error: could not access delay_use attribute: $err" return } if {[read $ch] < $secs} { seek $ch 0 start puts -nonewline $ch $secs Log " Delay set to $secs seconds\n" } else { Log " Current value is higher than $secs. Leave it alone\n" } close $ch } # end of proc {SetStorageDelay} proc {CheckMBIM} {} { set kversion [exec uname -r] if [llength [glob -nocomplain /lib/modules/$kversion/kernel/drivers/net/usb/cdc_mbim*]] {return 1} if [file exists /sys/bus/usb/drivers/cdc_mbim] {return 1} return 0 } # end of proc {CheckMBIM} proc {CheckQMI} {} { set kversion [exec uname -r] if [llength [glob -nocomplain /lib/modules/$kversion/kernel/drivers/net/usb/qmi_wwan*]] {return 1} if [file exists /sys/bus/usb/drivers/cdc_mbim] {return 1} return 0 } # end of proc {CheckQMI} proc {PantechAutoSwitch} {} { global config flags if {$config(PantechMode) == 3} {return 1} if {$config(PantechMode) == 1} { if {"$config(vendor):$config(product)" == "10a9:6080"} { set flags(config) [regsub {PantechMode *= *1} $flags(config) "PantechMode=2"] Log " PantechMode changed to 2" return 0 } elseif [CheckQMI] { set flags(config) [regsub {PantechMode *= *1} $flags(config) "PantechMode=4"] Log " PantechMode changed to 4" return 0 } else { return 1 } } else {return 0} } # end of proc {PantechAutoSwitch} proc {LogAttributes} {} { global flags usb if $flags(logging) { set attrList {idVendor idProduct bConfigurationValue manufacturer product serial} foreach attr [lsort [array names usb]] { Log " [format %-26s $attr:] $usb($attr)" } } } # end of proc {LogAttributes} proc {HasFF} {devdir} { set i 0 while {[set dir [IfDir $i $devdir]] != ""} { set c [exec cat $dir/bInterfaceClass] if {$c == "ff"} {return 1} incr i } return 0 } # end of proc {HasFF} # The actual entry point Main $argv $argc
Save
cmd:
run