Commits on Source (27)
-
Caleb Connolly authored
Make intellisense happy Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
make mypy happy Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Lazy load pmb.config.styles and move the pmb.__version__ print elsewhere so the logging module is (closer to) a standalone entity. This is necessary to be able to import it in pmb/helpers/apk.py otherwise we get a cyclical dependency. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
This function better belongs here, especially as it will be used outside of the context of a chroot() soon. Additionally, it's adjusted to take the rootfs path as its first argument rather than a chroot, since it could operate on any rootfs. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
In 0b4fb911 (chroot: always run apk static v2 (MR 2423)) we adjusted install_run_apk() to run apk static on the host and pass in the local binary repo with "--repository". This function can call apk in two ways, either with the progress bar handling or without, the second case was never updated and still ran apk inside the chroot incorrectly and with an incorrect --repository flag. Let's finish the job by refactoring helpers/apk.py to support all our usecases and pointing everything to it, removing the last few situations where we call "pmb.chroot.root(["apk", ...]). The apk_with_progress() function is replaced by a generic "run()" function which takes a boolean to indicate if we should render apk progress. Additionally, a new cache_clean() function is added so that "pmbootstrap zap --pkgs-online-mismatch" can FINALLY be refactored to not rely on a chroot existing. This requires some hacks but nothing serious, see the comments in the function for details. The chroot.init() code is now simplified since handling the --root, --arch, --cache-dir, and --repository flags is now all done by apk._prepare_cmd() as and when appropriate. Lastly, this fixes a (previously unnoticed) bug where apk.static was actually using /var/cache/apk on your host machine for its cache... This is definitely not good behaviour.... Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Since all apk invocations withing pmbootstrap now use apk.static by default, apk_static.run() isn't called anymore, so let's remove it. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Move the apk_static module from pmb/chroot to pmb/helpers which is a more suitable location. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Since parse.deviceinfo() returns a custom class now, it can't be trivially serialized as JSON. This has been broken for months now so it's clear nobody is using this. Let's take the chance to get rid of it. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
When running "apk add" we must always have --cache-dir set! We also expect --no-interactive to be set. Add some asserts so we don't regress here. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
This was always a hack, and it looks like there (hopefully) aren't any placs where we still need to handle this. Possibly expecting regressions... But then we have something to write a test for. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
When pmbootstrap starts up, it loads the config file (or uses the defaults) and then merged some arguments (e.g. --work) into it. However in config.init.frontend() we were creating yet another new Config, but it's too late to merge args in at this point... Rework this slightly to fix that major oversight and remove the totally unnecessary hack of calling pmb.config.load() again. This fixes calling pmbootstrap init with --work Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
There was an oversight when this API was originally created and it implicitly assumed that the pmaports repository was always named "pmaports". This unfortunately broke some peoples workflows. Introduce a new "pkgrepo_name()" function and adjust the codebase to use it, as well as adjusting pkgrepo internally to special case the "pmaports" repo so that it's always named pmaports no matter what the directory itself is named. This is probably more complexity than we should be dealing with here, we should probably create a new type to encode this behaviour. Fixes: #2412 Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
We shouldn't overwrite config.aports if the user specified a custom --aports directory. We only want to do this to update the default if they're using a custom workdir. Make the code here less aggressive, and correctly use the last entry in config.aports as "pmaports" instead of the first. Fixes: #2386 Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Use Alpine 3.17 to test pmbootstrap with older versions of Python Fixes: #2477 Suggested-by:
Oliver Smith <ollieparanoid@postmarketos.org> Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
You can't check enum membership with __contains__() on Python 3.10, poke inside the enum instead. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Oliver Smith authored
pmbootstrap requires "tomli" if running with python < 3.11, so install it.
-
There is a lot of context and state management needed when using pmbootstrap, sometimes it can be a lot to keep in your head. Let's print the output of "pmbootstrap status" when stuff goes wrong, this might help remind people if e.g. their pmaports checkout is on the wrong branch, or they're building for the wrong device. Additionally, don't print the "run pmbootstrap log for details" message if pmbootstrap was called with --details-to-stdout Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
On some kernels (notably, WSL2) parted fails to inform the kernel about the new partition layout, leading to errors when trying to create the new filesystems. This change runs an additional `partprobe` after updating the partition table, informing the kernel about the new layout. Fixes: #2422 Signed-off-by:
Dominik Bayerl <dominik.bayerl@carissma.eu> [caleb: move call so it runs after partition_cgpt() as well] Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Caleb Connolly authored
While there are places where it would make some sense to catch issues in the lint stage, most of the lint failures are things like shellchcek or ruff which don't actually effect the functionality of the code. Let's just run pytest at the same time as these to speed up the overall pipeline. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Add the content from README.md to these files. Tweaked-by:
Oliver Smith <ollieparanoid@postmarketos.org>
-
Oliver Smith authored
The command has been removed, so remove it from README.md too.
-
Oliver Smith authored
In Debian, /usr/sbin is not in PATH of regular users unless using sudo. Fix that pmbootstrap won't find kpartx and losetup in /usr/sbin, and complains about these even though they are installed. Fixes: issue 2489
-
On debian systems in particular special handling is needed for /usr/sbin. Let's do this once and then provide the host deps we use in a nice accessible dictionary. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org> Tweaked-by:
Oliver Smith <ollieparanoid@postmarketos.org>
-
Remove this chroot-specific helper and merge it in with the existing require_programs() logic. Now we have one unified way to discover and use programs from the host and where we can put any additional special handling we might need. Signed-off-by:
Caleb Connolly <caleb@postmarketos.org>
-
Oliver Smith authored
Use the absolute path for it, so it works in Debian too as we run it without sudo here to just check if the argument is supported.
-
Oliver Smith authored
We don't care about the output of "losetup --json" here, we just want to make sure that the argument exists. If it does not exist, we already give an error to the user. Set the output to null so it does not clutter the log since it runs with every pmbootstrap command now.
Showing
- .ci/pytest.sh 3 additions, 1 deletion.ci/pytest.sh
- .gitlab-ci.yml 26 additions, 10 deletions.gitlab-ci.yml
- README.md 0 additions, 5 deletionsREADME.md
- docs/api/pmb.chroot.rst 0 additions, 8 deletionsdocs/api/pmb.chroot.rst
- docs/api/pmb.helpers.rst 8 additions, 0 deletionsdocs/api/pmb.helpers.rst
- docs/chroot.rst 54 additions, 0 deletionsdocs/chroot.rst
- docs/debugging.rst 33 additions, 0 deletionsdocs/debugging.rst
- docs/index.rst 2 additions, 0 deletionsdocs/index.rst
- docs/usage.rst 105 additions, 0 deletionsdocs/usage.rst
- pmb/__init__.py 11 additions, 2 deletionspmb/__init__.py
- pmb/aportgen/busybox_static.py 0 additions, 1 deletionpmb/aportgen/busybox_static.py
- pmb/aportgen/grub_efi.py 0 additions, 1 deletionpmb/aportgen/grub_efi.py
- pmb/aportgen/musl.py 0 additions, 1 deletionpmb/aportgen/musl.py
- pmb/build/backend.py 3 additions, 3 deletionspmb/build/backend.py
- pmb/chroot/apk.py 6 additions, 68 deletionspmb/chroot/apk.py
- pmb/chroot/init.py 9 additions, 13 deletionspmb/chroot/init.py
- pmb/chroot/initfs_hooks.py 1 addition, 1 deletionpmb/chroot/initfs_hooks.py
- pmb/chroot/run.py 2 additions, 20 deletionspmb/chroot/run.py
- pmb/chroot/zap.py 4 additions, 15 deletionspmb/chroot/zap.py
- pmb/commands/__init__.py 0 additions, 1 deletionpmb/commands/__init__.py
docs/chroot.rst
0 → 100644
docs/debugging.rst
0 → 100644