chroot: require explicit initialisation (MR 2252)

We currently lazily initialize the chroot's on first use, plus a few
bonus calls to init. However, there are some instances where we actually
don't want the chroot to be initialised (mostly to break recursion
loops).

Simplify the codebase by removing all of this, and just calling
pmb.chroot.init() where it's needed.

In addition, print a warning if init() is called multiple times for one
chroot. This should help us catch these instances if they crop up again.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-05-24 04:03:57 +02:00 committed by Oliver Smith
parent 22f805a325
commit 1d9bbd613e
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
11 changed files with 21 additions and 21 deletions

View file

@ -1,6 +1,7 @@
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import os
from pmb.core.chroot import Chroot
from pmb.helpers import logging
from pmb.core.types import PmbArgs