1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-21 11:35:08 +03:00

Revert "chroot: allow mounting the device rootfs (MR 2252)"

This reverts commit f331b95824.
This commit is contained in:
Casey Connolly 2025-05-10 16:08:34 +02:00
parent d8886b086a
commit 9a6e32fb6d
No known key found for this signature in database
GPG key ID: 0583312B195F64B6
7 changed files with 26 additions and 64 deletions

View file

@ -15,7 +15,6 @@ class ChrootType(enum.Enum):
BUILDROOT = "buildroot"
INSTALLER = "installer"
NATIVE = "native"
IMAGE = "image"
def __str__(self) -> str:
return self.name
@ -58,15 +57,12 @@ class Chroot:
if self.__type == ChrootType.NATIVE and self.__name != "":
raise ValueError(f"The native suffix can't have a name but got: '{self.__name}'")
if self.__type == ChrootType.IMAGE and not Path(self.__name).exists():
raise ValueError(f"Image file '{self.__name}' does not exist")
# rootfs suffixes must have a valid device name
if self.__type == ChrootType.ROOTFS and (len(self.__name) < 3 or "-" not in self.__name):
raise ValueError(f"Invalid device name: '{self.__name}'")
def __str__(self) -> str:
if len(self.__name) > 0 and self.type != ChrootType.IMAGE:
if len(self.__name) > 0:
return f"{self.__type.value}_{self.__name}"
else:
return self.__type.value