Fortigate 30E flash ends up in recovery (initramfs) mode

Flashed Fortinet Fortigate 30E from the product page https://openwrt.org/toh/hwdata/fortinet/fortinet_fortigate_30e

ends up with no luci, so I installed it manually, then got on the UI:

System running in recovery (initramfs) mode.

No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade

Tried to install the initramfs and the upgrade on top of it, but this didn't work. Either broke the machine or ended up in the same place.

What am I missing?
The device has 1GB of SD.
thanks

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=b7c12a9bfc01067f167ff805acdc1411d798b977 ?

not 100% clear which image was used for the 2nd part.

if everything else fails, try serial.

Thanks @frolic for your answer!!
Here is a better explanation where I get stuck:

steps 1-9 (deploying the initramfs, loading the 2nd image (fg-30e-squashfs-sysupgrade.bin) and sysupgrade it work.

But then the system boots itself into void (as can be seen in the logs):
No dtb image in there. Try more
Initializing firewall...

here is what I did:

root@OpenWrt:~# 
root@OpenWrt:~# wget https://downloads.openwrt.org/snapshots/targets/mvebu/corte
xa9/openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sysupgrade.bin
Downloading 'https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9/openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sysupgrade.bin'
Connecting to 199.232.82.132:443
Writing to 'openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sysupgrade.bin'
openwrt-mvebu-cortex 100% |*******************************|  6270k  0:00:00 ETA
Download completed (6420794 bytes)
root@OpenWrt:~# 
root@OpenWrt:~# ls -l
-rw-r--r--    1 root     root       6420794 Aug 30 11:02 openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sysupgrade.bin
root@OpenWrt:~# 
root@OpenWrt:~# sysupgrade ./openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sys
upgrade.bin 
Fri Aug 30 11:03:08 UTC 2024 upgrade: Image not in /tmp, copying...
Cannot save config while running from ramdisk.
Fri Aug 30 11:03:09 UTC 2024 upgrade: Commencing upgrade. Closing all shell sessions.
Hangup
-ash: can't set tty process group: Not a tty
[1]+  Hangup                     sysupgrade ./openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sysupgrade.bin
root@OpenWrt:~# Watchdog handover: fd=3
- watchdog -
Watchdog does not have CARDRESET support
Fri Aug 30 11:03:09 UTC 2024 upgrade: Sending TERM to remaining processes ...
Fri Aug 30 11:03:09 UTC 2024 upgrade: Sending signal TERM to netifd (1631)
Fri Aug 30 11:03:13 UTC 2024 upgrade: Sending KILL to remaining processes ...
Fri Aug 30 11:03:13 UTC 2024 upgrade: Sending signal KILL to netifd (1631)
[  391.900341] stage2 (3462)op_caches: Fri Aug 30 11:03:21 UTC 2024 upgrade: Switching to ramdisk...
Fri Aug 30 11:03:22 UTC 2024 upgrade: Performing system upgrade...
fwinfo: offset-> 0x184, blocks-> 0x1ee8 (len: 0x003dce83)
1+0 records in
1+0 records out
fwinfo: offset-> 0x18c, blocks-> 0x1201 (len: 0x00240004)
1+0 records in
1+0 records out
Unlocking kernel ...

Writing from <stdin> to kernel ...     
Unlocking rootfs ...

Writing from <stdin> to rootfs ...     
Appending jffs2 data from /tmp/sysupgrade.tgz to rootfs..
.File /tmp/sysupgrade.tgz does not exist
    
Fri Aug 30 11:03:56 UTC 2024 upgrade: Upgrade completed
Fri Aug 30 11:03[  427.263441] reboot: Restg syst

FortiGate-30E (12:44-07.08.2016)
Ver:05000014
Serial number: FGT30E3U16022597
CPU(00): 1332MHz
Total RAM: 1GB
Initializing boot device...
Initializing MAC... egiga0
Please wait for OS to boot, or press any key to display configuration menu..........

Booting OS...

Reading boot image... 4050944 bytes.
No dtb image in there. Try more
Initializing firewall...

Same here. Stuck in Initializing firewall...

@musashino it's your commit, can you provide assistance?

1 Like

you stay on root folder, them you do cd /tmp and after wget & sysupgrade
cheers

I noticed it too, but that's why it says copying ... ?

like that :wink:

Please try to switch partition for booting.

  1. open the bootmenu
  2. select [B]: Boot with backup firmware and set as default.

Note:

and

are not related to this issue.

The mtd partitions mounted to / and others will be unmounted and those are unusable while upgrading by sysupgrade, so the image will be copied to /tmp/ before upgrading.

And, user configurations won't be kept on sysupgrade while running initramfs image and /tmp/sysupgrade.tgz won't be generated. So that error will be showed.

1 Like

first of all, thanks for your time @musashino

I tried the way you sent, but still the same. After apply the openwrt-mvebu-cortexa9-fortinet_fg-30e-squashfs-sysupgrade.bin image, it boots itself and then stuck in initializing firewall.

Using R or B the result is the same.

Captura de tela 2024-08-30 111743

Thank you musashino for your replay. Hitting B says there is no backup.

What am I missing?

Please check the baudrate of console:

bootmenu ---> [I]: System information. ---> [S]: Set serial port baudrate.

If it is set to anything other than 9600bps, set it to 9600bps. Only that baudrate is supported on OpenWrt for FortiGate/FortiWiFi devices.

And, don't use D or B on Save as Default firmware/Backup firmware/Run image without saving:[D/B/R]? prompt. initramfs/sysupgrade images are not for direct flashing.

BTW, I tried the steps in the commit on my FG-30E with the official firmware images, but the problem in this topic did not reoccur.

So, I think the problem is my fortigate box.

I did everything as you said and my fortigate stopped in initializing firewall again.

Baudrate is 9600
image initramfs applied using R option on Save as Default firmware/Backup firmware/Run image without saving:[D/B/R]
image squashfs-sysupgrade applied

after boot, stucks in Initializing firewall...

I quit.

By the way, thanks again for your time.

Same problem on FortiGate 50E.
I bought 10 FortiGate 50E devices, and 4 devices have this problem.

I still haven’t solved the problem, but I’ve left my work notes.

then it should be possible to compare the working and the non working ones ?