ath79: remove 'fakeroot' for Senao devices
authorMichael Pratt <mcpratt@pm.me>
Thu, 25 Feb 2021 03:55:09 +0000 (22:55 -0500)
committerPetr Štetiar <ynezz@true.cz>
Fri, 11 Jun 2021 05:20:31 +0000 (07:20 +0200)
commit64d845ef027b31f3dc8f1a6a692c960a3a8844f3
tree3adfe1bc7a6b6bc0b911a228ad4a4f19cb9db769
parent1f6ec4b29ebfda19d9df01f1cc289ed6454683cf
ath79: remove 'fakeroot' for Senao devices

By using the same custom kernel header magic
in both OKLI lzma-loader, DTS, and makefile
this hack is not necessary anymore

However, "rootfs" size and checksum
must now be supplied by the factory.bin image
through a script that is accepted by the OEM upgrade script.

This is because Senao OEM scripts assume a squashfs header exists
at the offset for the original "rootfs" partition
which is actually the kernel + rootfs in this implementation,
and takes size value from the header that would be there with hexdump,
but this offset is now the uImage header instead.

This frees up 1 eraseblock
previously used by the "fakeroot" partition
for bypassing the OEM image verification.

Also, these Senao devices with a 'failsafe' partition
and the tar-gz factory.bin platform would otherwise require
flashing the new tar-gz sysupgrade.bin afterward.
So this also prevents having to flash both images
when starting from OEM or 'failsafe'

the OEM upgrade script verifies the header magic numbers,
but only the first two bytes.
Example:

    [ "${magic_word_kernel}" = "2705" ] &&
    [ "${magic_word_rootfs}" = "7371" -o "${magic_word_rootfs}" = "6873" ] &&
    errcode="0"

therefore picked the magic number
0x73714f4b
which is
'sqOK'

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 4a0cc5d4ef29a11914850c72158aca1e2a170fb0)
target/linux/ath79/dts/ar724x_senao_loader.dtsi
target/linux/ath79/dts/ar934x_senao_loader.dtsi
target/linux/ath79/dts/qca955x_senao_loader.dtsi
target/linux/ath79/image/common-senao.mk
target/linux/ath79/image/generic.mk
target/linux/ath79/image/tiny.mk