Increasing EA8500 / EA7500 kernel size to enable builds?

@eginnc @t3hn00b
Sounds great so far.

Could you please test again sysupgrading from 21.02 (or normal 3 MB master):
I added the compatibility version check and a message that gets shown if you try to sysupgrade with the sysupgrade image.

  • trying to sysupgrade from 21.02 with a new sysupgrade image should fail and give you a warning message telling you to use the factory image.
  • sysupgrading further from a new 4 MB build to the next, should work normally

I uploaded the new images to Dropbox.

(commit can be seen in https://github.com/hnyman/openwrt/commit/cca222ca27013745886756b563fe86ac7d4c31b0 )

EDIT:
I created a pull request about these changes:

I can confirm your new sysupgrade image gives the warning on my "production" EA8500 AP running a 3MB snapshot.

From the command line:

BusyBox v1.35.0 (2022-02-11 22:17:40 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r18795-c391dcdf86
 -----------------------------------------------------
root@EA8500:~# cd /tmp
root@EA8500:/tmp# ls *.bin
openwrt-ipq806x-generic-linksys_ea8500-squashfs-sysupgrade.bin
root@EA8500:/tmp# sysupgrade -v /tmp/*.bin
Wed Feb 23 19:11:23 EST 2022 upgrade: The device is supported, but this image is incompatible for sysupgrade based on the image version (1.0->2.0).
Wed Feb 23 19:11:24 EST 2022 upgrade: *** Kernel partition size has changed from earlier versions. You need to sysupgrade with the OpenWrt factory image and use the force flag when image check fails. Settings will be lost. ***
Image check failed.
root@EA8500:/tmp#

and from LuCI:

And for the other half of it on the EA8500....

I confirmed I received the warning message attempting to flash your new 4MB sysupgrade from your old 4MB image.

After flashing your new 4MB factory image, I confirmed I did NOT receive the warning message when flashing your new 4MB sysupgrade image:

BusyBox v1.35.0 (2022-02-23 17:14:59 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r18953-b9251e3b40
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# cd /tmp
root@OpenWrt:/tmp# ls *upgr*.bin
openwrt-ipq806x-generic-linksys_ea8500-squashfs-sysupgrade.bin
root@OpenWrt:/tmp# sysupgrade -v /tmp/openwrt-ipq806x-generic-linksys_ea8500-squashfs-sysupgrade.bin
Wed Feb 23 19:20:43 EET 2022 upgrade: Saving config files...
etc/collectd.conf
etc/config/collectd
etc/config/dhcp
etc/config/dropbear
etc/config/firewall
etc/config/fstab
etc/config/luci
etc/config/luci_statistics
etc/config/network
etc/config/openssl
etc/config/rpcd
etc/config/system
etc/config/ubootenv
etc/config/ucitrack
etc/config/uhttpd
etc/config/wireless
etc/dropbear/dropbear_ed25519_host_key
etc/dropbear/dropbear_rsa_host_key
etc/fw_env.config
etc/group
etc/hosts
etc/inittab
etc/luci-uploads/.placeholder
etc/nftables.d/10-custom-filter-chains.nft
etc/nftables.d/README
etc/opkg/keys/17ec14f0d1558824
etc/opkg/keys/b5043e70f9a75cde
etc/passwd
etc/profile
etc/rc.local
etc/shadow
etc/shells
etc/shinit
etc/sysctl.conf
etc/uhttpd.crt
etc/uhttpd.key
etc/uhttpd.key
etc/uhttpd.crt
Wed Feb 23 19:20:43 EET 2022 upgrade: Commencing upgrade. Closing all shell sessions.
Command failed: Connection failed
root@OpenWrt:/tmp# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

Time to put a fork in it and call it done?

EDIT: I also noticed (a little late) that you included LuCI in your new 4MB builds. I was able to do an "opkg update" successfully, but things got a little dicey trying to install my favorite packages - not unexpected. Lots of "* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.10.100-1-d7e200f5b925ad7d1616d927c28f37fb) for..." etc. messages on configuration. I'll put this device aside until I see your PR accepted.

Many thanks for working on this and keeping these devices supported!

unfortunately not quite. :slightly_frowning_face: Linksys didn't include uboot sources (or at least I'm unable to find it?) so behind the "bootipq" could still be a lurking "size check".

The EA7500-v1 and EA8500 kernel sizes are 3054276 Bytes ( = 2983 KiB), which is below the 3072KiB barrier. This is because the OpenWrt Buildbot will include all the in-tree and out-of-tree kmods (CONFIG_ALL_KMODS). Some of these kmods enable extra kernel subsystems (sound, input, RTC, block, iio) and not all of the subsystems are/can be packaged as modules but get integrated into the kernel.

I'll see if I can provide some extra "bloated" images tomorrow evening (CET).

@t3hn00b @eginnc

Well, apparently not quite yet :frowning:

@chunkeey noted that the kernel in previous test builds was slightly smaller than the 3 MB limit. So, although the rootfs start was pushed back to 4 MB in the image, it is still possible that the u-boot bootloader has an internal max. size of 3 MB defined for the kernel, and the boot would fail if the kernel size exceeds it.

See discussion in https://github.com/openwrt/openwrt/pull/9319

So, I added a few unneeded file systems and crypto algorithms to the built kernel, and rebuilt, so that the kernel+DTS now takes 3.5 MB (upto 0x0038cb10 in the factory image)

So, could you test once more... Just flashing the factory image should be enough. Does it reboot ok?

1 Like

The latest factory image also flashed (I needed to sysupgrade -F -n) and rebooted just fine on my EA8500. Here are the results of the commands you previously requested:

BusyBox v1.35.0 (2022-02-24 21:51:46 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r18967-cf346dfadf
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 7.0M      7.0M         0 100% /rom
tmpfs                   231.6M     76.0K    231.6M   0% /tmp
/dev/ubi0_1              21.4M     56.0K     20.2M   0% /overlay
overlayfs:/overlay       21.4M     56.0K     20.2M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00020000 "SBL1"
mtd1: 00140000 00020000 "MIBIB"
mtd2: 00140000 00020000 "SBL2"
mtd3: 00280000 00020000 "SBL3"
mtd4: 00120000 00020000 "DDRCONFIG"
mtd5: 00120000 00020000 "SSD"
mtd6: 00280000 00020000 "TZ"
mtd7: 00280000 00020000 "RPM"
mtd8: 00140000 00020000 "art"
mtd9: 00100000 00020000 "APPSBL"
mtd10: 00040000 00020000 "u_env"
mtd11: 00040000 00020000 "s_env"
mtd12: 00040000 00020000 "devinfo"
mtd13: 02800000 00020000 "kernel1"
mtd14: 02400000 00020000 "rootfs1"
mtd15: 02800000 00020000 "kernel2"
mtd16: 02400000 00020000 "rootfs2"
mtd17: 02080000 00020000 "syscfg"
root@OpenWrt:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:62
Present UBI devices:            ubi0

ubi0
Volumes count:                           2
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     288 (36569088 bytes, 34.8 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     2
Minimum input/output unit size:          2048 bytes
Character device major/minor:            247:0
Present volumes:                         0, 1

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        57 LEBs (7237632 bytes, 6.9 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 247:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        207 LEBs (26284032 bytes, 25.0 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 247:2
root@OpenWrt:~#                                                                                                         
1 Like

@hnyman @chunkeey

I also flashed the new sysupgrade image on my spare EA8500 for completeness. Again - worked fine, booted right up with no issues.

BusyBox v1.35.0 (2022-02-24 21:51:46 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r18967-cf346dfadf
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 7.0M      7.0M         0 100% /rom
tmpfs                   231.6M     76.0K    231.6M   0% /tmp
/dev/ubi0_1              21.4M     64.0K     20.2M   0% /overlay
overlayfs:/overlay       21.4M     64.0K     20.2M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00020000 "SBL1"
mtd1: 00140000 00020000 "MIBIB"
mtd2: 00140000 00020000 "SBL2"
mtd3: 00280000 00020000 "SBL3"
mtd4: 00120000 00020000 "DDRCONFIG"
mtd5: 00120000 00020000 "SSD"
mtd6: 00280000 00020000 "TZ"
mtd7: 00280000 00020000 "RPM"
mtd8: 00140000 00020000 "art"
mtd9: 00100000 00020000 "APPSBL"
mtd10: 00040000 00020000 "u_env"
mtd11: 00040000 00020000 "s_env"
mtd12: 00040000 00020000 "devinfo"
mtd13: 02800000 00020000 "kernel1"
mtd14: 02400000 00020000 "rootfs1"
mtd15: 02800000 00020000 "kernel2"
mtd16: 02400000 00020000 "rootfs2"
mtd17: 02080000 00020000 "syscfg"
root@OpenWrt:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:62
Present UBI devices:            ubi0

ubi0
Volumes count:                           2
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     288 (36569088 bytes, 34.8 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     11
Minimum input/output unit size:          2048 bytes
Character device major/minor:            247:0
Present volumes:                         0, 1

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        57 LEBs (7237632 bytes, 6.9 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 247:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        207 LEBs (26284032 bytes, 25.0 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 247:2
root@OpenWrt:~#                                                                                                         
1 Like

Hi, got busy at work and what not. So here's my EA7500v1: sysupgrade from ssh

root@Burloga:~# sysupgrade  -v /tmp/openwrt-ipq806x-generic-linksys_ea7500-v1-squashfs-factory.bin
Sat Feb 26 16:39:45 EET 2022 upgrade: Image metadata not present
Sat Feb 26 16:39:45 EET 2022 upgrade: Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware
Image check failed.

And here's the output after flashing it

BusyBox v1.35.0 (2022-02-24 21:51:46 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r18967-cf346dfadf
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 7.0M      7.0M         0 100% /rom
tmpfs                   104.9M    248.0K    104.6M   0% /tmp
/dev/ubi0_1              21.4M     60.0K     20.2M   0% /overlay
overlayfs:/overlay       21.4M     60.0K     20.2M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00020000 "SBL1"
mtd1: 00140000 00020000 "MIBIB"
mtd2: 00140000 00020000 "SBL2"
mtd3: 00280000 00020000 "SBL3"
mtd4: 00120000 00020000 "DDRCONFIG"
mtd5: 00120000 00020000 "SSD"
mtd6: 00280000 00020000 "TZ"
mtd7: 00280000 00020000 "RPM"
mtd8: 00140000 00020000 "art"
mtd9: 00100000 00020000 "APPSBL"
mtd10: 00040000 00020000 "u_env"
mtd11: 00040000 00020000 "s_env"
mtd12: 00040000 00020000 "devinfo"
mtd13: 02800000 00020000 "kernel1"
mtd14: 02400000 00020000 "rootfs1"
mtd15: 02800000 00020000 "kernel2"
mtd16: 02400000 00020000 "rootfs2"
mtd17: 00100000 00020000 "sysdiag"
mtd18: 01f80000 00020000 "syscfg"
root@OpenWrt:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:62
Present UBI devices:            ubi0

ubi0
Volumes count:                           2
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     288 (36569088 bytes, 34.8 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     2
Minimum input/output unit size:          2048 bytes
Character device major/minor:            247:0
Present volumes:                         0, 1

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        57 LEBs (7237632 bytes, 6.9 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 247:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        207 LEBs (26284032 bytes, 25.0 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 247:2
root@OpenWrt:~#

Thanks for the confirmation.

@chunkeey has my commit already in his staging repo, but hasn't yet pushed it to the main OpenWrt repo.

yes, I'm holding out hope for a compromise since pepe2k wants more:

Out of curiosity, why not extend it lets say twice, to 6 MB? Wouldn't that survive longer and more kernel updates/size increases? Is there a limit of data size U-Boot reads from kernel partition?

and man0sn's

I don't object the 4MB change but I agree that 6MB would be more future-proof as pepe2k said.

I would support that 4 MiB (as this is for 4 MiB xz-compressed and other IPQ806x). I've run compile-tests and there were no hiccups.

On remaining detail is: Should there be a little extra spare area (so 4.5-5 MiB kernel partition) to have some space for perfectly working EA8500/EA7500v1 that have unfortunately experienced bad nand pages in the kernel region once the kernel grows close to the 4M size? Or just merge it as is?

I would merge as it is.
Trying to define some extra space between kernel and rootfs might work with sysupgrade after the OpenWrt is already installed, but it is futile with the factory image. As factory is monolithic, the possible bad blocks push rootfs start location further, making it unfoundable and causing bootloop. See R7800 -> Flashing openwrt causes bootloop (bad block in kernel area) - #49 by Steltek

If you want to go that road, you could leave the 4 MB kernel size limit in the image recipe, but define the rootfs to start 256 kB later.

We have lots of ipq806x devices with 4 MB kernel, so will need action at that point in future in any case. But sure, you could go with 5 MB here. (Assuming that the bootloader did not have a 4 MB limit that has been tested...)

2 Likes

Can I quote you there (commit message)?

Sure you can.

It was only a suggestion/something to consider, definitely not a NACK or a blocker from me.

1 Like

Solved:
ipq806x: Increase kernel size to 4 MB for EA8500/EA7500v1

hnyman and chunkeey: Many thanks for keeping these devices supported. I flashed snapshot after the above commit was built and all my favorite packages installed just fine.

Hi,

It is weird, I made an update on my last build last week with the new kernel.size for my ea8500, update from master and feeds, made a sysupgrade with the factory image, reboot and I used the router without a problem.

BUT, this morning I updated my build, and sysupgraded, bit I still got the same message about the kernel size changing. On that router I test some builds, master, 21.02 etc so maybe the problem about doing every time the sysupgrade with Factory image comes from there?

Thanks

It depends on you having the version item set in /etc/config/system.

compat_version 2.0

If you restore old backups without that updated setting, you will get new warnings at the next sysupgrade.

The warning system is pretty simplified, and does not really support downgrades / new upgrades etc. It only monitors the compat_version value (if there is a smaller value than set in the new image's metadata)

I only had that:

config system
	option hostname 'OpenWrt'
	option ttylogin '0'
	option log_size '64'
	option urandom_seed '0'
	option zonename 'America/New York'
	option timezone 'EST5EDT,M3.2.0,M11.1.0'
	option log_proto 'udp'
	option conloglevel '8'
	option cronloglevel '5'

config timeserver 'ntp'
	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'


before I add the command you wrote me:

config system
	option hostname 'OpenWrt'
	option ttylogin '0'
	option log_size '64'
	option urandom_seed '0'
	option zonename 'America/New York'
	option timezone 'EST5EDT,M3.2.0,M11.1.0'
	option log_proto 'udp'
	option conloglevel '8'
	option cronloglevel '5'
	option compat_version '2.0'

config timeserver 'ntp'
	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'


it should be good now ?

Yes.
That should be added automatically when you boot the firmware first after flashing the new version.
But if you ever restore an older backup without that value, you will get a new warning.

1 Like

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