मेरे पास एक रास्पबेरी पाई ज़ीरो है जिसमें एक OTG माइक्रो USB हब है जिसमें नेटवर्क एडेप्टर शामिल है। अगर मैं रास्पियन का उपयोग करता हूं तो एडपेटर ठीक काम करता है:

$ lsusb
Bus 001 Device 003: ID 0fe6:9700 ICS Advent DM9601 Fast Ethernet Adapter
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ ls /sys/class/net/ -lah
insgesamt 0
drwxr-xr-x  2 root root 0 Jul 20 13:53 .
drwxr-xr-x 54 root root 0 Feb 14  2019 ..
lrwxrwxrwx  1 root root 0 Jul 17 14:50 eth0 -> ../../devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/net/eth0
lrwxrwxrwx  1 root root 0 Jul 17 14:49 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx  1 root root 0 Jul 17 14:50 wlan0 -> ../../devices/platform/soc/20300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0
$ cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
  eth0:  262496    2737    0  989    0     0          0         0    37106     301    0    0    0     0       0          0
    lo:      78       2    0    0    0     0          0         0       78       2    0    0    0     0       0          0
 wlan0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

वास्तव में मैं इस एडॉप्टर के साथ SSH पर जुड़ रहा हूं।

इसलिए मुझे इस एडेप्टर को एक एम्बेडेड के साथ काम करने की आवश्यकता है: इसलिए मैं बिजीबॉक्स के साथ बिल्डरूट का उपयोग करता हूं।

$ git clone https://github.com/buildroot/buildroot.git buildroot_rpi_zero
$ cd buildroot_rpi_zero
buildroot_rpi_zero$ git checkout tags/2020.02.3
buildroot_rpi_zero$ make raspberrypi0w_defconfig
buildroot_rpi_zero$ make all
buildroot_rpi_zero$ make savedefconfig

संलग्न मेरी विन्यास है:

BR2_arm=y
BR2_arm1176jzf_s=y
BR2_CCACHE=y
BR2_CCACHE_DIR="/mnt/Daten/buildroot-ccache"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi0w/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi0w/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-miniuart-bt-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,64d0a9870ac14d5eb5253f67d984ae348eec1393)/linux-64d0a9870ac14d5eb5253f67d984ae348eec1393.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-zero-w"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_PY_ONLY=y
BR2_PACKAGE_PYTHON3_BZIP2=y
BR2_PACKAGE_PYTHON3_CODECSCJK=y
BR2_PACKAGE_PYTHON3_CURSES=y
BR2_PACKAGE_PYTHON3_DECIMAL=y
BR2_PACKAGE_PYTHON3_OSSAUDIODEV=y
BR2_PACKAGE_PYTHON3_READLINE=y
BR2_PACKAGE_PYTHON3_SSL=y
BR2_PACKAGE_PYTHON3_SQLITE=y
BR2_PACKAGE_PYTHON3_PYEXPAT=y
BR2_PACKAGE_PYTHON3_XZ=y
BR2_PACKAGE_PYTHON3_ZLIB=y
BR2_PACKAGE_LIBSSH=y
BR2_PACKAGE_LIBSSH_SERVER=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_OPENSSH=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y

बूट के बाद USB उपकरणों का पता लगाया जाएगा:

$ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 1a40:0101
Bus 001 Device 003: ID 0fe6:9700
$ ls -lah /sys/class/net/
total 0      
drwxr-xr-x    2 root     root           0 Jan  1 00:00 .
drwxr-xr-x   47 root     root           0 Jan  1 00:00 ..
lrwxrwxrwx    1 root     root           0 Jan  1 00:00 lo -> ../../devices/virtual/net/lo
cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
$ dmesg | grep usb
[    0.174140] usbcore: registered new interface driver usbfs
[    0.174290] usbcore: registered new interface driver hub
[    0.174558] usbcore: registered new device driver usb
[    0.441374] usbcore: registered new interface driver smsc95xx
[    0.476557] dwc_otg 20980000.usb: base=(ptrval)
[    0.942503] dwc_otg 20980000.usb: DWC OTG Controller
[    0.945622] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[    0.948924] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[    0.958646] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    0.964920] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.968365] usb usb1: Product: DWC OTG Controller
[    0.971671] usb usb1: Manufacturer: Linux 4.19.97 dwc_otg_hcd
[    0.974980] usb usb1: SerialNumber: 20980000.usb
[    0.987968] usbcore: registered new interface driver usb-storage
[    1.031124] usbcore: registered new interface driver usbhid
[    1.034612] usbhid: USB HID core driver
[    3.017388] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    3.277596] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
[    3.292825] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.303663] usb 1-1: Product: USB 2.0 Hub
[    3.746900] usb 1-1.2: new full-speed USB device number 3 using dwc_otg
[    3.989493] usb 1-1.2: New USB device found, idVendor=0fe6, idProduct=9700, bcdDevice= 1.01
[    4.005150] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[    4.016385] usb 1-1.2: Product: USB 2.0 10/100M Ethernet Adaptor

अब ऐसा लगता है कि एडॉप्टर का पता चला है लेकिन कोई नेटवर्क इंटरफेस नहीं है...? क्या मुझे इसे मैन्युअल रूप से जोड़ना है?

1
Andreas 20 जुलाई 2020, 15:23

1 उत्तर

सबसे बढ़िया उत्तर

इस बीच मैंने कुछ परीक्षण किए और पता लगाया, कि हमें इस ईथरनेट कार्ड के लिए पहले से ही कर्नेल ड्राइवर की आवश्यकता है:

$ make linux-menuconfig
Location:
-> Kernel configuration
    -> Device Drivers
        -> Network device support
            -> USB Network Adapters
                -> Davicom DM96xx based USB 10/100 ethernet devices

enter image description here

और हमने कर्नेल का पुनर्निर्माण किया:

$ make linux-rebuild

इस छवि को शुरू करने का परिणाम होगा:

$ $ dmesg | grep usb
...
[    4.057510] usb 1-1.2: Product: USB 2.0 10/100M Ethernet Adaptor
[    4.113284] dm9601 1-1.2:1.0 eth0: register 'dm9601' at usb-20980000.usb-1.2, Davicom DM96xx USB 10/100 Ethernet, zz:zz:zz:zz:zz:zz

और हम IP4V सेटिंग्स के साथ आगे बढ़ सकते हैं:

$ ifconfig eth0 192.168.08.15 netmask 255.255.255.0 up
[ 1013.827270] dm9601 1-1.2:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xFFFF
[ 1013.896358] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 1013.906626] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
0
Andreas 20 जुलाई 2020, 17:30