Как назначить / dev / fbX? - PullRequest
       19

Как назначить / dev / fbX?

0 голосов
/ 20 октября 2010

Я бы хотел назначить / dev / fbX устройство, как показано ниже.
/ dev / fb0 для устройства USB-LCD.
/ dev / fb1 для устройства основного дисплея.
Я пробую это.
ver.1: создано /etc/udev/rules.d/91-udev-fb.rules

KERNEL=="fb0", ATTR{name}=="VESA VGA", ACTION=="add", NAME="fd1"
KERNEL=="fb1", ATTR{name}=="I-O DATA USB-RG", ACTION=="add", NAME="fd0"

результат.
ls / dev показывает только / dev / fb0.

ver.2: создано /etc/udev/rules.d/91-udev-fb.rules

KERNEL=="fb0", ATTR{name}=="VESA VGA", ACTION=="add", NAME=="fd1"
KERNEL=="fb1", ATTR{name}=="I-O DATA USB-RG", ACTION=="add", NAME=="fd0"

результат.
ls / dev показано / dev / fb0 и / dev / fb1, но / dev / fb0 - это VESA VGA. udevadm test / dev / fb0

parse_file: reading '/etc/udev/rules.d/50-udev.rules' as rules file
parse_file: reading '/etc/udev/rules.d/51-android.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/dev/.udev/rules.d/61-dev-root-link.rules' as rules file
parse_file: reading '/lib/udev/rules.d/64-xorg-xkb.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-cd-aliases-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/85-hwclock.rules' as rules file
parse_file: reading '/etc/udev/rules.d/90-hal.rules' as rules file
parse_file: reading '/etc/udev/rules.d/91-permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/91-udev-fb.rules' as rules file
parse_file: reading '/etc/udev/rules.d/95-late.rules' as rules file
parse_file: reading '/etc/udev/rules.d/z60_xserver-xorg-input-wacom.rules' as rules file
unable to open device '/dev/fb0'

и udevadm info -a -n / dev / fb0 показаны так же, как VESA VGA.

Я думаю, что мои созданные правила не верны. Пожалуйста, предложите мне, как я могу применить правила udev.
Это среда Debian Lenny на VMware.
Цель тестирует изменение основного монитора из процесса загрузки с помощью команды udev assign.
VESA VGA <- переключение с помощью udev assign -> USB-LCD.

По умолчанию ничего не добавляется в /etc/udev/rules.d.
когда я загружаю linux, / dev / fb0 - это основной дисплей, а / dev / fb1 - это USB-LCD.
И это информация для разработчиков.

-/dev/fb0
  looking at device '/class/graphics/fb0':
    KERNEL=="fb0"
    SUBSYSTEM=="graphics"
    DRIVER==""
    ATTR{bits_per_pixel}=="8"
    ATTR{blank}==""
    ATTR{console}==""
    ATTR{cursor}==""
    ATTR{mode}==""
    ATTR{modes}=="U:800x600p-75"
    ATTR{pan}=="0,0"
    ATTR{virtual_size}=="800,600"
    ATTR{name}=="VESA VGA"
    ATTR{stride}=="800"
    ATTR{rotate}=="0"
    ATTR{state}=="0"

  looking at parent device '/devices/platform/vesafb.0':
    KERNELS=="vesafb.0"
    SUBSYSTEMS=="platform"
    DRIVERS=="vesafb"
    ATTRS{modalias}=="platform:vesafb"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""


-/dev/fb1  
 looking at device '/class/graphics/fb1':
    KERNEL=="fb1"
    SUBSYSTEM=="graphics"
    DRIVER==""
    ATTR{bits_per_pixel}=="16"
    ATTR{blank}==""
    ATTR{console}==""
    ATTR{cursor}==""
    ATTR{mode}==""
    ATTR{modes}=="U:1280x1024p-60"
    ATTR{pan}=="0,0"
    ATTR{virtual_size}=="1280,1024"
    ATTR{name}=="I-O DATA USB-RG"
    ATTR{stride}=="2560"
    ATTR{rotate}=="0"
    ATTR{state}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1':
    KERNELS=="2-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{urbnum}=="143"
    ATTRS{idVendor}=="17e9"
    ATTRS{idProduct}=="0151"
    ATTRS{bcdDevice}=="0101"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="DisplayLink"
    ATTRS{product}=="I-O DATA USB-RGB_D"
    ATTRS{serial}=="122937"

  looking at parent device '/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="49"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0002"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="6"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.26-2-686 ehci_hcd"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{serial}=="0000:02:03.0"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:11.0/0000:02:03.0':
    KERNELS=="0000:02:03.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x15ad"
    ATTRS{device}=="0x0770"
    ATTRS{subsystem_vendor}=="0x15ad"
    ATTRS{subsystem_device}=="0x0770"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="17"
    ATTRS{local_cpus}=="ff"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{modalias}=="pci:v000015ADd00000770sv000015ADsd00000770bc0Csc03i20"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00/0000:00:11.0':
    KERNELS=="0000:00:11.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{vendor}=="0x15ad"
    ATTRS{device}=="0x0790"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x060401"
    ATTRS{irq}=="0"
    ATTRS{local_cpus}=="ff"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{modalias}=="pci:v000015ADd00000790sv00000000sd00000000bc06sc04i01"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

Спасибо за любые предложения по этому вопросу: -)

1 Ответ

2 голосов
/ 20 октября 2010

Создать файл правил udev.(в /etc/udev/rules.d/ для Ubuntu)

KERNEL == "fb0", ATTR {name} == "VESA VGA", ACTION == "add", NAME = "fd1"
KERNEL == "fb1", ATTR {name} == "IO DATA USB-RG", ACTION == "add", NAME = "fd0"

Каталог правил отслеживается на предмет изменений автоматически.
(или используйте udevadm control --reload-rules).

...