Skip to content

routerboot v7 sysupgrade#7

Draft
john-tho wants to merge 6 commits intomasterfrom
routerboot-v7
Draft

routerboot v7 sysupgrade#7
john-tho wants to merge 6 commits intomasterfrom
routerboot-v7

Conversation

@john-tho
Copy link
Owner

@john-tho john-tho commented Jul 5, 2023

Generate a sysupgrade flash image compatible with RouterBOOT v7
Pack kernel into NPK file container, into bootimage, in a yaffs filesystem.

As-is, would require python-venv on the buildbots

Would want to merge the npk-py changes into upstream npk-py for review

@john-tho john-tho force-pushed the routerboot-v7 branch 3 times, most recently from ce6cece to fd635d8 Compare July 5, 2023 20:03
@dchard
Copy link

dchard commented Jul 10, 2023

This is just rebased or there is some modifications compared to the previous one you want us to test?

@john-tho
Copy link
Owner Author

(Hopefully—rebase fun) nothing changed (yet).
Cheers

@dchard
Copy link

dchard commented Jul 14, 2023

I tested it on ipq4019 (chateau 12) and it still works fine.

@Ciusss89
Copy link

Maybe related to openwrt#13166 ?

endef

define Build/kernel-pack-npk
sh -c 'source $(STAGING_DIR_HOST)/share/npkpy-venv/bin/activate; python $(STAGING_DIR_HOST)/share/npkpy-venv/bin/pack_npk_kernel.py --kernel $@ --output $@.npk'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this locally and had an issue with source. I think it should be . (a dot).


define Host/Compile
python -m venv $(STAGING_DIR_HOST)/share/npkpy-venv
sh -c 'source $(STAGING_DIR_HOST)/share/npkpy-venv/bin/activate; pip install --editable $(HOST_BUILD_DIR)'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here.

@champtar
Copy link

@john-tho any plans to resume the work on routerboot v7 ?
I really like the few wapac that I have but can't buy anymore of them

@champtar
Copy link

npkpy seems to only use standard python libs, do we really need venv or could we just use sys.path.append() or PYTHONPATH ?

@champtar
Copy link

@john-tho just rebased on top of main, switched to yafut + use PYTHONPATH: https://github.com/champtar/openwrt/tree/routerboot-v7
It works on wapac v2 (the ipq40xx one)

Use OpenWrt's lzma loader for initramfs image
Due to mips kernel self extractor inability to relocate,
and RouterBoot on 760igs refusing to netboot an ELF with:
Entry point address:               0x80b91000
or greater: 0x80b81000 and below okay.

Note that this is only a bootloader ELF entry point limitation,
a 50MiB Linux + initramfs vmlinux will boot fine on 760igs.

With this lzma loader, netboot will occasionally freeze after
decompressing the kernel, but before starting vmlinux. It was considered
that an occasional netboot freeze was simpler to workaround than an
image that refuses to boot unless minimized.

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Adjust the YAFFS file path written depending on the sysupgrade
filename.
Default to kernel (for ELF), switch to bootimage (for NPK) if image name
has v7.

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
RouterBOOT v7 for NOR devices does not support the historic yaffs
"kernel" ELF boot method.
Generate a compatible kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
RouterBOOT v7 for NOR devices does not support the historic yaffs
"kernel" ELF boot method.
Generate a compatible kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
RouterBOOT v7 for NOR devices does not support the historic yaffs
"kernel" ELF boot method.
Generate a compatible kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
@champtar
Copy link

@john-tho how can we help get this into OpenWrt ? Haven't tested with the CI docker container, but using PYTHONPATH instead of venv seems enough (no requirements.txt)

@WolleTD
Copy link

WolleTD commented Sep 3, 2025

What's up with this PR? And why does it want to merge into the fork rather than upstream?

I don't need this yet, but just noticed the issue with RouterBOOT v7 in the wiki. As there apparently is a solution, I'd like to see this in OpenWRT before it hits my manufacturing with some future delivery of routers.

I'm gonna go into testing and wait for a reaction, but would create my own PR at some point if I get none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments