Skip to content
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

kernel panic #2

Open
gyhmz opened this issue Feb 18, 2024 · 5 comments
Open

kernel panic #2

gyhmz opened this issue Feb 18, 2024 · 5 comments

Comments

@gyhmz
Copy link

gyhmz commented Feb 18, 2024

如题
折腾了好久
我是这么操作的:
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
Copy link
Owner

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

@tomxi1997
Copy link
Owner

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

@gyhmz
Copy link
Author

gyhmz commented Feb 22, 2024

按照这几个comment改后再去掉kernel/module.c 里的 version_magic验证,再把lxc-checkconfig里的能开的东西都打开,就能用了
lateautumn233/Common-Android-Kernel-Tree@0ac686b
lateautumn233/Common-Android-Kernel-Tree@a0aa446
lateautumn233/Common-Android-Kernel-Tree@a72032e
lateautumn233/Common-Android-Kernel-Tree@1f8604d
lateautumn233/Common-Android-Kernel-Tree@750b430

@z01-ahaufun
Copy link

按照这几个comment改后再去掉kernel/module.c 里的 version_magic验证,再把lxc-checkconfig里的能开的东西都打开,就能用了 lateautumn233/Common-Android-Kernel-Tree@0ac686b lateautumn233/Common-Android-Kernel-Tree@a0aa446 lateautumn233/Common-Android-Kernel-Tree@a72032e lateautumn233/Common-Android-Kernel-Tree@1f8604d lateautumn233/Common-Android-Kernel-Tree@750b430

我也用的是android11-5.4内核,按照comment修改,编译成功,刷入手机卡第一屏25秒后关机。
`cd /home
#rm -rf android-kernel
mkdir -vp android-kernel && cd android-kernel
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
#repo init -u https://android.googlesource.com/kernel/manifest -b BRANCH
#rm -rf /home/android-kernel/common
repo init -u https://aosp.tuna.tsinghua.edu.cn/kernel/manifest -b common-android11-5.4
repo sync -j4 -c --no-clone-bundle --no-tags

#开始编译
cd /home/android-kernel
rm -rf /home/android-kernel/out/
BUILD_CONFIG=common/build.config.gki.aarch64 build/config.sh savedefconfig
#BUILD_CONFIG=common/build.config.gki.aarch64 build/config.sh menuconfig
LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh`

@tomxi1997
Copy link
Owner

tomxi1997 commented Dec 8, 2024 via email

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

No branches or pull requests

3 participants