mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 11:29:46 +03:00
config: add auto_zap_misconfigured_chroots (MR 2252)
This option will make pmbootstrap automatically zap chroots that are initialized for the wrong channel, making it much faster to switch between edge and systemd. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
af826c671d
commit
c1aa5acdaa
4 changed files with 49 additions and 9 deletions
|
@ -114,10 +114,17 @@ def init(chroot: Chroot, usr_merge=UsrMerge.AUTO):
|
|||
|
||||
config = get_context().config
|
||||
|
||||
# If the channel is wrong and the user has auto_zap_misconfigured_chroots
|
||||
# enabled, zap the chroot and reinitialize it
|
||||
if chroot.exists():
|
||||
zap = pmb.config.workdir.chroot_check_channel(chroot)
|
||||
if zap:
|
||||
pmb.chroot.del_chroot(chroot.path, confirm=False)
|
||||
pmb.config.workdir.clean()
|
||||
|
||||
pmb.chroot.mount(chroot)
|
||||
mark_in_chroot(chroot)
|
||||
if chroot.exists():
|
||||
pmb.config.workdir.chroot_check_channel(chroot)
|
||||
copy_resolv_conf(chroot)
|
||||
pmb.chroot.apk.update_repository_list(chroot)
|
||||
warn_if_chroot_is_outdated(chroot)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue