mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-23 20:45:08 +03:00
Revert "chroot: allow mounting the device rootfs (MR 2252)"
This reverts commit f331b95824
.
This commit is contained in:
parent
feae3c8a20
commit
393f7e3616
7 changed files with 10 additions and 64 deletions
|
@ -66,14 +66,11 @@ def _parse_flavor(device: str, autoinstall: bool = True) -> str:
|
|||
|
||||
def _parse_suffix(args: PmbArgs) -> Chroot:
|
||||
deviceinfo = pmb.parse.deviceinfo()
|
||||
if getattr(args, "image", None):
|
||||
rootfs = Chroot.native() / f"home/pmos/rootfs/{deviceinfo.codename}.img"
|
||||
return Chroot(ChrootType.IMAGE, str(rootfs))
|
||||
if getattr(args, "rootfs", None):
|
||||
return Chroot(ChrootType.ROOTFS, get_context().config.device)
|
||||
elif args.buildroot:
|
||||
if args.buildroot == "device":
|
||||
return Chroot.buildroot(deviceinfo.arch)
|
||||
return Chroot.buildroot(pmb.parse.deviceinfo().arch)
|
||||
else:
|
||||
return Chroot.buildroot(Arch.from_str(args.buildroot))
|
||||
elif args.suffix:
|
||||
|
@ -145,18 +142,11 @@ def chroot(args: PmbArgs) -> None:
|
|||
# Suffix
|
||||
chroot = _parse_suffix(args)
|
||||
user = args.user
|
||||
if (
|
||||
user
|
||||
and chroot != Chroot.native()
|
||||
and chroot.type not in [ChrootType.BUILDROOT, ChrootType.IMAGE]
|
||||
):
|
||||
if user and chroot != Chroot.native() and chroot.type != ChrootType.BUILDROOT:
|
||||
raise RuntimeError("--user is only supported for native or buildroot_* chroots.")
|
||||
if args.xauth and chroot != Chroot.native():
|
||||
raise RuntimeError("--xauth is only supported for native chroot.")
|
||||
|
||||
if chroot.type == ChrootType.IMAGE:
|
||||
pmb.chroot.mount(chroot)
|
||||
|
||||
# apk: check minimum version, install packages
|
||||
pmb.chroot.apk.check_min_version(chroot)
|
||||
if args.add:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue