* [Buildroot] udevadm: missing or unknown command
@ 2015-07-27 18:55 Steve Kenton
2015-07-28 2:11 ` Nimai Mahajan
0 siblings, 1 reply; 2+ messages in thread
From: Steve Kenton @ 2015-07-27 18:55 UTC (permalink / raw)
To: buildroot
I have an (x86) application where the end users can hot plug disks drives.
Since I have no control over what they put where, labels etc are of limited use
so I switched from mdev to eudev so I could match the actual SATA port in use
These rules added to a file in /etc/udev/rules.d seem to do the trick
# Bind the drive names to the physical port they connect too - udev no longer allow renaming device nodes so set up HDi* symlinks instead
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDia%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDib%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDie%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDif%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDic%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata6/host5/target5:0:0/5:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDid%n"
They create the symlinks I was wanting and which do indeed track the SATA cables regardless of the order the drives are plugged
$ ls -l /dev/H*
lrwxrwxrwx 1 root root 3 Jul 27 13:38 /dev/HDia -> sda
lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDia1 -> sda1
lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDia2 -> sda2
lrwxrwxrwx 1 root root 3 Jul 27 13:38 /dev/HDib -> sdb
lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDib1 -> sdb1
lrwxrwxrwx 1 root root 3 Jul 27 13:38 /dev/HDic -> sdc
lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDic1 -> sdc1
lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDic2 -> sdc2
lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDic5 -> sdc5
However, when I try to run udevadm - which does exist:
$ ls -l /sbin/udevadm
lrwxrwxrwx 1 root root 16 Jul 27 10:55 sbin/udevadm -> /usr/bin/udevadm
$ ls -l /usr/bin/udevadm
-rwxr-xr-x 1 root root 253568 Jul 27 12:38 usr/bin/udevadm
And appears to be a valid executable file
$ file udevadm
udevadm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
I get this message
$ ./udevadm
udevadm: missing or unknown command
Missing dependency Somewhere maybe? Anyone have a clue? Because I'm stuck.
Thanks, Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Buildroot] udevadm: missing or unknown command
2015-07-27 18:55 [Buildroot] udevadm: missing or unknown command Steve Kenton
@ 2015-07-28 2:11 ` Nimai Mahajan
0 siblings, 0 replies; 2+ messages in thread
From: Nimai Mahajan @ 2015-07-28 2:11 UTC (permalink / raw)
To: buildroot
Steve Kenton <skenton@...> writes:
>
> I have an (x86) application where the end
users can hot plug disks drives.
> Since I have no control over what they put
where, labels etc are of limited use
> so I switched from mdev to eudev so I could
match the actual SATA port in use
> These rules added to a file in
/etc/udev/rules.d seem to do the trick
>
> # Bind the drive names to the physical port
they connect too - udev no longer allow renaming
device nodes so
> set up HDi* symlinks instead
>
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata1/
host0/target0:0:0/0:0:0:0/block/sd*",
> ENV{ID_TYPE}=="disk", SYMLINK+="HDia%n"
>
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata2/
host1/target1:0:0/1:0:0:0/block/sd*",
> ENV{ID_TYPE}=="disk", SYMLINK+="HDib%n"
>
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata3/
host2/target2:0:0/2:0:0:0/block/sd*",
> ENV{ID_TYPE}=="disk", SYMLINK+="HDie%n"
>
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata4/
host3/target3:0:0/3:0:0:0/block/sd*",
> ENV{ID_TYPE}=="disk", SYMLINK+="HDif%n"
>
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata5/
host4/target4:0:0/4:0:0:0/block/sd*",
> ENV{ID_TYPE}=="disk", SYMLINK+="HDic%n"
>
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata6/
host5/target5:0:0/5:0:0:0/block/sd*",
> ENV{ID_TYPE}=="disk", SYMLINK+="HDid%n"
>
> They create the symlinks I was wanting and
which do indeed track the SATA cables regardless
of the order the
> drives are plugged
>
> $ ls -l /dev/H*
> lrwxrwxrwx 1 root root 3 Jul 27 13:38
/dev/HDia -> sda
> lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDia1 -> sda1
> lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDia2 -> sda2
> lrwxrwxrwx 1 root root 3 Jul 27 13:38
/dev/HDib -> sdb
> lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDib1 -> sdb1
> lrwxrwxrwx 1 root root 3 Jul 27 13:38
/dev/HDic -> sdc
> lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDic1 -> sdc1
> lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDic2 -> sdc2
> lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDic5 -> sdc5
>
> However, when I try to run udevadm - which
does exist:
>
> $ ls -l /sbin/udevadm
> lrwxrwxrwx 1 root root 16 Jul 27 10:55
sbin/udevadm -> /usr/bin/udevadm
>
> $ ls -l /usr/bin/udevadm
> -rwxr-xr-x 1 root root 253568 Jul 27 12:38
usr/bin/udevadm
>
> And appears to be a valid executable file
>
> $ file udevadm
> udevadm: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), dynamically linked (uses
shared libs), for
> GNU/Linux 2.6.32, stripped
>
> I get this message
>
> $ ./udevadm
> udevadm: missing or unknown command
I believe this is just a simple case of udevadm
requiring a command. Try udevadm monitor.
Missing or unknown command is obviously not the
clearest error message; it should really just
print out standard usage.
Nimai
>
> Missing dependency Somewhere maybe? Anyone
have a clue? Because I'm stuck.
>
> Thanks, Steve
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-28 2:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 18:55 [Buildroot] udevadm: missing or unknown command Steve Kenton
2015-07-28 2:11 ` Nimai Mahajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox