Improved pmbootstrap init (#1095)

This PR makes the workflow faster and pmbootstrap will
produce less traffic. Details:
* Check if it's possible to create and read from a device
  node directly when initializing a chroot (closes #472)
* Copy the Qemu binary into the forign-arch chroots
  before initializing them, so the post-install script
  directly work during the chroot setup and we don't need
  to call apk fix afterwards
* Use pmb.helpers.repo.update(), which only updates the
  APKINDEX files if they are older than 4 hours, instead
  of using apk's repo update function which always
  downloads the APKINDEX files
* Chroot initialization
  * Getting the initial APKINDEX to download apk-tools-static
  * Updating the APKINDEX at the start of pmbootstrap install
* Fixed a bug in from_chroot_suffix: the buildroot_x86_64 has
  architecture x86_64, not x86.
This commit is contained in:
Oliver Smith 2018-01-23 00:54:48 +00:00 committed by GitHub
parent 6763627633
commit 3c8a93fa7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 37 deletions

View file

@ -42,7 +42,7 @@ def from_chroot_suffix(args, suffix):
if suffix == "rootfs_" + args.device:
return args.deviceinfo["arch"]
if suffix.startswith("buildroot_"):
return suffix.split("_", 2)[1]
return suffix.split("_", 1)[1]
raise ValueError("Invalid chroot suffix: " + suffix +
" (wrong device chosen in 'init' step?)")