forked from Mirror/pmbootstrap
chroot: apk: safety net when chroot unitialized (MR 2252)
We recently changed how we manage chroots, requiring the user (of the chroot) to initialize it before doing stuff like installing packages. There are however still certain edgecases in pmbootstrap where this doesn't get done (for example qemu/run.py would attempt to install the kernel package for the device, but we don't initialize the rootfs chroot in QEMU since that doesn't make sense to do). Check for and catch this situation explicitly so we don't ruin someones day, but still be loud about it so we can hopefully catch the remaining instances of this. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
794048e2d5
commit
cb6cd3bc4c
3 changed files with 16 additions and 0 deletions
|
@ -91,6 +91,10 @@ class Chroot:
|
|||
return (self / "bin/sh").is_symlink()
|
||||
|
||||
|
||||
def is_mounted(self) -> bool:
|
||||
return self.exists() and pmb.helpers.mount.ismount(self.path / "etc/apk/keys")
|
||||
|
||||
|
||||
@property
|
||||
def arch(self) -> Arch:
|
||||
if self.type == ChrootType.NATIVE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue