A sophisticated chroot / build / flash tool to develop and install postmarketOS
Reason this release was yanked:
Installing pmbootstrap from pypi is deprecated, see: https://postmarketos.org/pmbootstrap
Project description
pmbootstrap
Introduction | Security Warning | Devices
Sophisticated chroot/build/flash tool to develop and install postmarketOS.
Package build scripts live in the pmaports
repository now.
Requirements
- 2 GB of RAM recommended for compiling
- Linux distribution on the host system (
x86
,x86_64
, oraarch64
)- Windows subsystem for Linux (WSL) does not work! Please use VirtualBox instead.
- Kernels based on the grsec patchset do not work (Alpine: use linux-vanilla instead of linux-hardened, Arch: linux-hardened is not based on grsec)
- On Alpine Linux only:
apk add coreutils procps
- Linux kernel 3.17 or higher
- Python 3.4+
- OpenSSL
Usage Examples
Please refer to the postmarketOS wiki for in-depth coverage of topics such as porting to a new device or installation. The help output (pmbootstrap -h
) has detailed usage instructions for every command. Read on for some generic examples of what can be done with pmbootstrap
.
Installing pmbootstrap
https://wiki.postmarketos.org/wiki/Installing_pmbootstrap
Basics
Initial setup:
$ pmbootstrap init
Run this in a second window to see all shell commands that get executed:
$ pmbootstrap log
Packages
Build aports/main/hello-world
:
$ pmbootstrap build hello-world
Cross-compile to armhf
:
$ pmbootstrap build --arch=armhf hello-world
Build with source code from local folder:
$ pmbootstrap build linux-postmarketos-mainline --src=~/code/linux
Update checksums:
$ pmbootstrap checksum hello-world
Generate a template for a new package:
$ pmbootstrap newapkbuild "https://gitlab.com/postmarketOS/osk-sdl/-/archive/0.52/osk-sdl-0.52.tar.bz2"
Chroots
Enter the armhf
building chroot:
$ pmbootstrap chroot -b armhf
Run a command inside a chroot:
$ pmbootstrap chroot -- echo test
Safely delete all chroots:
$ pmbootstrap zap
Device Porting Assistance
Analyze Android boot.img
files (also works with recovery OS images like TWRP):
$ pmbootstrap bootimg_analyze ~/Downloads/twrp-3.2.1-0-fp2.img
Check kernel configs:
$ pmbootstrap kconfig check
Edit a kernel config:
$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline
Root File System
Build the rootfs:
$ pmbootstrap install
Build the rootfs with full disk encryption:
$ pmbootstrap install --fde
Update existing installation on SD card:
$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync
Run the image in QEMU:
$ pmbootstrap qemu --image-size=1G
Flash to the device:
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_rootfs --partition=userdata
Export the rootfs, kernel, initramfs, boot.img
etc.:
$ pmbootstrap export
Extract the initramfs
$ pmbootstrap initfs extract
Build and flash Android recovery zip:
$ pmbootstrap install --android-recovery-zip
$ pmbootstrap flasher --method=adb sideload
Repository Maintenance
List pmaports that don't have a binary package:
$ pmbootstrap repo_missing --arch=armhf --overview
Increase the pkgrel
for each aport where the binary package has outdated dependencies (e.g. after soname bumps):
$ pmbootstrap pkgrel_bump --auto
Generate cross-compiler aports based on the latest version from Alpine's aports:
$ pmbootstrap aportgen binutils-armhf gcc-armhf
Manually rebuild package index:
$ pmbootstrap index
Delete local binary packages without existing aport of same version:
$ pmbootstrap zap -m
Debugging
Use -v
on any action to get verbose logging:
$ pmbootstrap -v build hello-world
Parse a single APKBUILD and return it as JSON:
$ pmbootstrap apkbuild_parse hello-world
Parse a package from an APKINDEX and return it as JSON:
$ pmbootstrap apkindex_parse $WORK/cache_apk_x86_64/APKINDEX.8b865e19.tar.gz hello-world
ccache
statistics:
$ pmbootstrap stats --arch=armhf
distccd
log:
$ pmbootstrap log_distccd
Development
Testing
Install pytest
(via your package manager or pip) and run it inside the pmbootstrap folder.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pmbootstrap-1.8.3.tar.gz
.
File metadata
- Download URL: pmbootstrap-1.8.3.tar.gz
- Upload date:
- Size: 156.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21199a801157dbfd13bc7b908475df3a55fc312fe027a166081056ad1a6f4b55 |
|
MD5 | b0ff293bcdce7713763c44727b174a19 |
|
BLAKE2b-256 | 9de8b0ec67f0445a5a1631c7042058be2cb063ed30317426ed122b0023a0cfec |
Provenance
File details
Details for the file pmbootstrap-1.8.3-py3-none-any.whl
.
File metadata
- Download URL: pmbootstrap-1.8.3-py3-none-any.whl
- Upload date:
- Size: 201.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b13d058155f269beb3a8b29151ca4897492bdb39bf5d4348061162046a054c35 |
|
MD5 | 9d06e2c1baf5b2b903d53455c6aa4486 |
|
BLAKE2b-256 | fa372a34dd30c619b2da9caf87ad43a1474cc19ba36e0b1d6947758831de91a5 |