pmbootstrap, with Synit changes
Go to file
Oliver Smith 51bdc24315 Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.

I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.

To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.

In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.

In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".

This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.

Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).

The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
aports [mako] Use red screen workaround 2017-07-09 11:53:21 +02:00
keys Hello, there! 2017-05-26 22:08:45 +02:00
pmb Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129) 2017-07-10 15:23:43 +00:00
test Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129) 2017-07-10 15:23:43 +00:00
.gitignore gitignore: Added vim temporary files 2017-06-25 21:40:49 +02:00
.travis.yml Rename travis.yaml to travis.yml 2017-05-28 02:48:03 +02:00
CONTRIBUTING.md Add CONTRIBUTING.md 2017-05-28 03:40:30 +02:00
LICENSE Initial commit 2017-05-26 19:25:48 +00:00
README.md Close #103: Document how to use chroot commands with parameters 2017-06-23 23:46:09 +02:00
pmbootstrap.py Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129) 2017-07-10 15:23:43 +00:00

README.md

pmbootstrap

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

Static code analysis status: travis badge

Requirements

  • Linux distribution
  • Python 3
  • OpenSSL

Usage

Check out the porting guide for a practical start!

Run ./pmbootstrap.py init first, to select a target device and the work folder, which will contain all the chroots and other data. After that, you can run any command. All dependencies (e.g. chroots) will be installed automatically, if they are not available yet.

Here are some examples:

./pmbootstrap.py --help: List all available commands

./pmbootstrap.py log: Run tail -f on the logfile, which contains detailed output. Do this in a second terminal, while executing another pmbootstrap command to get all the details.

./pmbootstrap.py chroot: Open a shell inside a native Alpine Linux chroot (~6 MB install size).

./pmbootstrap.py chroot -- ls -l /home/user Execute ls -l /home/user inside the chroot. Make sure, that you use -- before the command, so all following options (e.g. -l) do not get interpreted by pmbootstrap, but passed correctly to your command.

./pmbootstrap.py chroot --suffix=buildroot_armhf: Open a shell inside an armhf Alpine Linux chroot, with qemu user mode emulation and binfmt support automatically set up.

./pmbootstrap.py build hello-world: Build the "hello-world" package (specify any package from the aports-folder here).

./pmbootstrap.py build hello-world --arch=armhf: Build the "hello-world" package for armhf inside the armhf chroot, with the cross-compiler installed in the native chroot (chroots are connected via distcc).

./pmbootstrap.py install: Generate a system image file with a full postmarketOS installation. All required packages get built first, if they do not exist yet. You will get asked for the "user" password and the root partition password.

./pmbootstrap.py install --sdcard=/dev/mmcblk0: Format and partition the SD card /dev/mmcblk0, and put a full postmarketOS installation on it

Testsuite

Simply install pytest (via your package manager or via pip) and run it inside the pmbootstrap folder.