/ xiaomi10 / 983浏览

xiaomi10-lxc-docker

1、刷入原生lineage os

参考地址:https://xdaforums.com/t/rom-umi-unofficial-lineage-os-19-1-20-vanilla-microg-gapps.4526521/

刷入方式:

1、刷入第三方twrp

下载地址:

2、双清并格式data

3、刷入底包

下载地址:https://xiaomi.cn/post/18371653

https://bigota.d.miui.com/V13.0.8.0.SJBCNXM/miui_UMI_V13.0.8.0.SJBCNXM_ade3b2ea7f_12.0.zip

4、刷入lineage os

下载地址:https://sourceforge.net/projects/skyloft-project/files/umi/lineage-20.0/vanilla/lineage-20.0-20230108-UNOFFICIAL-umi.zip/download

注意底包和lineage os对应版本

2、内核编译

1、已修改好的内核 kernelSU+docker+lxc

内核地址:https://github.com/maju-blogs/kernel_xiaomi_sm8250

编译地址:https://github.com/maju-blogs/KernelSU_Action/tree/dev

内核:https://ydfm.cc/static/AnyKernel3-KernelSU-umi-perf-202311061621.zip

自己修改内核:

kernelSU:https://kernelsu.org/zh_CN/guide/installation.html

lxc:https://blog.qiuqiu233.top/post/4#1.%20%E7%BC%96%E8%AF%91%E5%86%85%E6%A0%B8

https://github.com/tomxi1997/lxc-docker-support-for-android

2、刷入lxc模块

模块地址:https://github.com/tomxi1997/lxc-magisk-modules-for-android-/releases/download/v1/Lxc-Magisk-ubuntu22.04-arm64-end-release.zip

项目地址:https://github.com/tomxi1997/lxc-magisk-modules-for-android-/releases

3、连接到lxc容器

ssh root@localhost 密码1

进入容器后安卓docker-compose

apt install docker-compose

4、docker运行mysql

拉去镜像

docker pull registry.cn-hangzhou.aliyuncs.com/milili/mysql8-arm64:v1

该镜像解决arm64架构下mysql无法创建socket问题

也可以自己使用mysql镜像,进入镜像进行修改

groupadd -g 3005 aid_admin
groupadd -g 3004 aid_net_raw
groupadd -g 3003 aid_inet
groupadd -g 3002 aid_bt_net
groupadd -g 3001 aid_bt
usermod -a -G aid_bt,aid_bt_net,aid_inet,aid_net_raw,aid_admin  mysql

不修改mysql启动会报错,报错信息如下:

2023-11-14T10:07:17.138424Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2023-11-14T10:07:17.138513Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 1
2023-11-14T10:07:19.222285Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-11-14T10:07:19.223207Z 0 [ERROR] [MY-010250] [Server] Failed to create a socket for IPv4 '0.0.0.0': errno: 13.
2023-11-14T10:07:19.223318Z 0 [ERROR] [MY-010255] [Server] Can't create IP socket: Permission denied
2023-11-14T10:07:19.223587Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-11-14T10:07:20.361212Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.

新建文件和文件夹

mkdir -p /soft/mysql/conf
mkdir -p /soft/mysql/data
mkdir -p /soft/mysql/logs
touch  /soft/mysql/logs/error.log

在conf下创建my.cnf文件

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
max_allowed_packet = 100M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

创建docker-compose.yml

version: '3.1'
services:
  db:
    image: registry.cn-hangzhou.aliyuncs.com/milili/mysql8-arm64:v1
    restart: always
    container_name: MySQL8
    environment:
      MYSQL_ROOT_PASSWORD: root
    command:
      --default-authentication-plugin=mysql_native_password
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_general_ci
      --explicit_defaults_for_timestamp=true
      --lower_case_table_names=1
    ports:
      - 3306:3306
    volumes:
      - ./data:/var/lib/mysql
      - ./conf:/etc/mysql/conf.d
      - ./logs:/logs

5、内网穿透

网上教程很多自己百度

6、搭建halo

参考地址:https://www.halo.run/

7、效果展示