pmbootstrap, with Synit changes
Go to file
Oliver Smith 543705262b
Only print 'pmbootstrap log' msg to stdout (#1453)
Prevent the "Run 'pmbootstrap log' for details" message from being
written to the log file that gets read with "pmbootstrap log". Because
when the output of "pmbootstrap log" is pasted somewhere and people
analyze it, the message sounds like this is not the output of
"pmbootstrap log" (like it happened the other day in #postmarketOS).
2018-05-01 00:22:16 +00:00
.github GitHub templates for issues and PRs (#1434) 2018-04-21 16:17:17 +00:00
.travis Travis: Check for device documentation (#1369) 2018-03-28 21:28:26 +00:00
aports Add initial device support for Xiaomi Redmi Note 4 (xiaomi-mido) (#1415) 2018-04-25 11:40:16 +02:00
helpers Add envkernel.sh: instant mainlining environment (#1424) 2018-04-19 21:27:38 +00:00
keys Close #871: Enable binary repository (#887) 2017-11-19 15:04:08 +00:00
pmb Only print 'pmbootstrap log' msg to stdout (#1453) 2018-05-01 00:22:16 +00:00
test Display wiki link on dependency error (#1410) 2018-04-23 20:51:06 +00:00
.gitignore gitignore: Add pytest cache 2018-02-06 23:10:25 +01:00
.travis.yml Travis CI: folded output/default tracebacks (#1331) 2018-03-14 20:32:47 +00:00
CONTRIBUTING.md CONTRIBUTING.md: Mention that we squash PRs (#651) 2017-09-29 21:23:46 +00:00
LICENSE Initial commit 2017-05-26 19:25:48 +00:00
MANIFEST.in Close #327: Add initial setup.py (#443) 2017-09-02 19:30:40 +00:00
README.md "...flasher flash_rootfs" instead of "..._system" (#1373) 2018-03-30 01:11:20 +00:00
pmbootstrap.py Happy new year! (update copyright to 2018) 2018-01-04 04:53:35 +01:00
setup.cfg Close #327: Add initial setup.py (#443) 2017-09-02 19:30:40 +00:00
setup.py Close #327: Add initial setup.py (#443) 2017-09-02 19:30:40 +00:00

README.md

pmbootstrap

Introduction | Security Warning | Devices | travis badge | Coverage Status

Sophisticated chroot/build/flash tool to develop and install postmarketOS.

Requirements

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.

Basics

Initial setup:

$ git clone https://github.com/postmarketOS/pmbootstrap
$ cd pmbootstrap
$ alias pmbootstrap=$PWD/pmbootstrap.py
$ pmbootstrap init

To make the pmbootstrap alias persistent, see the wiki.

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://github.com/postmarketOS/osk-sdl/archive/0.51.tar.gz"

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 menuconfig --arch=armhf postmarketos-mainline

System Image

Build the system image:

$ pmbootstrap install

Update existing installation on SD card (full disk encryption disabled):

$ pmbootstrap install --sdcard=/dev/mmcblk0 --no-fde --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

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

GPLv3