2 chyba

 ##### The CPU freq = 575 MHZ ####
 estimate memory size =128 Mbytes
RESET MT7628 PHY!!!!!!
Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.

You choosed 3

0

Tylko jest dosyć spory problem... Pisałem Ci wyżej, że serial port zaczął mi działać, ale tylko w jedną stronę, nie działa mi klawiatura

Czyli on nawet nie probuje zaciagnac w tym momencie po tftpd?

3: System Boot system code via Flash.
## Booting image at bc050000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.95
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1466289 Bytes =  1.4 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 128

Przez caly czas trzymam reset, karta 10.10.10.1/8 i 10.10.10.1/24, probowalem kernel i system... Nie chce zaciągnąć oprogramowania. Laptop nie pinguje routera czyli 10.10.10.123

Ram? Flash? Kurczę, teraz to na prawdę nie mam pojęcia jak to ogarnąć... Chyba wylutowywanie kości sad

No to leżymy:

U-Boot 1.1.3 (Jun 12 2015 - 11:03:22)

Board: Ralink APSoC DRAM:  128 MB
relocate_code Pointer at: 87fb8000
******************************
Software System Reset Occurred
******************************
flash manufacture id: c2, device id 20 18
find flash: MX25L12805D
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 1024 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 128 MBytes
Flash component: SPI Flash
Date:Jun 12 2015  Time:11:03:22
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 575 MHZ ####
 estimate memory size =128 Mbytes
RESET MT7628 PHY!!!!!!
Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.

You choosed 3
                                                                                                                      0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.95
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1466289 Bytes =  1.4 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 128

Starting kernel ...

[    0.000000] Linux version 4.14.95 (root@LinDebKamilWu) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7676-cddd7b4c77)) #0 Wed Jan 30 12:21:02 2019
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is UniElec U7628-01 (128M RAM/16M flash)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=000487fe
[    0.000000] Readback ErrCtl register=000487fe
[    0.000000] Memory: 125100K/131072K available (3386K kernel code, 165K rwdata, 820K rodata, 164K init, 200K bss, 5972K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] intc: using register map from devicetree
[    0.000000] CPU Clock: 580MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015367] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087583] pid_max: default: 32768 minimum: 301
[    0.096951] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109907] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.129560] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.148930] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.161034] pinctrl core: initialized pinctrl subsystem
[    0.171825] NET: Registered protocol family 16
[    0.289141] mt7620-pci 10140000.pcie: Port 0 N_FTS = 1b105000
[    0.450147] mt7620-pci 10140000.pcie: PCIE0 no card, disable it(RST&CLK)
[    0.463285] mt7620-pci: probe of 10140000.pcie failed with error -1
[    0.491866] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.503075] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.514218] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.529355] clocksource: Switched to clocksource MIPS
[    0.540490] NET: Registered protocol family 2
[    0.549899] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.563591] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.576114] TCP: Hash tables configured (established 1024 bind 1024)
[    0.588816] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.600277] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.612880] NET: Registered protocol family 1
[    0.624697] Crashlog allocated RAM at address 0x3f00000
[    0.636710] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.655183] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.666619] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.695660] io scheduler noop registered
[    0.703331] io scheduler deadline registered (default)
[    0.714298] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.728000] console [ttyS0] disabled
[    0.735023] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.752851] console [ttyS0] enabled
[    0.752851] console [ttyS0] enabled
[    0.766584] bootconsole [early0] disabled
[    0.766584] bootconsole [early0] disabled
[    0.782946] cacheinfo: Failed to find cpu0 device node
[    0.793153] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.805933] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.821128] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    0.831239] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.843818] Creating 4 MTD partitions on "spi0.0":
[    0.853308] 0x000000000000-0x000000030000 : "bootloader"
[    0.864767] 0x000000030000-0x000000040000 : "config"
[    0.875549] 0x000000040000-0x000000050000 : "factory"
[    0.886482] 0x000000050000-0x000001000000 : "firmware"
[    0.961526] 2 uimage-fw partitions found on MTD device firmware
[    0.973288] 0x000000050000-0x0000001b5ff1 : "kernel"
[    0.984032] 0x0000001b5ff1-0x000001000000 : "rootfs"
[    0.994745] mtd: device 5 (rootfs) set to be root filesystem
[    1.007447] 1 squashfs-split partitions found on MTD device rootfs
[    1.019754] 0x0000003f0000-0x000001000000 : "rootfs_data"
[    1.032164] libphy: Fixed MDIO Bus: probed
[    1.050969] rt3050-esw 10110000.esw: link changed 0x00
[    1.062783] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.081056] NET: Registered protocol family 10
[    1.093670] Segment Routing with IPv6
[    1.101102] NET: Registered protocol family 17
[    1.109960] 8021q: 802.1Q VLAN Support v1.8
[    1.129206] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    1.144141] Freeing unused kernel memory: 164K
[    1.152958] This architecture does not have kernel memory protection.
[    2.063010] init: Console is alive
[    2.070068] init: - watchdog -
[    2.449404] random: fast init done
[    3.279337] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.475586] CPU 0 Unable to handle kernel paging request at virtual address 0000000c, epc == 80070548, ra == 80070370
[    3.496679] Oops[#1]:
[    3.501174] CPU: 0 PID: 274 Comm: kmodloader Not tainted 4.14.95 #0
[    3.513577] task: 87d61b80 task.stack: 87f52000
[    3.522533] $ 0   : 00000000 00000001 00000000 87f61888
[    3.532878] $ 4   : 80438a38 00000000 87f6174c ffffff80
[    3.543223] $ 8   : ffffffc0 fffffffc 00000020 00000114
[    3.553567] $12   : 00000001 00000000 00000005 6e616870
[    3.563908] $16   : 87f61740 87f53ec0 00000000 87f6174c
[    3.574253] $20   : 87f61788 80440000 fffffff8 80440000
[    3.584597] $24   : 00000000 00000000
[    3.594941] $28   : 87f52000 87f53dd8 00000000 80070370
[    3.605287] Hi    : 00000006
[    3.610975] Lo    : 00000001
[    3.616691] epc   : 80070548 load_module+0x1ab4/0x1dc8
[    3.626858] ra    : 80070370 load_module+0x18dc/0x1dc8
[    3.637017] Status: 1100a403 KERNEL EXL IE
[    3.645299] Cause : 00800008 (ExcCode 02)
[    3.653222] BadVA : 0000000c
[    3.658912] PrId  : 00019655 (MIPS 24KEc)
[    3.666834] Modules linked in: usb_common(+)
[    3.675290] Process kmodloader (pid: 274, threadinfo=87f52000, task=87d61b80, tls=77fb6dc0)
[    3.691813] Stack : 87f43880 014002c2 00000000 00000000 87f6174c 00007fff 87f61740 8006dea4
[    3.708362]         80353200 80440000 c0098268 ffffffff 87f61888 87f60000 00402374 80420000
[    3.724910]         803d6f0c 803d0000 80440000 80438a20 fffcd000 014002c0 00000000 00000000
[    3.741459]         87f613b0 00000008 00000000 00000000 6e72656b 00006c65 77fab000 77fab000
[    3.758007]         00000000 800bcb88 87835338 00000101 00000002 0000002e 014002c0 000007cf
[    3.774554]         ...
[    3.779387] Call Trace:
[    3.784221] [<80070548>] load_module+0x1ab4/0x1dc8
[    3.793703] [<800709ac>] SyS_init_module+0x150/0x158
[    3.803537] [<8001334c>] syscall_common+0x34/0x58
[    3.812838] Code: 8fbf00d4  0c0092cd  00000000 <8ec20014> 02802825  0c04adf8  8c440088  1440ff8c  00409025
[    3.832153]
[    3.835111] ---[ end trace c71a7aa813c02b03 ]---
[    3.845596] Kernel panic - not syncing: Fatal exception
[    3.857003] Rebooting in 1 seconds..
[04020C0C][04020C0D]
DDR Calibration DQS reg = 00008787

Laptop: 10.10.10.1 255.0.0.0
Plik to oficjalny kernel wyciągnięty z imagebuildera, zmienilem jego nazwe na "openwrt-ramips-mt76x8-u7628-01-128M-16M-initramfs-kernel.bin"
Co robie nie tak?

Na szczęście działa Serial Port - podlaczamy konwerter pod usb, tx, rx, włączamy router i po sekundzie dopiero podłączamy masę miedzy konwerterem a routerem

Super! Zdradzisz mi, które katalogi powinienem skopiować/podmienić z mojego imagebuildera do tego oficjalnego? Wszystkie ścieżki

Cezary napisał/a:

Jest, zmień ręcznie opcję na =y a później napisz make defconfig

Działa, jak wrócę do domu to przetestuje ten firmware.



Cezary napisał/a:

Tylko trzy razy się zastanów co robisz, bo włączysz coś i domyślnie z zależności zaznaczy się pół systemu.

Przypomnę, że docelowo zależało mi na imagebuilderze, w którym chciałem wkompilować wszystko co się da, aby następnie z niego korzystać. Nie wiem czy to uda mi się, dlatego że mój flash to 16MB i pewnie rozmiar będzie większy. Widzę w opcjach, że mam również możliwość stworzenia swojego SDK. Czy mogę to zrobić, aby skompilować tylko to czego potrzebuje, czyli sama zmiana tych LEDów, a następnie używając tego swojego nowego SDK, paczki byłyby pobierane z repozytorium podczas kompilacji, czy muszę każdą paczkę wkompilowywać w SDK i imagebuilder? Może mogę po prostu ściągnąc gotowy imagebuilder i przenieść do niego tylko te zmiany GPIO, definicji LEDów, serialportu, ktore zrobiłem aby pominąć żmudny proces kompilowania wszystkich pakietów?

To może być bardzo trudne i czasochłonne znalezienie wszystkich 50 pakietów w menuconfig, które potrzebuję wkompilować w obraz. Nie ma na to innej prostszej metody? Może zamiast =y powinienem podać inną wartość?

Z palca robię te zmiany. Zauważyłem, że wiele paczek, które chce dodać wywołują mi problem podczas kompilacji. Na chwilę obecną openvpn i mwan3 nie kompilują się, udało mi się dokompilować tylko nano. Przykład:

Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-mwan3:
 *      ip
 *      ipset
 *      iptables-mod-conntrack-extra
 *      iptables-mod-ipopt
 *      libuci-lua
 *      luci-mod-admin-full
 *      luci-app-firewall
 *      luci-lib-nixio
 * opkg_install_cmd: Cannot install package luci-app-mwan3.
package/Makefile:65: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 255
make[2]: Leaving directory '/home/root/openwrt/sdk/openwrt'
package/Makefile:104: recipe for target '/home/root/openwrt/sdk/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install' failed
make[1]: *** [/home/root/openwrt/sdk/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/root/openwrt/sdk/openwrt'
/home/root/openwrt/sdk/openwrt/include/toplevel.mk:216: polecenia dla obiektu 'world' nie powiodły się
make: *** [world] Błąd 2

Mój niepokój wzbudza aktualizacja paczek - Bad file descriptor:

# make package/symlinks
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git^911bbd6bb4856f1e28ae00af37df62e4fa3529e5' ...
Create index file './feeds/packages.index'
Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git^6f6641d97de2c85ee5d87beda92ae8437d1dbdf5' ...
Create index file './feeds/luci.index'
Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git^ea345d16a6e27c2a8fdf67bf543cc36a5f189131' ...
Create index file './feeds/routing.index'
Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git^cb939d9677d6e38c428f9f297641d07611edeb04' ...
Create index file './feeds/telephony.index'
/bin/sh: 1: 8: Bad file descriptor
Collecting package info: done
Installing all packages from feed packages.
Installing all packages from feed luci.
Installing all packages from feed routing.
Installing all packages from feed telephony.

Czy wiesz może dlaczego po dodaniu jednej jedynej paczki, po zmianie w .config z:

# CONFIG_PACKAGE_openvpn-openssl is not set
# CONFIG_PACKAGE_openvpn-easy-rsa is not set
# CONFIG_PACKAGE_luci-app-openvpn is not sety

na:

CONFIG_PACKAGE_openvpn-openssl=y
CONFIG_PACKAGE_openvpn-easy-rsa=y
CONFIG_PACKAGE_luci-app-openvpn=y

wychodzi mi taki błąd podczas kompilacji:

buffer.h:1020:34: note: in definition of macro 'ALLOC_OBJ_CLEAR'
         memset((dptr), 0, sizeof(type)); \
                                  ^~~~
In file included from crypto_openssl.c:44:0:
openssl_compat.h:446:13: error: dereferencing pointer to incomplete type 'RSA_METHOD {aka struct rsa_meth_st}'
     rsa_meth->name = string_alloc(name, NULL);
             ^~
openssl_compat.h: In function 'RSA_meth_get0_app_data':
openssl_compat.h:637:23: error: dereferencing pointer to incomplete type 'RSA_METHOD {aka const struct rsa_meth_st}'
     return meth ? meth->app_data : NULL;
                       ^~
Makefile:672: recipe for target 'crypto_openssl.o' failed
make[7]: *** [crypto_openssl.o] Error 1
make[7]: Leaving directory '/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/openvpn-openssl/openvpn-2.4.5/src/openvpn'
Makefile:428: recipe for target 'all-recursive' failed
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory '/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/openvpn-openssl/openvpn-2.4.5/src'
Makefile:613: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/openvpn-openssl/openvpn-2.4.5'
Makefile:501: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/openvpn-openssl/openvpn-2.4.5'
Makefile:137: recipe for target '/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/openvpn-openssl/openvpn-2.4.5/.built' failed
make[3]: *** [/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/openvpn-openssl/openvpn-2.4.5/.built] Error 2
make[3]: Leaving directory '/home/root/openwrt/sdk/openwrt/package/network/services/openvpn'
time: package/network/services/openvpn/openssl/compile#0.46#0.62#1.24
package/Makefile:107: recipe for target 'package/network/services/openvpn/compile' failed
make[2]: *** [package/network/services/openvpn/compile] Error 2
make[2]: Leaving directory '/home/root/openwrt/sdk/openwrt'
package/Makefile:103: recipe for target '/home/root/openwrt/sdk/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile' failed
make[1]: *** [/home/root/openwrt/sdk/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/root/openwrt/sdk/openwrt'
/home/root/openwrt/sdk/openwrt/include/toplevel.mk:216: polecenia dla obiektu 'world' nie powiodły się
make: *** [world] Błąd 2

Ok, ale czemu to się nie chce usunąć? Mam teraz dwa wpisy od wlan i jeden od usb. Przeszukałem pliki tej architektury i nigdzie nie znalazłem u7628-01:green:usb. Mam wrażenie, że jest jakaś konfiguracja globalna, która dodaje mi te dwa wpisy.

Będę musiał to sprawdzić, czy sprawdzili każdego .ipk z osobna. To że listy nie było, to najmniejszy problem. Chciałem doinstalować nano to nie było do niej dostępnej zależnej biblioteki, przy luci to chyba wszystkie ipk były niedostępne.
Tak, "sysugrade -n file". Mam wrażenie, że jest jakiś bug w skryptach, do czego służy ten led usb, skoro nie ma fizycznie takiego leda w tym routerze

Zmieniając na chwilę temat - czy wiesz co się dzieje z repozytorium? Nie jestem w stanie praktycznie niczego zainstalować, skompilować...



Obecnie wprowadziłem poniższe zmiany:

# nano target/linux/ramips/base-files/etc/board.d/01_leds

(...)
u7628-01-128M-16M)
        ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
        ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
        ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
        ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
        ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
        ucidef_set_led_netdev "wlan" "wlan" "u7628-01:green:wlan" "wlan0" "link"
        ;;
(...)


I wygląda to następująco:

(...)

config led 'led_wlan'
        option name 'wlan'
        option sysfs 'u7628-01:green:wlan'
        option trigger 'netdev'
        option mode 'link'
        option dev 'wlan0'

config led 'led_usb'
        option name 'USB'
        option sysfs 'u7628-01:green:usb'
        option trigger 'usbdev'
        option interval '50'
        option dev '1-1'

config led 'led_wifi_led'
        option name 'wifi'
        option sysfs 'u7628-01:green:wlan'
        option trigger 'netdev'
        option mode 'link tx rx'
        option dev 'wlan0'


Nowy wpis "led_wlan" jest ok. Nie mogę pozbyć się tych dwóch wpisów: "led_usb" oraz "led_wifi_led".


Serial Port - podłączam konwerter do routera, podaje zasilanie routera, jak mrugną LEDy od LANów (po ok. 5 sek) podłączam konwerter pod usb komputera, uruchamiam PuTTy i jest ok. Nie działa mi klawiatura niestety

Cezary napisał/a:

1. Tworzone są dynamicznie z https://github.com/openwrt/openwrt/blob … _leds#L435 tam sobie zmień.

Najlepiej byłoby, gdyby wlan pokazywał tylko link domyślnie, ponieważ tak działa cała reszta LEDów. Czym różni się ucidef oraz set? Zrobiłem tak jak poniżej (usunąłem "usb"), ale nie widzę żadnych zmian w /etc/config/system po skompilowaniu.

u7628-01-128M-16M)
    ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
    ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
    ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
    ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
    ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
    set_wifi_led "u7628-01:green:wlan"
;;


Cezary napisał/a:

2. tak, imagebuilder zawiera to z czego został skompilowany. Jak chcesz wszystkie pakiety to kompilacja będzie trwałą wieki i może się wywalić (czego już doświadczyłeś). Mimo tego co napisałeś prościej jest zrobić make menuconfig, zaznaczyć pakiet i zrobić make. Jak już masz prekompilowany system to teraz będzie to szybko się działo.

Spróbuje, jak już skompiluje prawidłowo wszystkie potrzebne zmiany



Cezary napisał/a:

3. Zmień sobie też bootargs = "console=ttyS0,115200";  na 57600 to będziesz miał tą samą prędkość co bootloader ma.

Który plik masz na myśli:

./target/linux/imx6/patches-4.14/100-bootargs.patch
./target/linux/generic/pending-4.14/920-mangle_bootargs.patch
./target/linux/generic/pending-4.9/920-mangle_bootargs.patch
./target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch
./target/linux/bcm53xx/patches-4.14/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
./target/linux/gemini/patches-4.14/0033-ARM-dts-Fix-bootargs-for-Gemini-D-Link-devices.patch

Udostępniam kilka informacji od siebie, aby kolejna osoba która zakupi ten router nie borykała się z tymi samymi problemami co ja.


W kompilatorze wprowadziłem następujące zmiany w pliku "dtsi":

# nano target/linux/ramips/dts/U7628-01.dtsi

/*
 *  BSD LICENSE
 *
 *  Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
 *  Copyright(c) 2017 Piotr Dymacz <pepe2k@gmail.com>.
 *  All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    * Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in
 *      the documentation and/or other materials provided with the
 *      distribution.
 *    * Neither the name of Broadcom Corporation nor the names of its
 *      contributors may be used to endorse or promote products derived
 *      from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "mt7628an.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
    compatible = "unielec,u7628-01", "mediatek,mt7628an-soc";

    chosen {
        bootargs = "console=ttyS0,115200";
    };

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        reset {
            label = "reset";
            gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
            linux,code = <KEY_RESTART>;
        };
    };

    gpio-leds {
        compatible = "gpio-leds";

        wlan {
            label = "u7628-01:green:wlan";
            gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
        };

        wan {
            label = "u7628-01:green:wan";
            gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
        };

        lan1 {
            label = "u7628-01:green:lan1";
            gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
        };

        lan2 {
            label = "u7628-01:green:lan2";
            gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
        };

        lan3 {
            label = "u7628-01:green:lan3";
            gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
        };

        lan4 {
            label = "u7628-01:green:lan4";
            gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
        };

    };
};

&gpio0 {
    status = "okay";
};

&gpio1 {
    status = "okay";
};

&pcie {
    status = "okay";
};

&ethernet {
    mtd-mac-address = <&factory 0x28>;
};

&wmac {
    status = "okay";
    ralink,mtd-eeprom = <&factory 0x0>;
};

&pinctrl {
    state_default: pinctrl0 {
        gpio {
            ralink,group = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "wdt", "wled_an";
            ralink,function = "gpio";
        };
    };
};

Po kompilacji i uruchomieniu routera otrzymałem następujące zmiany:


Zmiany LED:
- usunięcie "usb" (nie zarządzała niczym, nie ma takiego LEDa)
- zmiana nazwy z "power" na "wlan"

# ls /sys/class/leds

mt76-phy0
u7628-01:green:lan1    
u7628-01:green:lan2
u7628-01:green:lan3
u7628-01:green:lan4
u7628-01:green:wan
u7628-01:green:wlan

Zmiany GPIO:
- pojawia się "gpio11", ktore zarządza fizycznym GOLDPINem nr. 6 na płycie. Działa znakomicie jako wyjście oraz jako wejście. Zauważyłem, że nie podając stanu wejściowego GND lub 3V3 otrzytywany stan to naprzemian "0" lub "1".

# ls /sys/class/gpio

export
gpio11
gpiochip0
gpiochip32
gpiochip64
unexport

Takie zmiany wymagają ingerencji w pliku "system" w sekcji LEDów, poniżej cały ten plik w defaultowej konfiguracji już PO zmianach:

# nano /etc/config/system

config system
    option hostname 'OpenWrt'
    option timezone 'UTC'
    option ttylogin '0'
    option log_size '64'
    option urandom_seed '0'

config timeserver 'ntp'
    option enabled '1'
    option enable_server '0'
    list server '0.openwrt.pool.ntp.org'
    list server '1.openwrt.pool.ntp.org'
    list server '2.openwrt.pool.ntp.org'
    list server '3.openwrt.pool.ntp.org'

config led 'led_lan1'
    option name 'lan1'
    option sysfs 'u7628-01:green:lan1'
    option trigger 'switch0'
    option port_mask '0x2'
    option default '0'

config led 'led_lan2'
    option name 'lan2'
    option sysfs 'u7628-01:green:lan2'
    option trigger 'switch0'
    option port_mask '0x4'
    option default '0'

config led 'led_lan3'
    option name 'lan3'
    option sysfs 'u7628-01:green:lan3'
    option trigger 'switch0'
    option port_mask '0x8'
    option default '0'

config led 'led_lan4'
    option name 'lan4'
    option sysfs 'u7628-01:green:lan4'
    option trigger 'switch0'
    option port_mask '0x10'
    option default '0'

config led 'led_wan'
    option name 'wan'
    option sysfs 'u7628-01:green:wan'
    option trigger 'switch0'
    option port_mask '0x01'
    option default '0'

config led 'led_wifi_led'
    option name 'wlan'
    option sysfs 'u7628-01:green:wlan'
    option trigger 'netdev'
    option dev 'wlan0'
    option default '0'
    option mode 'link'


Mam jeszcze dwa pytania:

1. Chciałem podmienić ten plik "/etc/config/system", aby w defaultowej konfiguracji routera te LEDy działały prawidłowo.
Jaki plik muszę podmienić w kompilatorze, aby system skompilował się z tymi zmianami LEDów

# find . -name "system"

./build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/gcc-7.3.0/libsanitizer/include/system
./build_dir/target-mipsel_24kc_musl/busybox-1.28.4/include/config/last/system
./build_dir/target-mipsel_24kc_musl/busybox-1.28.4/include/config/first/system
./build_dir/target-mipsel_24kc_musl/root.orig-ramips/etc/init.d/system
./build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/base-files/.pkgdir/base-files/etc/init.d/system
./build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/base-files/ipkg-mipsel_24kc/base-files/etc/init.d/system
./build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/system
./staging_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/system
./package/base-files/files/etc/init.d/system
./package/system

2. Po kompilacji systemu, chciałem dalej korzystać z ImageBuildera - nie chcę bawić się w Developera, jeśli nie ma takiej potrzeby, a Image Builder jest dużo fajniejszym i prostszym narzędziem. Jak powinienem przygotować się do tego? Rozumiem, że w "make menuconfig" powiniem zaznaczyć, że chce zbudować ImageBuilder. Ale po zbudowaniu go w obecnym stanie nie będę chyba miał w nim dostępnych żadnych dodatkowych pakietów. Czy jeśli w pliku ".config" zamienie wszystkie:

# CONFIG_PACKAGE_xxxxxxxx is not set

na:

CONFIG_PACKAGE_xxxxxxxx=y

...i skompiluje to, to czy będzie mi służył taki ImageBuilder TYLKO do kolejnego dodawania i usuwania pakietów oraz nadpisywania plików?

Zrobiłem tak...:

Pobieranie źródeł: 
  
  $ cd ~
  $ git clone [url]https://github.com/openwrt/openwrt.git[/url]
  $ cd openwrt
  $ git fetch --tags
  $ git checkout v18.06.2
  $ make package/symlinks



Konfiguracja:
  
  # make menuconfig
    
    Target System --->
      (X) MediaTek Ralink MIPS
    
    Subtarget ---> 
      (X) MT76x8 based boards
    
    Target Profile --->
      (X) UniElec U7628-01 (128M RAM/16M flash)
      
    
  ...i zapisać jako ".config"
  # nano .config



LEDy i GPIO
  
  # cp target/linux/ramips/dts/U7628-01.dtsi target/linux/ramips/dts/U7628-01.dtsi.bak
  # nano target/linux/ramips/dts/U7628-01.dtsi



Jako root
  
  # export FORCE_UNSAFE_CONFIGURE=1



Kompilacja
  
  # make V=s -j1


i 5 godzin później:

Number of fragments 15
Number of symbolic links  184
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 71
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
rm -f /home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin
cp /home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/vmlinux /home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin
mipsel-openwrt-linux-musl-cpp -nostdinc -x assembler-with-cpp -I/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.95/arch/mips/boot/dts -I/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.95/arch/mips/boot/dts/include -I/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.95/include/ -undef -D__DTS__  -o /home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin.dtb.tmp ../dts/U7628-01-128M-16M.dts
/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.95/scripts/dtc/dtc -O dtb -i../dts/  -o /home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin.dtb /home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin.dtb.tmp
Error: ../dts/U7628-01.dtsi:68.5-6 syntax error
FATAL ERROR: Unable to parse input tree
Makefile:288: recipe for target '/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin' failed
make[5]: *** [/home/root/openwrt/sdk/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/u7628-01-128M-16M-kernel.bin] Error 1
make[5]: Leaving directory '/home/root/openwrt/sdk/openwrt/target/linux/ramips/image'
Makefile:26: recipe for target 'install' failed
make[4]: *** [install] Error 2
make[4]: Leaving directory '/home/root/openwrt/sdk/openwrt/target/linux/ramips'
Makefile:13: recipe for target 'install' failed
make[3]: *** [install] Error 2
make[3]: Leaving directory '/home/root/openwrt/sdk/openwrt/target/linux'
time: target/linux/install#730.49#168.43#882.62
target/Makefile:23: recipe for target 'target/linux/install' failed
make[2]: *** [target/linux/install] Error 2
make[2]: Leaving directory '/home/root/openwrt/sdk/openwrt'
target/Makefile:19: recipe for target '/home/root/openwrt/sdk/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.target_install' failed
make[1]: *** [/home/root/openwrt/sdk/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/root/openwrt/sdk/openwrt'
/home/root/openwrt/sdk/openwrt/include/toplevel.mk:216: polecenia dla obiektu 'world' nie powiodły się
make: *** [world] Błąd 2

Ok. Tylko w "Target System" nie widzę na dostępnej liście "ramips mt76x8", oto co mam do wyboru:

( ) Allwinner A1x/A20/A3x
( ) AppliedMicro APM821xx
( ) Atheros AR231x/AR5312
(X) Atheros AR7xxx/AR9xxx
( ) Broadcom BCM27xx
( ) Broadcom BCM47xx/53xx (ARM)
( ) Broadcom BCM47xx/53xx (MIPS)
( ) Broadcom BCM63xx
( ) Cavium Networks Econa CNS3xxx
( ) Cavium Networks Octeon
( ) Cortina Systems CS351x
( ) Freescale MPC85xx
( ) Freescale i.MX 6
( ) Freescale i.MX23/i.MX28
( ) Intel IXP4xx
( ) Lantiq
( ) MIPS Malta CoreLV board (qemu)
( ) MIPS pistachio
( ) Marvell EBU Armada
( ) Marvell Kirkwood
( ) MediaTek Ralink ARM
( ) MediaTek Ralink MIPS
( ) Microchip (Atmel AT91)
( ) Mikrotik RouterBoard 532
( ) NXP Layerscape
( ) Octeon-TX
( ) PLXTECH/Oxford NAS782x/OX8xx
( ) QEMU ARM Virtual Machine
( ) Qualcomm Atheros IPQ40XX
( ) Qualcomm Atheros IPQ806X
( ) Synopsys DesignWare ARC 770D
( ) Synopsys DesignWare ARC HS38
( ) TI AR7
( ) TI OMAP3/4/AM33xx
( ) User Mode Linux
( ) x86

Nie rozumiem. A co powinienem kompilować i jak? Zrobiłem tak:

wget http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt76x8/openwrt-sdk-18.06.2-ramips-mt76x8_gcc-7.3.0_musl.Linux-x86_64.tar.xz
tar xf openwrt-sdk-18.06.2-ramips-mt76x8_gcc-7.3.0_musl.Linux-x86_64.tar.xz
cd openwrt-sdk-18.06.2-ramips-mt76x8_gcc-7.3.0_musl.Linux-x86_64
make package/symlinks
make menuconfig (tutaj zapis do pliku defaultowej konfiguracji)
nano target/linux/ramips/dts/U7628-01.dtsi (tutaj wyrzucenie ledów)
make V=s -j1
Cezary napisał/a:

Musiał byś przerobić dts i przekompilować system i kernel

A więc zabrałem za kompilacje swojego systemu. Dlatego tak mocno tego unikałem:

-float -iremap/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f:omcproxy-2017-02-14-1fe6f48f -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=mipsel-openwrt-linux-musl-ld NM="mipsel-openwrt-linux-musl-gcc-nm" CC="mipsel-openwrt-linux-musl-gcc" GCC="mipsel-openwrt-linux-musl-gcc" CXX="mipsel-openwrt-linux-musl-g++" RANLIB="mipsel-openwrt-linux-musl-gcc-ranlib" STRIP=mipsel-openwrt-linux-musl-strip OBJCOPY=mipsel-openwrt-linux-musl-objcopy OBJDUMP=mipsel-openwrt-linux-musl-objdump SIZE=mipsel-openwrt-linux-musl-size CROSS="mipsel-openwrt-linux-musl-" ARCH="mipsel" CMAKE_COMMAND='/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/staging_dir/host/bin/cmake' CMAKE_DISABLE_cmake_check_build_system=1 ;
make[4]: Entering directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
make[5]: Entering directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
make[6]: Entering directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
Scanning dependencies of target omcproxy
make[6]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
make[6]: Entering directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
[ 11%] Building C object CMakeFiles/omcproxy.dir/src/client.c.o
[ 22%] Building C object CMakeFiles/omcproxy.dir/src/mrib.c.o
In file included from /home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f/src/omcproxy.h:51:0,
                 from /home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f/src/mrib.c:39:
/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f/src/mrib.c:57:34: error: braced-group within expression allowed only inside a function
 static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000);
                                  ^
cc1: warning: unrecognized command line option '-Wno-gnu'
CMakeFiles/omcproxy.dir/build.make:75: recipe for target 'CMakeFiles/omcproxy.dir/src/mrib.c.o' failed
make[6]: *** [CMakeFiles/omcproxy.dir/src/mrib.c.o] Error 1
make[6]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/omcproxy.dir/all' failed
make[5]: *** [CMakeFiles/omcproxy.dir/all] Error 2
make[5]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
Makefile:129: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f'
Makefile:42: recipe for target '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f/.built' failed
make[3]: *** [/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/build_dir/target-mipsel_24kc_musl/omcproxy-2017-02-14-1fe6f48f/.built] Error 2
make[3]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/feeds/base/package/network/services/omcproxy'
time: package/feeds/base/omcproxy/compile#1.46#3.12#5.27
package/Makefile:107: recipe for target 'package/feeds/base/omcproxy/compile' failed
make[2]: *** [package/feeds/base/omcproxy/compile] Error 2
make[2]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8'
package/Makefile:103: recipe for target '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile' failed
make[1]: *** [/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8'
/home/root/openwrt/sdk/v18.06.2-ramips-mt76x8/include/toplevel.mk:209: polecenia dla obiektu 'world' nie powiodły się
make: *** [world] Błąd 2

Po sześciu godzinach kompilacji wyskoczył taki błąd. Co on oznacza i co muszę zrobić, aby go uniknąć w kolejnej wielogodzinnej kompilacji?

Cezary napisał/a:

Lub prawdopodobnie są te same sygnały co w slocie microsd. Weź miernik i sprawdź czy to te same ścieżki są.

Sprawdziłem, niestety wszędzie pojawiają się "przejścia" na mierniku, maaaasakra. Po co wyprowadzać te sygnały na goldpiny, skoro 1cm dalej znajduje się gniazdo microSD.

pepe2k napisał/a:

I z tego co widzę, to już namieszali i prawdopodobnie masz jakąś inną/nową rewizję ze zmienioną mapą GPIO

Poszedłem tym tropem i dosyć mocno przypatrzyłem się stronie producenta. Ten router opisywany tutaj bardziej wygląda mi na UniElec U7628-02 niż na UniElec U7628-01. Zwróć uwagę na diodę "WiFi" - w jednym ma trzy nóżki, w drugim ma dwie nóżki. Ja mam taki z dwiema nóżkami, nie miałem również wlutowanych goldpinów SerialPort oraz GPIO.

Znalazłem jeszcze fajną alternatywę dla tego sprzętu - UniElec U7621-02. Niestety, nikt chyba jeszcze nie podjął się zakupu i recenzji tego sprzętu, a szkoda, wygląda ciekawie.

Teraz rozumiem. Muszę je najpierw zwolnić z LEDów, aby pojawiły się w GPIO.


Cezary napisał/a:

No chyba że ktoś się walnął pisząc dane na wiki.

No tak, cały czas o tym mówię, ponieważ WLAN powinien działać jako dioda LED na panelu, a nie GOLDPIN. To samo z "/sys/class/leds/u7628-01:green:usb/" - nie ma czegoś takiego na płycie.

/sys/class/gpio/gpio11 to jak widać WLAN, więc jeśli go zwolnie z LEDów, odzyskam go jako GPIO, ale co znajduje się między 37 a 44 - tego nie rozumiem, to akurat 8 sygnałów, których nie potrafię rozpoznać - czy to 8 diod LED, które są na panelu a może jednak w GOLDPINACH są wyjącia GPIO?

Wytłumacz mi jeszcze jedną rzecz: to że karta sd jest nieobsługiwana ze względu na brak sterownika w OpenWrt to rozumiem. Ale w GOLDPINACH znajdują się wyjścia na drugą kartę sd? Czyli router "obsługuje" 2x microSD?

No tak, zgadza się, ale nie w przypadku tego routera. Napisałem sobie skrypt:

X=0
while true
do
  echo "GPIO: "$X" ("` date +"%T"`")"
  
  echo $X > /sys/class/gpio/export
  echo "out" > /sys/class/gpio/gpio$X/direction
  echo "1" > /sys/class/gpio/gpio$X/value
  sleep 1
  echo "0" > /sys/class/gpio/gpio$X/value
  sleep 1
  
  echo ""
  echo ""
  
  X=$((X+1))
  
done

Oto jego wynik:

GPIO: 0 (21:49:46)


GPIO: 1 (21:49:52)


GPIO: 2 (21:49:58)


GPIO: 3 (21:50:04)


GPIO: 4 (21:50:10)


GPIO: 5 (21:50:16)


GPIO: 6 (21:50:22)


GPIO: 7 (21:50:28)


GPIO: 8 (21:50:34)


GPIO: 9 (21:50:40)


GPIO: 10 (21:50:47)


GPIO: 11 (21:50:53)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio11/value: nonexistent directory


GPIO: 12 (21:50:59)


GPIO: 13 (21:51:05)


GPIO: 14 (21:51:11)


GPIO: 15 (21:51:17)


GPIO: 16 (21:51:23)


GPIO: 17 (21:51:29)


GPIO: 18 (21:51:35)


GPIO: 19 (21:51:41)


GPIO: 20 (21:51:47)


GPIO: 21 (21:51:53)


GPIO: 22 (21:51:59)


GPIO: 23 (21:59:41)


GPIO: 24 (21:59:47)


GPIO: 25 (21:59:53)


GPIO: 26 (21:59:59)


GPIO: 27 (22:00:05)


GPIO: 28 (22:00:11)


GPIO: 29 (22:00:18)


GPIO: 30 (22:00:24)


GPIO: 31 (22:00:30)


GPIO: 32 (22:00:36)


GPIO: 33 (22:00:42)


GPIO: 34 (22:00:48)


GPIO: 35 (22:00:54)


GPIO: 36 (22:01:00)


GPIO: 37 (22:01:06)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio37/value: nonexistent directory


GPIO: 38 (22:01:12)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio38/value: nonexistent directory


GPIO: 39 (22:01:18)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio39/value: nonexistent directory


GPIO: 40 (22:01:24)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio40/value: nonexistent directory


GPIO: 41 (22:01:30)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio41/value: nonexistent directory


GPIO: 42 (22:01:36)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio42/value: nonexistent directory


GPIO: 43 (22:01:42)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio43/value: nonexistent directory


GPIO: 44 (22:01:48)
sh: write error: Resource busy
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/direction: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/value: nonexistent directory
test-gpio.sh: line 48: can't create /sys/class/gpio/gpio44/value: nonexistent directory


GPIO: 45 (22:01:54)


GPIO: 46 (22:02:00)


GPIO: 47 (22:02:06)


GPIO: 48 (22:02:12)


GPIO: 49 (22:02:18)


GPIO: 50 (22:02:25)


GPIO: 51 (22:02:31)


GPIO: 52 (22:02:37)


GPIO: 53 (22:02:43)


GPIO: 54 (22:02:49)


GPIO: 55 (22:02:55)


GPIO: 56 (22:03:01)


GPIO: 57 (22:03:07)


GPIO: 58 (22:03:13)


GPIO: 59 (22:03:19)


GPIO: 60 (22:03:25)


GPIO: 61 (22:03:31)


GPIO: 62 (22:03:37)


GPIO: 63 (22:03:43)


GPIO: 64 (22:03:49)


GPIO: 65 (22:03:55)


GPIO: 66 (22:04:01)


GPIO: 67 (22:04:07)


GPIO: 68 (22:04:13)


GPIO: 69 (22:04:20)


GPIO: 70 (22:04:26)

Niestety, nie udało mi się zaświecić ani żadnej diody, ani diody podłączonej pod różne goldpingy.

Sprawdziłem to jeszcze raz dokładnie:
- LTE/EVDO - zapaliła się po umieszczeniu modemu mPICe, więc jest ok
- 2.4G WIFI - zdefiniowana jest jako "/sys/class/leds/u7628-01:green:power", nawet mruga szybko w trybie "failover"
- POWER/SYS - tym próbowałem mrugnąć z "/sys/class/gpio/gpioXXX" i nie udało mi się to z żadnego numeru
- GPIO-6 - tutaj faktycznie znajduje się dioda "/sys/class/leds/u7628-01:green:wlan"
- "/sys/class/leds/u7628-01:green:usb" tego nie udało mi się znaleźć ani w ledach ani w goldpinach

Jak powinienem dostosować ten plik dtsi, aby wyjścia GOLDPIN były obsługiwane przez GPIO?

Zaprosiłem pepe2k do tej rozmowy. Nie wiem czy to zbyt śmiała propozycja, ale może chcielibyście mieć go na swoim stole? Jeżeli tak, mógłbym Wam go wysłać. To co jest w obecnym stanie to trochę bez sensu: pominę fakt, że nie działa USB i mPCIe równocześnie (nie sprawdzałem akurat tego), w sumie serial port jak dla mnie też leży, to pierwszy router w którym nie udało mi się połączyć przez ten port, ale dziwnym dla mnie jest niedziałające gniazdo na karty sd oraz wyprowadzenia tej karty w pinach GPIO.

Dzięki. Tak działa to obecnie:

Jeśli chodzi o LEDy, chciałem wyrzucić "wlan" oraz "usb", gdyż nie posiadam takich diod na przednim panelu. To nie powinno sprawić większych problemów. Powinienem dodać obsługę diody "LTE/EVDO", gdyż nie jestem w stanie w obecnym systemie zarządzać nią. Tylko nie wiem, skąd mam wiedzieć jaki nr. gpio nią zarządza. Napisałem skrypt, który zmienia mi stany logiczne dla gpio od 0 do 100 i nie udało mi się "mrygnąć" tym LEDem. Nie rozumiem też, dlaczego "u7628-01:green:power/", zarządza LEDem od WiFi. To tyle jeśli chodzi o diody, nie rozumiem dlaczego jest to tak namieszane w oficjalnym obrazie dla tego sprzętu.

Druga kwestia to GPIO. Cezary, ja nie jestem developerem, aby poradzić sobie z tak poważnymi zmianami w kernelu, dlatego tutaj jestem ponieważ chciałbym, aby moje urządzenie było sprawne. Więc proszę - nie odsyłaj mnie do "googli", skoro Twoje forum jest największym zrzeszeniem fanatyków tego oprogramowania w Polsce.

Wracając do ledów (zdjęcie):
1. zmieniam nazwę "power" na "wlan"
2. Usuwam "wlan", gdyż ten to nie LED, tylko PIN GPIO-6
3. Usuwam "usb", gdyż nie ma takiego LEDa na tej płycie
4. Nie wiem jak dodać "LTE/EVDO"

...
    gpio-leds {
        compatible = "gpio-leds";

        wlan {
            label = "u7628-01:green:power";
            gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
        };

        wan {
            label = "u7628-01:green:wan";
            gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
        };

        lan1 {
            label = "u7628-01:green:lan1";
            gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
        };

        lan2 {
            label = "u7628-01:green:lan2";
            gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
        };

        lan3 {
            label = "u7628-01:green:lan3";
            gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
        };

        lan4 {
            label = "u7628-01:green:lan4";
            gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
        };

        ????? {
            label = "u7628-01:green:?????";
            gpios = <&gpio????? ????? GPIO_ACTIVE_LOW>;
        };

    };
};
...

Rozumiem, że chodzi Ci o SDK. Pobrałem je i rozpakowałem:

wget http://downloads.openwrt.org/releases/1 … _64.tar.xz
tar xf openwrt-sdk-18.06.2-ramips-mt76x8_gcc-7.3.0_musl.Linux-x86_64.tar.xz

Jakie zmiany powinienem wprowadzić przed kompilacją? Czy uda się ustawić wszystkie te piny (8GPIO+3V3+GND) jako GPIO?