pmb.chroot.shutdown: clean up chroot marker here (MR 2082)

Remove /in-pmbootstrap inside chroots in "pmbootstrap shutdown" instead
of having it at a specific part of "pmbootstrap install".

Reasoning:
* With current approach, it didn't get removed in the on-device
  installer chroot.
* This is less error prone than calling it multiple times in
  "pmbootstrap install"
This commit is contained in:
Oliver Smith 2021-07-11 16:59:28 +02:00
parent c347b27f69
commit 7616803207
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 10 additions and 7 deletions

View file

@ -33,7 +33,8 @@ def copy_resolv_conf(args, suffix="native"):
def mark_in_chroot(args, suffix="native"):
"""
Touch a flag so we can know when we're running in chroot (and
don't accidentally flash partitions on our host)
don't accidentally flash partitions on our host). This marker
gets removed in pmb.chroot.shutdown (pmbootstrap shutdown).
"""
in_chroot_file = f"{args.work}/chroot_{suffix}/in-pmbootstrap"
if not os.path.exists(in_chroot_file):