forked from Mirror/pmbootstrap
chroot: allow mounting the device rootfs (MR 2252)
Add a new flag --image which can be used to mount the rootfs generated with "pmbootstrap install". For now this is quite limited in scope. But it's enough to allow for building a package, updating it in the QEMU image, and then booting it. The major "gotcha" with this is that the QEMU uses the kernel and initramfs from the device chroot unless you run it with --efi. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
d1a86fe702
commit
f331b95824
8 changed files with 55 additions and 11 deletions
|
@ -14,6 +14,7 @@ class ChrootType(enum.Enum):
|
|||
BUILDROOT = "buildroot"
|
||||
INSTALLER = "installer"
|
||||
NATIVE = "native"
|
||||
IMAGE = "image"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
|
@ -65,9 +66,12 @@ class Chroot:
|
|||
raise ValueError(f"The native suffix can't have a name but got: "
|
||||
f"'{self.__name}'")
|
||||
|
||||
if self.__type == ChrootType.IMAGE and not Path(self.__name).exists():
|
||||
raise ValueError(f"Image file '{self.__name}' does not exist")
|
||||
|
||||
|
||||
def __str__(self) -> str:
|
||||
if len(self.__name) > 0:
|
||||
if len(self.__name) > 0 and self.type != ChrootType.IMAGE:
|
||||
return f"{self.__type.value}_{self.__name}"
|
||||
else:
|
||||
return self.__type.value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue