|
|
本帖最后由 winpefk 于 2026-8-26 23:58 编辑
首先,你得有一个能跑lxc的内核
比如我这个
- LXC version 3.1.0
- --- Namespaces ---
- Namespaces: enabled
- Utsname namespace: enabled
- Ipc namespace: enabled
- Pid namespace: enabled
- User namespace: enabled
- newuidmap is not installed
- newgidmap is not installed
- Network namespace: enabled
- Namespace limits: cgroup: 28801 ipc: ... mnt: ... net: ... pid: ... user: ... uts: ...
- --- Control groups ---
- Cgroups: enabled
- Cgroup namespace: enabled
- Cgroup v1 mount points:
- - /dev/blkio
- - /dev/cpuctl
- - /dev/cpuset
- - /dev/memcg
- Cgroup v2 mount points:
- - /sys/fs/cgroup
- Cgroup device: enabled
- Cgroup sched: enabled
- Cgroup cpu account: enabled
- Cgroup memory controller: enabled
- Cgroup cpuset: enabled
- --- Misc ---
- Veth pair device: enabled, not loaded
- Macvlan: enabled, not loaded
- Vlan: missing
- Bridges: enabled, not loaded
- Advanced netfilter: enabled, not loaded
- CONFIG_NF_NAT_IPV4: enabled, not loaded
- CONFIG_NF_NAT_IPV6: missing
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled, not loaded
- CONFIG_IP6_NF_TARGET_MASQUERADE: missing
- CONFIG_NETFILTER_XT_TARGET_CHECKSUM: missing
- CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, not loaded
- FUSE (for use with lxcfs): enabled, not loaded
- --- Checkpoint/Restore ---
- checkpoint restore: missing
- CONFIG_FHANDLE: missing
- CONFIG_EVENTFD: enabled
- CONFIG_EPOLL: enabled
- CONFIG_UNIX_DIAG: missing
- CONFIG_INET_DIAG: enabled
- CONFIG_PACKET_DIAG: missing
- CONFIG_NETLINK_DIAG: missing
- File capabilities: enabled
- Note: Before booting a new kernel, you can check its configuration with:
- CONFIG=/path/to/config ../lxc-checkconfig
复制代码 那么其实这个内核的获得不是一帆风顺的, 咱得先找到一个能用的内核源码. 我由于各种传闻 "什么云控之类的" 不敢升级hyperos,买来就解锁BL,然后快速刷入GSI, 至今底包 MIUI 14.3
然后git上面只能找到一堆适配hyperOS的内核, 对于miui底包机器一刷就砖.截图就不发了,git刚刚访问不稳定,大家自己可以去看一下.
hyperOS的刷机生态令我不敢更新, 遂开始rebase别人仓库适配内核.
这里先贴git提交日志, 以表示我不是大语言模型
然后贴github仓库, 自己搜索 dirt2022/android_kernel_xiaomi_pipa 仓库, 变基自 wcedla/android_kernel_xiaomi_ucmi (一个miui底包支持的内核,但bug多多,甚至也属于"刷了就砖"内核, 且开发者迅速弃坑)
我于是主动跳入火坑,在若干天内踩了若干坑, 可以从后面提交信息看出来.
现在如果还有运行miui底包的可以参考这个内核. 目前功能几乎没有问题. 预构建内核我就没法发网盘了,怕吞.
如果你有了内核,那么就直接make O=build menuconfig配置一下, 打开:
CONFIG_NAMESPACE,SYSVIPC,CONFIG_NAMESPACE下面的所有项目,还有 CONFIG_BRIDGE, CONFIG_VETH, CONFIG_MACVLAN, CONFIG_CGROUPS, 以及下面所有项目(带debug字样的可以不开)
跑一遍lxc-checkconfig, 看哪个红的,去自己补丁之
如果提示 cgroup v1 systemd没挂载, 自己(在安卓宿主的root shell下: mkdir /sys/fs/cgroup/systemd 然后mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
如果提示缺少 Cgroup v1 freezer controller
就 mkdir /dev/freezer, 然后 mount -t cgroup -o none,name=freezer cgroup /dev/freezer (也在安卓root shell里面运行)
(有些内核需要LLVM=1启用clang工具链,比如我的, 那么就是 make O=build LLVM=1 menuconfig && make O=build LLVM=1 -j $(nproc))
根文件系统构造可以参考第二页.
lxc配置文件书写可以参考AI
- commit d204418f93b61a78894fd83e4e401b67fa1743c5 (HEAD -> main, origin/main)
- Author: dirt2022 <fk186@qq.com>
- Date: Mon Aug 24 08:23:22 2026 +0000
- Config: support lxc container.
- commit f7d1be7a02a081205f5b02cbfbbebb952d1c1402
- Author: dirt2022 <fk186@qq.com>
- Date: Sun Aug 23 14:58:20 2026 +0000
- README: Add readme.md
- commit 855fa51507364de676950ae004a9b59286c7d40a
- Author: dirt2022 <fk186@qq.com>
- Date: Sun Aug 23 08:47:09 2026 +0000
- Audio: dirtyhack: Fix audio playback of aw882xx chips.
- Since the ACDB database always provides wrong information,
- causing opensource aw882xx driver enter mute mode forever.
- Moreover,Mi official firmware (MIUI 14.3) may also dirty hacked,
- which caused extra debugging difficulties.
- Now we dirty hacked slot_mapping_cfg->offset in q6afe.c. (The hack triggers only when TDM port_id == 0x9020)
- Proof (logcat from stock firmware):
- I afe_find_cal_topo_id_by_port: port id: 0x9020, dev_acdb_id: 10011
- I afe_find_cal_topo_id_by_port: top_id:1000ff01 acdb_id:10011 afe_port_id:0x9020
- I afe_get_cal_topology_id: port_id = 0x9020 acdb_id = 10011 topology_id = 0x1000ff01 cal_type_index=8 ret=0
- E afe_callback: cmd = 0x100fa returned error = 0x2
- E afe_apr_send_pkt: DSP returned error[ADSP_EBADPARAM]
- ...
- I [Awinic][2-0034]aw882xx_mute: mute state=0
- E [Awinic]aw_check_dsp_ready: rx topo id is 0x0
- I [Awinic][2-0034]aw882xx_startup_work: enter
- D [Awinic]aw882xx_dsp_write_spin: write spin done
- I [Awinic][2-0034]aw882xx_spin_set_record_val: set record spin val done
- I [Awinic][2-0035]aw882xx_mute: mute state=0
- I [Awinic][2-0034]aw882xx_start_pa: enter
- I [Awinic][2-0034]aw882xx_dev_reg_update: done
- ...
- D [Awinic][2-0034]aw_pid_2113_set_volume: value:65, min_val: 65, real_value: 0x51
- D [Awinic][2-0034]aw_pid_2113_set_volume: value:113, min_val: 113, real_value: 0x91
- D [Awinic][2-0034]aw_pid_2113_set_volume: value:161, min_val: 161, real_value: 0xd1
- ... // normal playback.
- commit 041465500f201469e41267519c34fc64dd3e4935
- Author: dirt2022 <fk186@qq.com>
- Date: Sat Aug 22 01:27:03 2026 +0000
- Audio: Without AW_SND_SOC_AW882XX_TDM the kernel failed to build.
- commit 95556d602d63c5072116a7eb821cbcc8fd55c110
- Author: dirt2022 <fk186@qq.com>
- Date: Fri Aug 21 15:40:32 2026 +0000
- Audio: Okay, the AW882XX_SPEAKER_NAME should be "aw882xx_smartpa.x-00xx", not "x-00xx"
- commit bf196bc265764c21d8a24140ab657596c353c95f
- Author: dirt2022 <fk186@qq.com>
- Date: Fri Aug 21 07:20:52 2026 +0000
- Fix wrong DAI name of aw882xx.
- Enable necessary build config in konaautoconf.h, konaauto.conf
- The tert_mi2s_rx_aw882xx_dai_links array was previously defined inside
- the wrong conditional block, causing it to be excluded from compilation.
- commit 4c7b940537371a9abc156694f01bddabef116e4d
- Author: dirt2022 <fk186@qq.com>
- Date: Thu Aug 20 15:37:34 2026 +0000
- Fix: add tert_mi2s_rx_aw882xx_dai_links for pipa.
- commit 2b81d1c24793f7ce06800e76272e8ba2b2b099a2
- Author: dirt2022 <fk186@qq.com>
- Date: Thu Aug 20 10:27:54 2026 +0000
- Log: enable aw882x driver debug info.
- commit ebf17002f9a25f2d6f3efcebf3b999e4f852bf9f
- Author: dirt2022 <fk186@qq.com>
- Date: Thu Aug 20 08:49:58 2026 +0000
- Audio: Add aw882x driver, include aw_compative_layer (aw_send_afe_cal_apr, aw_set_port_id, etc.) in qcom q6afe.
- commit 6fb9cb4f439797fb407aea5de43647c18f2427d0
- Author: dirt2022 <fk186@qq.com>
- Date: Wed Aug 19 14:07:17 2026 +0000
- Defconfig: try to builtin qca6390 driver to fix wifi.
- commit 228e565c5327b11fb7233a3c510ca8e984fc54cb
- Author: dirt2022 <fk186@qq.com>
- Date: Wed Aug 19 08:24:05 2026 +0000
- Fix: build error due to old fashioned function declaration in nt36532 chipset driver.
- commit d1cda30452d847c228358178578e9f2ae151f627
- Author: dirt2022 <fk186@qq.com>
- Date: Wed Aug 19 08:19:05 2026 +0000
- Fix: touch screen never works due to incorrect Makefile in drivers/input/touchscreen/Makefile, which forgot to include nt36532 chipset.
- commit 64599b76545956e2493f80865024575b57fcceb4
- Author: dirt2022 <fk186@qq.com>
- Date: Wed Aug 19 04:29:57 2026 +0000
- Fix uninitialized pointer problem.
- This bq_err refer to the uninitialized pointer *bq, which can cause kernel panic while booting up.
- commit 9cf3365f91031e315cebe806763a6ff39c943998
- Author: dirt2022 <fk186@qq.com>
- Date: Tue Jul 21 11:15:29 2026 +0000
- rtmutex: Drop rt_mutex::wait_lock before scheduling
- commit d33d26036a0274b472299d7dcdaa5fb34329f91b upstream.
- rt_mutex_handle_deadlock() is called with rt_mutex::wait_lock held. In the
- good case it returns with the lock held and in the deadlock case it emits a
- warning and goes into an endless scheduling loop with the lock held, which
- triggers the 'scheduling in atomic' warning.
- Unlock rt_mutex::wait_lock in the dead lock case before issuing the warning
- and dropping into the schedule for ever loop.
- [ tglx: Moved unlock before the WARN(), removed the pointless comment,
- massaged changelog, added Fixes tag ]
- Fixes: 3d5c9340d194 ("rtmutex: Handle deadlock detection smarter")
- Signed-off-by: Roland Xu <mu001999@outlook.com>
- Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
- Cc: stable@vger.kernel.org
- Link: https://lore.kernel.org/all/ME0P300MB063599BEF0743B8FA339C2CECC802@ME0P300MB0635.AUSP300.PROD.OUTLOOK.COM
- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- commit 7332c2f40d36b4774e470ccab8b2cc7e529037f5
- Author: dirt2022 <fk186@qq.com>
- Date: Sun Jul 12 03:25:46 2026 +0000
- chores: Fix a typo in previous commit.
- commit 036175390f82def4b1cebb9e5ba7431fdb6b1ef3
- Author: dirt2022 <fk186@qq.com>
- Date: Sun Jul 12 02:19:52 2026 +0000
- rtmutex: Use waiter::task instead of current in remove_waiter()
- remove_waiter() is used by the slowlock paths, but it is also used for proxy-lock rollback in rt_mutex_start_proxy_lock() when invoked from futex_requeue().
- In the latter case waiter::task is not current, but remove_waiter() operates on current for the dequeue operation.
- That results in several problems:
- 1) the rbtree dequeue happens without waiter::task::pi_lock being held
- 2) the waiter task's pi_blocked_on state is not cleared, which leaves a dangling pointer primed for UAF around.
- 3) rt_mutex_adjust_prio_chain() operates on the wrong top priority waiter task Use waiter::task instead of current in all related operations in remove_waiter() to cure those problems.
- [ tglx: Fixup rt_mutex_adjust_prio_chain(), add a comment and amend the changelog ]
- Fixes: 8161239a8bcc ("rtmutex: Simplify PI algorithm and make highest prio task get lock")
- Reported-by: Yuan Tan <yuantan098@gmail.com>
- Reported-by: Yifan Wu <yifanwucs@gmail.com>
- Reported-by: Juefei Pu <tomapufckgml@gmail.com>
- Reported-by: Xin Liu <bird@lzu.edu.cn>
- Signed-off-by: Keenan Dong <keenanat2000@gmail.com>
- Signed-off-by: Thomas Gleixner <tglx@kernel.org>
- Cc: stable@vger.kernel.org
- commit 6819901f6d7717d081c81faa1aa95361861b020b
- Author: dirt2022 <fk186@qq.com>
- Date: Sat Jul 4 13:31:40 2026 +0000
- Chores: fix warnings.
- Using bit operations instead of directly assigning values to Boolean variables to avoid warnings from clang.
- Here is the warning:
- warning: implicit truncation from 'int' to a one-bit
- wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
- commit a3361d7c6c4938c3e139a92500806da9e65db37d
- Author: dirt2022 <fk186@qq.com>
- Date: Thu Jul 2 08:40:26 2026 +0000
- Add: A common .gitignore, with "build/", "out/" directory included.
- commit baba01f5ba6f9d80014375bdf3d2ee4c07df76e9
- Author: dirt2022 <fk186@qq.com>
- Date: Thu Jul 2 08:18:07 2026 +0000
- Initial commit.
- Cloned and rebased from: https://github.com/wcedla/android_kernel_xiaomi_ucmi
- Try to support pipa (Mi Pad 6, shipped with MIUI, not hyperos).
- Add missing device tree.
- Let Mihw, millet, perfevents and these xiaomi specific features not pollute the kernel.
- Remove Github CI Action files of this repo.
复制代码
|
|