Firstboot takes a different amount of time

Hello,

i am currently investigating why the very first boot processes after flashing a new firmware take much longer than the boots afterwards and why a firstboot sometimes takes different lengths of time on the same device.

I am using a 8devices Carambola2 DVK and flashing OpenWrt 23.05.2.

Firstboot: 150 seconds
Secondboot: 70 seconds

The times are measured from connecting the power supply to the first ping answer.

The update is made via the luci webinterface.

When i compare the bootlog of the first and the following boot processes i notice a difference regarding jffs2.

Firstboot:

[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.337794] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[   14.053569] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[  105.677955] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[  105.683434] jffs2_build_filesystem(): unlocking the mtd device...
[  105.691453] jffs2_build_filesystem(): erasing all blocks after the end marker...
[  148.574577] jffs2: notice: (1829) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

Secondboot:

[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.337794] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[   14.119342] jffs2: notice: (600) jffs2_build_xattr_subsystem: complete building xattr subsystem, 7 of xdatum (0 unchecked, 1 orphan) and 8 of xref (1 dead, 0 orphan) found.
[   14.136240] mount_root: switching to jffs2 overlay

Is jffs2 the reason for the difference as the flash memory is scanned?
Is there anything i could do to speed up the firstboot?

A random SSH key is generated. This can take a random amount of time.

you are answering your own question ...

2 Likes

Thanks for the quick reply and confirmation. But is there any way to speed this up or make the network available sooner?

Change the order in which the services are started, or disable everything you don't need, start it after the device's booted, in rc.local.

2 Likes

Not really, this kind of housekeeping has to be done under firstboot conditions. So other than changing the hardware and/ or improving entropy...

Rearranging the startup scripts did the trick.

I set the startup priorities of sysfixtime and urngd to 05 which were previously at 00. the priority of the network startup script is now 00 which was previously at 20. Network now starts about 60 seconds after connecting the power supply. This is independent of whether it is the firstboot or not. Which is absolutely good. I will check if everything else works.

Thanks to everyone who participated for the quick and constructive answers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.