freeze NAS542

Hi ! after playing with debian I get a freeze NAS  (
connected the console.
The NAS keeps trying to boot from /dev/nand0.kernel2.bb and hangs externally.
 
I break the loop from the console and type "bootm /dev/nand0.kernel1.bb" . the first Linux is loaded, but also with nand errors, and then a reset by watchdog follows.
But this download picks up the recovery flash drive with the new firmware. cannot determine curr_bootfrom. What am I doing wrong ?

+ FW_FILE=/mnt/partnerkey/nas5xx_fw/ras.bin
+ NANDPATH=/firmware/mnt/nand2
+ /firmware/sbin/info_printenv curr_bootfrom
+ awk -F= {print $2}
+CURR_BOOTFROM=
+ [ -eq 1 ]
sh: 1: unknown operand
+ [ -eq 2 ]
sh: 2: unknown operand
+ echo ERROR!!! Invalid INFO value 'curr_bootfrom'!
ERROR!!! Invalid INFO value 'curr_bootfrom'!
+ setLED SYS RED BLINK
led_state_map_addr = 409
+setLED HD RED BLINK
«1

All Replies

  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    The 'curr_bootfrom' is read from the bootloader environment, which is stored in a nand flash partition. The bootloader has to provide a description of the flash partition in the command line, without that the flash partitions will not be available for the Linux kernel, and so neither for the tool info_printenv.
    Somewhere in the bootlog you can find the kernel command line. Here is the bootlog of a healthy 540. The command line can be found at about the 10th line after 'Uncompressing Linux... done, booting the kernel.'. If yours is different, you are facing a damaged bootloader environment, I think.

  • fffas
    fffas Posts: 9
    First Comment
    edited October 2022
    Thank you Mijzelf!
    here is the log of his usual boot. no beeps when starting. Connected disks are shown by LEDs on. reacts to the power button - gives beeps and after pressing it activates the network port closest to the power supply. reacts to the collection button - buzzes and writes a message about it to the log.

    on connected flash drives with recovery or network_and_telnet does not respond.

    I understand that your scripts are protected? I'm trying to edit the script and after that the system starts to swear at the md5sum mismatch (((

    I wanted to force it to NEXT_BOOTFROM=2 and run the firmware. it won't get any worse...
    2.txt 25.1K
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    And indeed your command line is not complete:
    [    0.000000] Kernel command line: console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,,
    vs.
    [    0.000000] Kernel command line: console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,, ip=dhcp root=ubi0:rootfs ubi.mtd=2,2048 rootfstype=ubifs rw noinitrd mtdparts=spi0.0:256k(uloader)ro,512k(barebox)ro,256k(env);comcertonand:10M(config),10M(kernel1),110M(rootfs1),10M(kernel2),110M(rootfs2),-(reserved) usb3_internal_clk=yes
    I understand that your scripts are protected?
    Yes. The firmware checks usb_key_func.sh against a checksum file. (Which is part of the mechanism, it's not imposed by me). More here. For the 'universal key' I bypassed that by letting the (protected) script usb_key_func.sh call another, unprotected one. The firmware flash stick is not mine, it's ZyXEL's. But of course you can use the 'universal key' to let it start the actual payload script, which you can edit.
    I wanted to force it to NEXT_BOOTFROM=2 and run the firmware. it won't get any worse...
    No, but it won't work either. The script has to update the contents of some flash partitions. But those partitions aren't there.
    on connected flash drives with recovery or network_and_telnet does not respond.
    Oh really? Are you using the right IP address? Others facing the same issue were able to get telnet access.

    Search the forum, others had the same problem. When I remember well someone found a way to flash an environment partition dump (which I can provide) from the bootloader shell, which solved the problem. Unfortunately it's not possible to do that from the telnet shell, as the target partition isn't there. Unfortunately I don't know the topic anymore.

  • fffas
    fffas Posts: 9
    First Comment
    edited October 2022
    ... when the system automatically starts itself from slot 2, I get a normal log-

    "Kernel command line: console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,, ip=dhcp root=ubi0:rootfs ubi.mtd=2,2048 rootfstype=ubifs rw noinitrd mtdparts=spi0.                    0:256k(uloader)ro,512k(barebox)ro,256k(env);comcertonand:10M(config),10M(kernel1),110M(rootfs1),10M(kernel2),110M(rootfs2),-(reserved) usb3_internal_clk=yes"

    if you stop it, and then give command "bootm /dev/nand0.kernel1.bb" or  "bootm /dev/nand0.kernel2.bb"- I get a stub -

    "Kernel command line: console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,,"              (((

    that's why the recovery flash is not loaded ... how to make the system automatically boot from slot 1?

    do you think that the download from slot 2 is online? then a very stupid question - how to find NAS  on the net?
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    When you automatically start it from slot2, does it boot to firmware? In that case you only have to perform a firmware update (from webinterface or upgrade stick) to switch to slot 1 (with the new firmware).
  • fffas
    fffas Posts: 9
    First Comment
    edited October 2022
    when automatically started from the second slot, the Serial port log ends at - 
    [    4.377343] [<8401287f>] (cpu_idle+0x77/0xa0) from [<846405eb>] (start_kernel+0x27b/0x284)
    [    4.385634] [<846405eb>] (start_kernel+0x27b/0x284) from [<0400804b>] (0x400804b)

    this line appears after pressing the shutdown button
    [ 473.998934] Power Off
    [ 474.001212] GPIO[15] is pull high for power off

    and it ignores loading from a flash drive. how to see it on the network (if it is there)?
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    That looks like a kernel error. Did you ever flash a custom kernel?
    how to see it on the network (if it is there)?
    When it stopped at 4.38 seconds, there will be no usermode processes running. So even if it is on the network, there is nothing useful to be done. Probably just ping.

    Maybe this will be interesting, a way to auto start the other slot.

  • fffas
    fffas Posts: 9
    First Comment
    Mijzelf said:Did you ever flash a custom kernel?

    No(( maybe there is an instruction or an example?

    my place looks like this
    # boot partition
    next_bootfrom = "2"
    curr_bootfrom = "1"
    Or do you mean swap 1 and 2 ? What is the keyboard shortcut for recording? exit Ctrd+D I know this.
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Or do you mean swap 1 and 2 ?

    Yes. Each time you flash a new firmware these are swapped. As your slot 1 kernel boots, and your slot 2 doesn't, it could help to auto boot the other kernel.

    What is the keyboard shortcut for recording?
    Recording? Recording what?
  • fffas
    fffas Posts: 9
    First Comment
    sorry for stupid questions - this is not my main profile at all )

     I stop the autoboot -

    Hit any key to stop autoboot:  2usage: update -t <kernel|rootfs|barebox|bareboxenv> -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] -cupdate tools.
    options -c     to check the crc32 for the image and flashed one
    default mode is tftptype update -t uloader -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update uloader into flashtype update -t barebox -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update barebox into flashtype update -t kernel -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update kernel into flashtype update -t rootfs -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update rootfs into flashtype update -t bareboxenv -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update bareboxenv into flashBarebox-C2K >/
     what is the command line for the correct continuation of the download?

Consumer Product Help Center