176

Odp: Netgear LBR20 Orbi

Wpadłem , że to będzie ubi0_0 ....
Ręcznie sformatowałem to ubi , i przy starcie już o tym nie pisze , ale za to jest jakiś panic:

[    1.908772] ubi0: attaching mtd23
[    2.212353] ubi0: scanning is finished
[    2.220118] ubi0: attached mtd23 (name "ubifs", size 56 MiB)
[    2.220168] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    2.224862] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.231588] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    2.238405] ubi0: good PEBs: 450, bad PEBs: 0, corrupted PEBs: 0
[    2.245193] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    2.251440] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 2942612546
[    2.258461] ubi0: available PEBs: 0, total reserved PEBs: 450, PEBs reserved for bad PEB handling: 40
[    2.267785] ubi0: background thread "ubi_bgt0d" started, PID 137
[    2.268652] block ubiblock0_0: created from ubi0:0(rootfs)
[ [    2.298356] UBIFS (ubi0:0): default file-system created
[    2.298986] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    2.302674] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 138
[    2.359055] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[    2.359117] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.365606] UBIFS (ubi0:0): FS size: 4063232 bytes (3 MiB, 32 LEBs), max 42 LEBs, journal size 1015809 bytes (0 MiB, 6 LEBs)
[    2.375378] UBIFS (ubi0:0): reserved for root: 191915 bytes (187 KiB)
[    2.386651] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 9F3FBBF6-A2F8-499D-9895-FBA8E3A8A590, small LPT model
[    2.393726] VFS: Mounted root (ubifs filesystem) on device 0:13.
[    2.406338] Freeing unused kernel image (initmem) memory: 1024K
[    2.410603] Run /sbin/init as init process
[    2.416216] Run /etc/init as init process
[    2.420390] Run /bin/init as init process
[    2.424354] Run /bin/sh as init process
[    2.428332] Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[    2.431883] CPU3: stopping
[    2.431893] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 6.1.73 #0
[    2.431906] Hardware name: Generic DT based system

i się resetuje

177

Odp: Netgear LBR20 Orbi

Ty chyba nadpisałeś bootargs zamiast dodać przez bootargs-append?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

178

Odp: Netgear LBR20 Orbi

i skąd bierze to  FS size: 4063232 bytes (3 MiB, 32 LEBs) , ja podzieliłem to ręcznie tak:

ubimkvol /dev/ubi0 -N rootfs -s 5MiB
ubimkvol /dev/ubi0 -N rootfs_data -m

179

Odp: Netgear LBR20 Orbi

Cezary napisał/a:

Ty chyba nadpisałeś bootargs zamiast dodać przez bootargs-append?

apend...tak teraz po poprawce jest ( było *ubiblock0_0*)

    chosen {

        bootargs-append = "ubi.mtd=ubifs root=/dev/ubi0_0 rootfstype=squashfs ro";
        
        
    };

180

Odp: Netgear LBR20 Orbi

Generalnie sobie sam tego ubi nie przygotowuje ( sam musiałem zrobić mtd erase ubi" , żeby się robiło ubiattach , ale już voluminów też nie zakłada sam , zrobiłem je powyższymi komendami , może są złe ?

Próbowałem ręcznie w initramfs uruchomiś /sbin/init i też zwiecha:

root@OpenWrt:/# /sbin/init
[  289.335597] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[  289.338005] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[  289.343305] init: - preinit -
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[  291.694288] UBIFS (ubi0:1): default file-system created
[  291.694929] UBIFS (ubi0:1): Mounting in unauthenticated mode
[  291.698533] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 2419
[  291.760301] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[  291.760366] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[  291.767146] UBIFS (ubi0:1): FS size: 44949504 bytes (42 MiB, 354 LEBs), max 364 LEBs, journal size 2285568 bytes (2 MiB, 18 LEBs)
[  291.777095] UBIFS (ubi0:1): reserved for root: 2123076 bytes (2073 KiB)
[  291.788702] UBIFS (ubi0:1): media format: w5/r0 (latest is w5/r0), UUID 05A78B94-934F-4725-BF42-3AF594980F6A, small LPT model
[  291.797305] mount_root: overlay filesystem has not been fully initialized yet
[  291.807338] mount_root: switching to ubifs overlay
[  291.819895] urandom-seed: Seeding with /etc/urandom.seed
[  291.850103] qca8k-ipq4019 c000000.switch lan: Link is Down
[  291.850732] br-lan: port 1(lan) entered disabled state
[  291.917969] procd: Failed to add object: Invalid argument

i tak wisi

181

Odp: Netgear LBR20 Orbi

Ale od początku: co właściwie chcesz zrobić?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

182

Odp: Netgear LBR20 Orbi

Z tym co teraz stworzyłem  (czyli osobna partycja na kernel  , osobna o nazwie ubifs) po wgraniu img przez nmrp się notorycznie restartuje ( choć się już cały czas bootuje).
Najpierw przez to ,że wogóle nie był sformatowana partycja pod ubi i nie mógł zrobić ubiattach ( więc w initramfs ją po prostu wyczyściłem "mtd erase ubifs") ,a także (myślałem ,że przez to ) ,że root był przypisany w tych args jako ubiblock..  ,a tu się pojawia jako ubi0...  .
Po tym ubiattach działało , ale dalej nie było volumentów na niej więc dalej non stop się restartował.
Więc założyłem w initramfs te volumeny wyżej wymienionymi komendami ( nie wiem czy źle , czy dobrze) , i zaczął je dowiązywać , ale teraz jakiegoś sync brakuje , więc może trzeba je jeszcze wcześniej sformatować czy jak....

A chciałbym w końcu ,żeby się uruchomił , a nie restartował smile

183

Odp: Netgear LBR20 Orbi

próbowałem jeszcze opcję rootwait w bootargs , ale wtedy czeka ,a ubi się nie podłączyło jescze..

184

Odp: Netgear LBR20 Orbi

Jak wygląda printenv w u-boot? Ten sam problem jest z RBR50v2...

185

Odp: Netgear LBR20 Orbi

(IPQ40xx) # printenv
baudrate=115200
bootcmd=mii write 0x3 0x0 0x800; sleep 3; nmrp; load_chk_dniimg 0x84000000; setenv fdt_high 0x87000000; bootm 0x84000000
bootdelay=1
delenv=nand erase 0x680000 0x80000
ethact=eth0
flash_type=2
ipaddr=192.168.1.1
loadaddr=0x84000000
machid=8010001
serverip=192.168.1.10
stderr=serial
stdin=serial
stdout=serial

Environment size: 353/262140 bytes
(IPQ40xx) #

186

Odp: Netgear LBR20 Orbi

Ktoś robił jakieś podejścia do RBR50v2 ?

Generalnie nie wiem co to oznacza....
Czy może pchać się dalej i rootfs robić w squash , a rootfs_data w ubi ?

187

Odp: Netgear LBR20 Orbi

Na openwrt jest opisana próba ale za zasadzie wgrania obrazu z v1: https://forum.openwrt.org/t/netgear-orb … 135959/23, co oczywiście nie działa.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

188

Odp: Netgear LBR20 Orbi

W u-boot można znaleźć coś takiego:

Loading firmware %d ...
if iminfo 0x%lX; then echo kernel checksum OK !;if iminfo 0x%lX; then echo rootfs checksum OK !;boot_partition_set 1;true;else echo rootfs checksum error !!!;fw_recovery;false;fi;else echo kernel checksum error !!!;fw_recovery;false;fi;
if iminfo 0x%lX; then echo kernel checksum OK !;if iminfo 0x%lX; then echo rootfs checksum OK !;boot_partition_set 2;true;else echo rootfs checksum error !!!;fw_recovery;false;fi;else echo kernel checksum error !!!;fw_recovery;false;fi;
if iminfo 0x%lX; then echo kernel checksum OK !;if iminfo 0x%lX; then echo rootfs checksum OK !;;true;else echo rootfs checksum error !!!;;false;fi;else echo kernel checksum error !!!;;false;fi;
Loading DNI firmware for checking...
iminfo
print header information for application image
addr [addr ...]
    - print header information for application image starting at
      address 'addr' in memory; this includes verification of the
      image contents (magic number, header and payload checksums)
bootm
boot application image from memory
[addr [arg ...]]
    - boot application image stored in memory
    passing arguments 'arg ...'; when booting a Linux kernel,
    'arg' can be the address of an initrd image
    When booting a Linux kernel which requires a flat device-tree
    a third argument is required which is the address of the
    device-tree blob. To boot that kernel without an initrd image,
    use a '-' for the second argument. If you do not pass a third
    a bd_info struct will be passed instead
For the new multi component uImage format (FIT) addresses
    must be extened to include component or configuration unit name:
    addr:<subimg_uname> - direct component image specification
    addr#<conf_uname>   - configuration specification
    Use iminfo command to get the list of existing component
    images and configurations.
Sub-commands to do part of the bootm sequence.  The sub-commands must be
issued in the order below (it's ok to not issue all sub-commands):
    start [addr [arg ...]]
    loados  - load OS image
    fdt     - relocate flat device tree
    cmdline - OS specific command line processing/setup
    bdt     - OS specific bd_t processing
    prep    - OS specific prep before relocation or go
    go      - start OS

Co zwraca iminfo?

189

Odp: Netgear LBR20 Orbi

frutis napisał/a:

Co zwraca iminfo?

W poście 152 jest

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

190

Odp: Netgear LBR20 Orbi

Wg helpa:
iminfo  - print header information for application image

A zwraca to

(IPQ40xx) # iminfo

## Checking Image at 84000000 ...
   FIT image found
   FIT description: ARM OpenWrt FIT (Flattened Image Tree)
    Image 0 (kernel-1)
     Description:  ARM OpenWrt Linux-6.1.73
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x840000e4
     Data Size:    3257024 Bytes = 3.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80208000
     Entry Point:  0x80208000
     Hash algo:    crc32
     Hash value:   2ae9fbe3
     Hash algo:    sha1
     Hash value:   dc10d2a89e10d53df13379dbcfd54d06f7371a08
    Image 1 (fdt-1)
     Description:  ARM OpenWrt netgear_lbr20 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x8431b4dc
     Data Size:    20236 Bytes = 19.8 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   3d1ed250
     Hash algo:    sha1
     Hash value:   48b5d0dfcd4cfb311cce9ad99320433ccf23e997
    Default Configuration: 'config@1'
    Configuration 0 (config@1)
     Description:  OpenWrt netgear_lbr20
     Kernel:       kernel-1
     FDT:          fdt-1
## Checking hash(es) for FIT Image at 84000000 ...
   Hash(es) for Image 0 (kernel-1): crc32+ sha1+
   Hash(es) for Image 1 (fdt-1): crc32+ sha1+
(IPQ40xx) # 

191

Odp: Netgear LBR20 Orbi

Ale to jest odpowiedź wtedy kiedy przechodzi to sprawdzenie po pierwszym wgraniu czy kiedy już nie startuje?

192 (edytowany przez MiG25 2024-01-26 22:13:05)

Odp: Netgear LBR20 Orbi

Cezary napisał/a:
frutis napisał/a:

Co zwraca iminfo?

W poście 152 jest

Prawie , tak było wczoraj , dziś drugi adres jest inny :

(IPQ40xx) # load_chk_dniimg
Loading DNI firmware for checking...
Loading firmware 1 ...

NAND read: device 0 offset 0xa600000, size 0x20000
 131072 bytes read: OK

NAND read: device 0 offset 0xa600000, size 0x340000
 3407872 bytes read: OK
dniimg_len is 3407872 (aligned to 3407872)

NAND read: device 0 offset 0xa600000, size 0x340000
 3407872 bytes read: OK
if iminfo 0x84000000; then echo kernel checksum OK !;if iminfo 0x8433FFC0; then echo rootfs checksum OK !;;true;else echo rootfs checksum error !!!;;false;fi;else echo kernel checksum error !!!;;false;fi;
## Checking Image at 84000000 ...
   FIT image found
   FIT description: ARM OpenWrt FIT (Flattened Image Tree)
    Image 0 (kernel-1)
     Description:  ARM OpenWrt Linux-6.1.73
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x840000e4
     Data Size:    3257024 Bytes = 3.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80208000
     Entry Point:  0x80208000
     Hash algo:    crc32
     Hash value:   2ae9fbe3
     Hash algo:    sha1
     Hash value:   dc10d2a89e10d53df13379dbcfd54d06f7371a08
    Image 1 (fdt-1)
     Description:  ARM OpenWrt netgear_lbr20 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x8431b4dc
     Data Size:    20236 Bytes = 19.8 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   3d1ed250
     Hash algo:    sha1
     Hash value:   48b5d0dfcd4cfb311cce9ad99320433ccf23e997
    Default Configuration: 'config@1'
    Configuration 0 (config@1)
     Description:  OpenWrt netgear_lbr20
     Kernel:       kernel-1
     FDT:          fdt-1
## Checking hash(es) for FIT Image at 84000000 ...
   Hash(es) for Image 0 (kernel-1): crc32+ sha1+
   Hash(es) for Image 1 (fdt-1): crc32+ sha1+
kernel checksum OK !

## Checking Image at 8433ffc0 ...
   Legacy image found
   Image Name:   OpenWrt fake filesystem
   Image Type:   ARM Linux Filesystem Image (uncompressed)
   Data Size:    0 Bytes = 0 Bytes
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
rootfs checksum OK !
(IPQ40xx) #

Coś go ewidentnie zmienia ,  i zapisuje się albo w mtd13 albo mtd 15.... Tylko te zmieniły CRC od początku moich prób ( nie licząc oczywiście mtd21 i wyżej...)

193

Odp: Netgear LBR20 Orbi

Zmienił się rozmiar kernela:
- Data Size:    4592661 Bytes = 4.4 MiB (poprzedni post)
- Data Size:    3257024 Bytes = 3.1 MiB (nowy post)

194

Odp: Netgear LBR20 Orbi

frutis napisał/a:

Ale to jest odpowiedź wtedy kiedy przechodzi to sprawdzenie po pierwszym wgraniu czy kiedy już nie startuje?

Akurat dziś , po zrobieniu kernela jako squash  startuje za każdym razem , kernel ma rozmiar 3c0000  ,a ten sprawdza w 340000 .... Więc dopuki kernel się nie zmieni startuje za każdym razem.

Przy wczorajszych próbach ten adres był większy , no i crc po pierwszym starcie siłą rzeczy się zmieniało ,stąd za drugim razem był bład crc i już drugiego razu nie było.

195

Odp: Netgear LBR20 Orbi

Ale jeśli OpenWrt modyfikuje partycje rootfs przy pierwszym uruchomieniu to i tak tego nie da się przeskoczyć.
A jakie komendy zwraca help?

196

Odp: Netgear LBR20 Orbi

Przy okazji te  3c0000 to nie za mało na kernel ?

197 (edytowany przez MiG25 2024-01-26 22:21:04)

Odp: Netgear LBR20 Orbi

frutis napisał/a:

Ale jeśli OpenWrt modyfikuje partycje rootfs przy pierwszym uruchomieniu to i tak tego nie da się przeskoczyć.
A jakie komendy zwraca help?

Tak , ale jak widzisz teraz nie sprawdza rootfs , sprawdza tylko kernel . Więc dopuki kernela się nie zmieni ( czyli aktualizacja ) będzie ok . Aktualizację można robić najwyżej nmrp ( bo wtedy od nowa są sprawdzenia) , albo znajdzie się gdzieś , gdzie to zapisane jest ( np wyzeruje).

(IPQ40xx) # help
?       - alias for 'help'
base    - print or set address offset
board_backhaul_passphrase_set- Set backhaul passphrase on board
board_backhaul_passphrase_show- Show board_backhaul_passphrase
board_backhaul_ssid_set- Set backhaul ssid on board
board_backhaul_ssid_show- Show board_backhaul_ssid
board_data_set- Set board data on board
board_data_show- Show board_data
board_hw_id_set- Set board_hw_id
board_hw_id_show- Show board_hw_id
board_model_id_set- Set board_model_id
board_model_id_show- Show board_model_id
board_parameters_set- Set WPS PIN code, Serial number, SSID, Passphrase, Board data, MAC address
board_parameters_show- Show WPS PIN code, Serial number, SSID, Passphrase, Board data, MAC address.
board_passphrase_set- Set passphrase on board
board_passphrase_show- Show board_passphrase
board_ssid_set- Set ssid on board
board_ssid_show- Show board_ssid
boot_partition_set- Set boot partition data on board
boot_partition_show- Show boot partition
bootcheck- boot check crashdump
bootipq - bootipq from flash device
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
button_test- Test buttons
chpart  - change active partition
cmp     - memory compare
cp      - memory copy
crashdump_switch_set- set 1/0 to enable/disable crashdump_switch on board
crashdump_switch_show- Show current crashdump_switch
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
dnisetenvmem- set environment variable from memory
dumpipq_data- dumpipq_data crashdump collection from memory
dumpipq_flash_data- dumpipq_flash_data crashdump collection and storing in flash
echo    - echo args to console
env     - environment handling commands
exit    - exit script
false   - do nothing, unsuccessfully
fdt     - flattened device tree utility commands
fuseipq - fuse QFPROM registers from memory

fw_recovery- start tftp server to recovery dni firmware image.
fw_recovery_second- start tftp server to recovery dni firmware image.
go      - start application at address 'addr'
help    - print command description/usage
i2c     - I2C sub-system
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
incenv  - increment environment variable
led_i2c_reset- Reset all leds, please use ledctl to 'light' led.
led_i2c_reset_to_blink- Reset all leds, please use ledctl to 'blink' led.
led_i2c_reset_to_dimming- Reset all leds to not 'blink'.
ledctl  - ledctl - on/off LEDs.
load_chk_dniimg- load & check integrity of dni firmware image.
loadb   - load binary file over serial line (kermit mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
macset  - Set ethernet MAC address
macshow - Show ethernet MAC addresses
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
nmrp    - start nmrp mechanism to upgrade firmware-image or string-table.
pci     - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
reset   - Perform RESET of the CPU
rnset   - set region number
rnshow  - Show Region Number on Board
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sf      - SPI flash sub-system
showvar - print local hushshell variables
sleep   - delay execution for some time
smeminfo- print SMEM FLASH information
snset   - Set serial number
source  - run script from memory
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
tftpput - TFTP put command, for uploading files to a server
true    - do nothing, successfully
uartrd  - uartrd read from second UART
uartwr  - uartwr to second UART
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
wpspinset- Set wpspin number
(IPQ40xx) #

198

Odp: Netgear LBR20 Orbi

Koniecznie trzeba to znaleźć bo inaczej nie zrobisz sysupgrade  z zachowaniem zmian. Ciekawe jest to dlaczego teraz sprawdza mniejszy obszar.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

199 (edytowany przez MiG25 2024-01-26 22:32:04)

Odp: Netgear LBR20 Orbi

Teraz , wgywam naście razy img przez nmrp , i ten ubi jest nietknięty . Więc uaktualnienie przez nmrp bez zmian chyba jest możliwe. 
O ile ten kernel zacząłby w końcu czytać to ubi...

EDIT: A zrobię sysupgrade z  initramfs i od razu nie startuje bo inne crc....

EDIT2: Jutro spróbuję zczytać mtd13 i mtd15 po czym wgrać nmrp jakiś img , i nie dać mu się odpalić tylko uruchomić initramfs i jeszcze raz je zczytać i porównać .  Wtedy będzie widać co się zmienia.

200

Odp: Netgear LBR20 Orbi

Jest tam jeszcze bootipq i nboot ale nie wiem czy dało by się tego użyć.