tomxi1997 / lxc-docker-support-for-android

add lxc_docker support android-kernel
27 stars 22 forks source link

kernel panic #2

Open gyhmz opened 5 months ago

gyhmz commented 5 months ago

如题 折腾了好久 我是这么操作的: repo init -u https://github.com/StatiXOS/android_kernel_manifest.git -b android-msm-venus-5.4-android11-lts repo sync --force-sync --no-clone-bundle --current-branch --no-tags -j$(nproc --all) cd kernel/msm-5.4/

然后

git clone https://github.com/tomxi1997/lxc-docker-support-for-android.git utils git clone https://github.com/tomxi1997/AnyKernel3.git

编辑Kconfig添加了source "utils/Kconfig"

参照utils下的补丁文件进行修改,fix_cgroup.patch,改了 kernel/cgroup/cgroup.c,没有找到net/netfilter/xt_qtaguid.c

然后 vim arch/arm64/configs/vendor/venus_QGKI.config 加了

Lxc

CONFIG_ANDROID_PARANOID_NETWORK is not set CONFIG_DOCKER=y

编译不通过

2024-02-15T12:48:41.6525962Z ../net/bridge/br_vlan.c:1302:6: error: implicit declaration of function 'vlan_dev_priv' [-Werror,-#Wimplicit-function-declaration]

2024-02-15T12:48:41.6527735Z !!(vlan_dev_priv(dev)->flags & VLAN_FLAG_BRIDGE_BINDING);

2024-02-15T12:48:41.6528535Z ^

2024-02-15T12:48:41.6609937Z ../net/bridge/br_vlan.c:1302:26: error: member reference type 'int' is not a pointer

2024-02-15T12:48:41.6611282Z !!(vlan_dev_priv(dev)->flags & VLAN_FLAG_BRIDGE_BINDING);

2024-02-15T12:48:41.6612095Z ~~~~~~ ^

2024-02-15T12:48:41.6613605Z ../net/bridge/br_vlan.c:1335:6: error: implicit declaration of function 'vlan_dev_priv' [-Werror,-Wimplicit-function-declaration]

2024-02-15T12:48:41.6615108Z vlan_dev_priv(dev)->vlan_id == data->vid) {

2024-02-15T12:48:41.6615785Z ^

2024-02-15T12:48:41.6616714Z ../net/bridge/br_vlan.c:1335:26: error: member reference type 'int' is not a pointer

2024-02-15T12:48:41.6617846Z vlan_dev_priv(dev)->vlan_id == data->vid) {

2024-02-15T12:48:41.6618534Z ~~~~~~ ^

2024-02-15T12:48:41.6619964Z ../net/bridge/br_vlan.c:1366:12: error: implicit declaration of function 'vlan_dev_priv' [-Werror,-Wimplicit-function-declaration]

2024-02-15T12:48:41.6621626Z u16 vid = vlan_dev_priv(vlan_dev)->vlan_id;

2024-02-15T12:48:41.6779086Z ^

2024-02-15T12:48:41.6780267Z ../net/bridge/br_vlan.c:1366:37: error: member reference type 'int' is not a pointer

2024-02-15T12:48:41.6781612Z u16 vid = vlan_dev_priv(vlan_dev)->vlan_id;

2024-02-15T12:48:41.6782311Z ~~~~~~~ ^

2024-02-15T12:48:41.6782892Z 6 errors generated.

2024-02-15T12:48:41.6783454Z CC [M] techpack/camera/drivers/cam_core/cam_context.o

2024-02-15T12:48:41.6859633Z make[3]: *** [../scripts/Makefile.build:288: net/bridge/br_vlan.o] Error 1

2024-02-15T12:48:41.6860626Z make[2]: *** [../scripts/Makefile.build:558: net/bridge] Error 2

2024-02-15T12:48:41.6862464Z make[1]: ***

[/home/runner/work/LXC_KernelSU_Action/LXC_KernelSU_Action/kernel_workspace/android-kernel/Makefile:1884: net] Error 2

2024-02-15T12:48:41.6863762Z make[1]: *** Waiting for unfinished jobs....

不知道什么原因,但是看到vlan于是试了试,编译通过了

CONFIG_VLAN_8021Q=m

不带lxc编译可以开机,发现加了lxc开不了机,不知道怎么看日志就接上了ttl

CONFIG_SERIAL_MSM_GENI_EARLY_CONSOLE=y CONFIG_SERIAL_MSM_GENI_CONSOLE=y CONFIG_SERIAL_MSM_HS=y CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15 CONFIG_CONSOLE_LOGLEVEL_QUIET=15 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7

[ 8.167233][ T1] init: init first stage started!

[ 8.172390][ T1] init: Loading module /lib/modules/msm_drm.ko with args 'dsi_display0=qcom,mdss_dsi_k2_38_08_0a_mp_dsc_cmd: oled_wp=01f70bbf0c4f'

[ 8.186998][ T1] msm_drm: disagrees about version of symbol module_layout

[ 8.194350][ T1] init: Failed to insmod '/lib/modules/msm_drm.ko' with args 'dsi_display0=qcom,mdss_dsi_k2_38_08_0a_mp_dsc_cmd: oled_wp=01f70bbf0c4f': Exec format error

于是查了一下,发现是https://blog.xzr.moe/archives/236/#section-3

里面描述的问题,于是尝试强制加载,除了这里还改了kernel/module.c

CONFIG_MODULE_FORCE_LOAD=y

:wq cd .. cd ..

因为不会编译内核所以完全按照这里的操作:https://github.com/StatiXOS/android_kernel_manifest/tree/android-msm-venus-5.4-android11-lts

BUILD_CONFIG=kernel/msm-5.4/build.config.msm.lahaina VARIANT=qgki LTO=full TARGET_PRODUCT=venus BUILD_KERNEL=1 build/build.sh

然后内核在out/msm-5.4-lahaina-qgki/kernel/msm-5.4/arch/arm64/boot/Image

刷入之后kernel panic 重启

moddedforceboot.txt

tomxi1997 commented 5 months ago

这个5.1以上的内核,直接开lxc是有内核崩溃问题的,好像需要修改某个文件(我记不得了)你可以找这位大佬,有关lxc,gki内核直接用他的 https://github.com/lateautumn233/Common-Android-Kernel-Tree/tree/lxc 或者酷安 秋秋 。他动态上有gki的lxc内核成品,你试一下吧

tomxi1997 commented 5 months ago

这个这个仓库只适合4.19及以下安卓内核lxc支持

gyhmz commented 5 months ago

按照这几个comment改后再去掉kernel/module.c 里的 version_magic验证,再把lxc-checkconfig里的能开的东西都打开,就能用了 https://github.com/lateautumn233/Common-Android-Kernel-Tree/commit/0ac686b9e81ba331c2ad9b420fd21262a80daaa4 https://github.com/lateautumn233/Common-Android-Kernel-Tree/commit/a0aa446ca326b5d26ac1dec057efd8c07d2bcbff https://github.com/lateautumn233/Common-Android-Kernel-Tree/commit/a72032ecf33c63d8a4abb64b08c1a0b847c82a32 https://github.com/lateautumn233/Common-Android-Kernel-Tree/commit/1f8604d687cfc20d2790315db676c506bc9010d8 https://github.com/lateautumn233/Common-Android-Kernel-Tree/commit/750b43051d2e4317121c7250544ae38fdf28d4c7