小米平板2(latte)安装PostmarketOS

小米平板2(latte)安装PostmarketOS[转载翻译]#

源码#

源码在github: https://github.com/xvoidee/xiaomi-latte-postmarketos. I am promoting amazing work done by postmarketos community and QuickSwift315490 who did necessary adaptations in order to get it running on latte.

声明​#

我不对你的设备、你自己或你的环境因设备可能变砖而造成的任何损害负责。按照本指南的步骤操作即表示你同意此声明,所有操作均由你自行承担风险。

参考​#

环境​#

  • Arch Linux
  • 已经解锁的Xiaomi Mi Pad 2 16G版本

必须软件#

安装以下软件:

$ sudo pacman -S kpartx multipath-tools android-tools

测试python3已经安装:

$ python --version
Python 3.14.2

(由于时间更新,以下输出可能略微有点不同)

准备pmbootstrap​#

$ cd ~
$ mkdir _latte
$ cd ~/_latte
$ git clone https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
$ cd ~/_latte/pmbootstrap
$ git checkout 3.8.0
$ git status
HEAD detached at 3.8.0
nothing to commit, working tree clean
$ cd ~/_latte
$ mkdir pmbootstrap_work

初始化设备​#

重要提示:不要在postmarketos-usb-moded-default-profile中选择充电,保持默认值。当我在这里设置充电时,OTG 键盘无法工作。

Linux透明代理

Linux透明代理#

支持透明代理(Transparent proxy support)#

This feature adds Linux 2.2-like transparent proxy support to current kernels.To use it, enable the socket match and the TPROXY target in your kernel config.You will need policy routing too, so be sure to enable that as well.

该功能为当前内核增加了类似于 Linux 2.2 的透明代理支持。要使用此功能,您需要在内核配置中启用 socket 匹配(socket match)和 TPROXY 目标(TPROXY target)。同时,您还需要策略路由(policy routing),因此请务必也启用该功能。

From Linux 4.18 transparent proxy support is also available in nf_tables.

从 Linux 4.18 开始,nf_tables 也支持透明代理功能。

让非本地套接字工作(Making non-local sockets work)#

The idea is that you identify packets with destination address matching a local socket on your box, set the packet mark to a certain value::