-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 s905w 设备上使用其他内核 (Use other kernels on s905w devices) #859
Comments
f大之前计划如果6.1是lts,这个也会打TEXT_OFFSET补丁使用(目前6.1.1没打)。 按他的计划,以后可能lts的是+o版,都会打TEXT_OFFSET补丁,可以不用u-boot,其他短周期的过度版本是+版,不打这个补丁,需要u-boot支持。 |
今年还真不一定, 6.1 有 rust ,可能不是 LTS. |
感谢分享,春节期间抽空玩玩s905w的u-boot,看能否像ugoos x3 一样玩 #782 谁可以推荐一下,s905w 哪款盒子可玩性高一点。意向BL无锁,线刷包齐全,最好是安卓9,我需要先搞回来一台。 |
x96 mini, tx3 mini在某宝上都有 |
我搞了台tx3 mini 2+16 |
这里还没tx3-mini的系统,你找店家问问他们有系统没。 |
我已经在tx3的网页下载了,等盒子回来确认过后,传上来。 |
https://pan.baidu.com/s/1qSmtBgSEbKs6ZFm-yCr-XQ 提取码: nnw3 这个帖子里有个网盘分享了很多安卓TV固件,我刚才浏览了一遍没TX3-mini的。 |
这个盘,我有看过,基本都是国内iptv盒子的固件,没关系等盒子回来再搞。 |
5.10支持到2026年12月, 而且已经发布快3年, 是现在最稳的, 但是不新 |
5.4/5.10/5.15这3个是LTS |
i can confirm that today's build 6.1.1 (bullseye server) works on s905w perfectly (tanix tx3 mini), also 5.10.161 works fine. |
When tx3-mini uses 6.1.1/5.10.161, which u-boot file do you use? meson-gxl-s905w-tx3-mini.dtb Is this the default combination in the configuration file? Take a screenshot to see your configuration information.
|
This is it
|
对于6.x内核, |
多谢分享 |
WARNING
对于6.x内核, PHYS_OFFSET也被移除了, 所以你需要下面的补丁
https://march7th.tk/offsets.patch
For 6.x kernel, PHYS_OFFSET was removed as well. So you need this following Patch:
https://march7th.tk/offsets.patch
当前 s905w 系列的盒子只支持使用 5.4.y/5.15.y 内核,然而现在这两个版本有点尴尬:5.15还有10个月就要EOL, 5.4又太老......
那我们有没有想过, 为什么 s905w 只支持 5.4.y/5.15.y 内核?
实际上这个问题关系到 ARM Linux 的启动原理. 可以看看这篇文章.
问题出在内核偏移量
TEXT_OFFSET
上. 在 Linux 5.10, 它被移除了(详见这个commit).被移除自然有被移除的原因. 现代的 armv8 启动根本用不到它. 对于主线 u-boot 也是, 这个偏移可有可无.
但是 s905w 不一样, 它仍然使用旧的启动协议, 需要这个偏移. 没有它就没法启动.
那既然这个偏移已经在 5.10 被移除了, 为什么 5.15.y 还能用? 这是因为f大在他的内核里打了补丁, 把这个偏移加了回来(详见这里), 如果你不用f大的 5.15.y 而是用主线 5.15, 你会发现一样无法启动.
至于为什么f大只给 5.15 而没给身为 Super LTS 的 5.10 版本打补丁, 那就不知道了.
不过没关系, f大不打我们可以自己打, 只需要编译内核前, 在内核源码根目录执行这个来给内核打补丁:
patch -p1 <(curl -fsSL https://github.com/unifreq/linux-5.15.y/commit/ba506e2d948116d9e4c7ff8c526af6118e9f2ef6.patch)
不出所料应该会有一两个 reject, 自己处理下就行了.
这样编译出来的内核就能在 s905w 平台上正常启动, 哪怕不是 5.4.y/5.15.y .
The current s905w series of boxes only support 5.4.y/5.15.y kernel, but now these two versions are a bit embarrassing: 5.15 is only 10 months away from EOL, 5.4 is too old ......
But have we ever wondered why the s905w only supports the 5.4.y/5.15.y kernel?
Actually this question is related to the ARM Linux boot protocol. Check out this article (Chinese).
The problem is with the kernel offset
TEXT_OFFSET
. In Linux 5.10, it was removed (see this commit for details).It was removed for a good reason. Modern armv8 boot does not use it at all. For mainline u-boot as well, this offset is optional.
But s905w is different, it still uses the legacy boot protocol and needs this offset. Without it, it cannot boot.
So if this offset was removed in 5.10, why does 5.15.y still work? This is because flippy patched the kernel to add this offset back (see here), and if you use mainline 5.15 instead of flippy's 5.15.y, you'll find that it won't boot either.
As to why flippy only patched 5.15 and not patch 5.10 which is Super LTS, I don't know.
But it doesn't matter, if flippy doesn't patch it, we can patch it ourselves. Just run this in the kernel root before compiling the kernel:
patch -p1 <(curl -fsSL https://github.com/unifreq/linux-5.15.y/commit/ba506e2d948116d9e4c7ff8c526af6118e9f2ef6.patch)
If as expected, there should be one or two rejects. Just deal with them yourself.
With this way the compiled kernel will boot properly on the s905w platform, even if it is not 5.4.y/5.15.y .
最后效果 Final result:
如图, 5.10 内核在 TX3 mini (s905w) 成功启动. As shown in the picture, the 5.10 kernel was successfully booted on the TX3 mini (s905w).
The text was updated successfully, but these errors were encountered: