OpenWRT 上的全新内核
Totally new kernel on OpenWRT
有没有可能在OpenWRT上安装全新的内核?目前我有 3.18 版本,但我必须降级到 Candela Tech 打过补丁的内核才能为 ath10k 安装新固件。我一直在 google 搜索如何咬这个,但没有很好的说明如何做到这一点。
更新:(从 TS 的回答中复制)
南范...
我试着按照你的指示去做,但是出现了一个问题
Applying patch platform/310-lib-add-rle-decompression.patch
patching file lib/Kconfig
Hunk #1 succeeded at 227 with fuzz 2 (offset -6 lines).
patching file lib/Makefile
Hunk #1 FAILED at 97.
1 out of 1 hunk FAILED -- rejects in file lib/Makefile
patching file include/linux/rle.h
patching file lib/rle.c
Patch platform/310-lib-add-rle-decompression.patch does not apply (enforce with -f)
make[3]: *** [sdk2/build_dir/target mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.17/.quilt_checked] Error 1
make[3]: Leaving directory `sdk2/target/linux/ar71xx'
make[2]: *** [compile] Error 2
make[2]: Leaving directory `sdk2/target/linux'
make[1]: *** [target/linux/compile] Error 2
make[1]: Leaving directory `sdk2'
make: *** [target/linux/compile] Error 2
使用 openwrt master 分支然后为您的设备构建应该会给您一个新内核。上次我检查它是 4.1 我猜。
如果我没记错的话,你的问题是如何在OpenWRT中更改内核版本。
假设我正在使用
OpenWRT: CC 15.05
Target system: Atheros AR7xxx/AR9xxx
当前内核版本是3.18,我想降级到3.17
您需要注意 2 个文件夹:
openwrt/target/linux/generic
openwrt/target/linux/ar71xx
Step1.Edit openwrt/target/linux/ar71xx/Makefile
中的Makefile
- KERNEL_PATCHVER:=3.18
+ KERNEL_PATCHVER:=3.17
Step2.Create 内核的配置文件
openwrt/target/linux/generic/config-3.17
openwrt/target/linux/ar71xx/config-3.17
我建议您将 config-3.18 复制到 config-3.17。您可以稍后通过
修改它们
cd openwrt
make kernel_menuconfig
Step3.Try编译它:
cd openwrt
make target/linux/clean
make target/linux/compile V=s
第一次将内核源码linux-3.17.tar.xz下载到openwrt/dl。
然后解压编译,不加任何补丁
第四步。创建文件夹 patches-3.17 然后将您自己的内核补丁(来自 Candela Tech)放入其中。
openwrt/target/linux/ar71xx/patches-3.17
重复第 3 步。
要在OpenWRT中制作补丁文件,你可以看看这个link
https://wiki.openwrt.org/doc/devel/patches
万一有人找到这个更改 openwrt 内核的页面,这是我根据这个页面信息得出的结果,再次感谢!
这里我以 x86 平台将内核 5.10 更改为内核 5.16 为例:
从 5.10.x -> 5.16.y 更新此文件内核信息:
target/linux/x86/Makefile
创建此文件:include/kernel-5.16
它的哈希值是基于这个计算的:
${openwrt_topdir}/staging_dir/host/bin/mkhash sha256 linux-5.10.92.tar.xz
创建此文件:target/linux/generic/config-5.16
如果不确定,只需 #cp config-5.10 config-5.16
在 target/linux/x86/ 这个目录下创建 confg-5.16 文件,子目录有 config-5.10
通过这些修改,我在 openwrt 中成功构建了 5.16 内核。
有没有可能在OpenWRT上安装全新的内核?目前我有 3.18 版本,但我必须降级到 Candela Tech 打过补丁的内核才能为 ath10k 安装新固件。我一直在 google 搜索如何咬这个,但没有很好的说明如何做到这一点。
更新:(从 TS 的回答中复制)
南范...
我试着按照你的指示去做,但是出现了一个问题
Applying patch platform/310-lib-add-rle-decompression.patch
patching file lib/Kconfig
Hunk #1 succeeded at 227 with fuzz 2 (offset -6 lines).
patching file lib/Makefile
Hunk #1 FAILED at 97.
1 out of 1 hunk FAILED -- rejects in file lib/Makefile
patching file include/linux/rle.h
patching file lib/rle.c
Patch platform/310-lib-add-rle-decompression.patch does not apply (enforce with -f)
make[3]: *** [sdk2/build_dir/target mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.17/.quilt_checked] Error 1
make[3]: Leaving directory `sdk2/target/linux/ar71xx'
make[2]: *** [compile] Error 2
make[2]: Leaving directory `sdk2/target/linux'
make[1]: *** [target/linux/compile] Error 2
make[1]: Leaving directory `sdk2'
make: *** [target/linux/compile] Error 2
使用 openwrt master 分支然后为您的设备构建应该会给您一个新内核。上次我检查它是 4.1 我猜。
如果我没记错的话,你的问题是如何在OpenWRT中更改内核版本。
假设我正在使用
OpenWRT: CC 15.05
Target system: Atheros AR7xxx/AR9xxx
当前内核版本是3.18,我想降级到3.17
您需要注意 2 个文件夹:
openwrt/target/linux/generic
openwrt/target/linux/ar71xx
Step1.Edit openwrt/target/linux/ar71xx/Makefile
中的Makefile- KERNEL_PATCHVER:=3.18
+ KERNEL_PATCHVER:=3.17
Step2.Create 内核的配置文件
openwrt/target/linux/generic/config-3.17
openwrt/target/linux/ar71xx/config-3.17
我建议您将 config-3.18 复制到 config-3.17。您可以稍后通过
修改它们cd openwrt
make kernel_menuconfig
Step3.Try编译它:
cd openwrt
make target/linux/clean
make target/linux/compile V=s
第一次将内核源码linux-3.17.tar.xz下载到openwrt/dl。 然后解压编译,不加任何补丁
第四步。创建文件夹 patches-3.17 然后将您自己的内核补丁(来自 Candela Tech)放入其中。
openwrt/target/linux/ar71xx/patches-3.17
重复第 3 步。
要在OpenWRT中制作补丁文件,你可以看看这个link https://wiki.openwrt.org/doc/devel/patches
万一有人找到这个更改 openwrt 内核的页面,这是我根据这个页面信息得出的结果,再次感谢!
这里我以 x86 平台将内核 5.10 更改为内核 5.16 为例:
从 5.10.x -> 5.16.y 更新此文件内核信息: target/linux/x86/Makefile
创建此文件:include/kernel-5.16 它的哈希值是基于这个计算的: ${openwrt_topdir}/staging_dir/host/bin/mkhash sha256 linux-5.10.92.tar.xz
创建此文件:target/linux/generic/config-5.16 如果不确定,只需 #cp config-5.10 config-5.16
在 target/linux/x86/ 这个目录下创建 confg-5.16 文件,子目录有 config-5.10
通过这些修改,我在 openwrt 中成功构建了 5.16 内核。