一个复杂的chroot/build/flash工具,用于开发和安装postmarketos
pmbootstrap的Python项目详细描述
P引导
IntroductionSecurity WarningDevices
开发和安装postmarketOS的复杂chroot/build/flash工具。
包生成脚本现在位于^{
要求
- 建议编译2 GB RAM
- 主机系统上的Linux发行版(
x86
、x86_64
或aarch64
)- Windows subsystem for Linux (WSL)不工作请改用VirtualBox。
- 基于grsec补丁集的内核do not work(alpine:使用linux vanilla而不是linux hardend,arch:linux hardendis not based on grsec)
- 仅在Alpine Linux上:
apk add coreutils procps
- Linux kernel 3.17 or higher
- Python3.4+
- openssl
用法示例
有关porting to a new device或installation等主题的深入报道,请参阅postmarketOS wiki帮助输出(pmbootstrap -h
)对每个命令都有详细的使用说明请继续阅读一些可以使用pmbootstrap
完成的一般示例。
安装pmbootstrap
https://wiki.postmarketos.org/wiki/Installing_pmbootstrap
基础知识
初始设置:
$ pmbootstrap init
在第二个窗口中运行此命令以查看执行的所有shell命令:
$ pmbootstrap log
套餐
构建aports/main/hello-world
:
$ pmbootstrap build hello-world
交叉编译到armhf
:
$ pmbootstrap build --arch=armhf hello-world
使用本地文件夹中的源代码生成:
$ pmbootstrap build linux-postmarketos-mainline --src=~/code/linux
更新校验和:
$ pmbootstrap checksum hello-world
为新包生成模板:
$ pmbootstrap newapkbuild "https://gitlab.com/postmarketOS/osk-sdl/-/archive/0.52/osk-sdl-0.52.tar.bz2"
chroots
输入armhf
建筑基调:
$ pmbootstrap chroot -b armhf
在chroot中运行命令:
$ pmbootstrap chroot -- echo test
安全删除所有chroots:
$ pmbootstrap zap
设备移植帮助
分析android ^{
$ pmbootstrap bootimg_analyze ~/Downloads/twrp-3.2.1-0-fp2.img
检查内核配置:
$ pmbootstrap kconfig check
编辑内核配置:
$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline
根文件系统
构建rootfs:
$ pmbootstrap install
使用全磁盘加密构建rootfs:
$ pmbootstrap install --fde
更新SD卡上已有的安装:
$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync
在QEMU中运行图像:
$ pmbootstrap qemu --image-size=1G
闪存到设备:
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_rootfs --partition=userdata
导出rootfs、kernel、initramfs、boot.img
等:
$ pmbootstrap export
提取initramfs
$ pmbootstrap initfs extract
构建和闪存Android恢复zip:
$ pmbootstrap install --android-recovery-zip
$ pmbootstrap flasher --method=adb sideload
存储库维护
列出没有二进制软件包的pmaports:
$ pmbootstrap repo_missing --arch=armhf --overview
对于二进制包具有过时依赖项的每个aport(例如,在soname bumps之后),增加pkgrel
:
$ pmbootstrap pkgrel_bump --auto
根据Alpine的aports的最新版本生成交叉编译器aports:
$ pmbootstrap aportgen binutils-armhf gcc-armhf
手动重建包索引:
$ pmbootstrap index
删除本地二进制包,不存在相同版本的ApORT:
$ pmbootstrap zap -m
调试
对任何操作使用-v
获取详细日志:
$ pmbootstrap -v build hello-world
解析单个APKBUILD并将其作为JSON返回:
$ pmbootstrap apkbuild_parse hello-world
解析APKINDEX中的包并将其作为JSON返回:
$ pmbootstrap apkindex_parse $WORK/cache_apk_x86_64/APKINDEX.8b865e19.tar.gz hello-world
ccache
统计:
$ pmbootstrap stats --arch=armhf
distccd
日志:
$ pmbootstrap log_distccd
开发
测试
安装pytest
(通过包管理器或pip),并在pmbootstrap文件夹中运行它。