以下のように /dev/fbX デバイスを割り当てたいと思います。
USB-LCD デバイスの場合は /dev/fb0。
メイン ディスプレイ デバイス用の /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 テスト /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 ルールを有効にする方法を教えてください。
この環境は VMware 上の Debian Lenny です。
目的は、udev assign によるブート プロセスからのメイン モニターの変更のテストです。
VESA VGA <-- udev 割り当てによる切り替え --> 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==""
これに対する提案をありがとう:-)