I zap chroots a lot, since I've found that it often "fixes" a lot of
weird issues that come about if you have stale chroots laying around.
So a common pattern I do is "pmb zap && pmb install ...". Having an
option to pmb install let's me simplify this.
---
pmb/install/_install.py | 3 +++pmb/parse/arguments.py | 2 ++
2 files changed, 5 insertions(+)
diff --git a/pmb/install/_install.py b/pmb/install/_install.py
index 1adfe789..2f8e6e6a 100644
--- a/pmb/install/_install.py+++ b/pmb/install/_install.py
@@ -1170,6 +1170,9 @@ def install(args):
else:
steps = 4
+ if args.zap:+ pmb.chroot.zap(args, False)+ # Install required programs in native chroot
step = 1
logging.info(f"*** ({step}/{steps}) PREPARE NATIVE CHROOT ***")
diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py
index ffd8780c..b38d9cec 100644
--- a/pmb/parse/arguments.py+++ b/pmb/parse/arguments.py
@@ -135,6 +135,8 @@ def arguments_install(subparser):
group.add_argument("--iter-time", help="cryptsetup iteration time (in"
" milliseconds) to use when encrypting the system"
" partition")
+ group.add_argument("--zap", help="zap chroots before installing",+ action="store_true") # Packages
group = ret.add_argument_group(
--
2.43.0
On Freitag, 15. Dezember 2023 00:40:51 CET Clayton Craft wrote:
> I zap chroots a lot, since I've found that it often "fixes" a lot of> weird issues that come about if you have stale chroots laying around.> So a common pattern I do is "pmb zap && pmb install ...". Having an> option to pmb install let's me simplify this.
Tbh not super convinced by this since it is as easy as the example command you
put there in the message. There's already many many options for pmbootstrap so
adding more isn't my favorite thing.
But if Ollie's fine, fine with me also.
Regards
Luca
> ---> pmb/install/_install.py | 3 +++> pmb/parse/arguments.py | 2 ++> 2 files changed, 5 insertions(+)> > diff --git a/pmb/install/_install.py b/pmb/install/_install.py> index 1adfe789..2f8e6e6a 100644> --- a/pmb/install/_install.py> +++ b/pmb/install/_install.py> @@ -1170,6 +1170,9 @@ def install(args):> else:> steps = 4> > + if args.zap:> + pmb.chroot.zap(args, False)> +> # Install required programs in native chroot> step = 1> logging.info(f"*** ({step}/{steps}) PREPARE NATIVE CHROOT ***")> diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py> index ffd8780c..b38d9cec 100644> --- a/pmb/parse/arguments.py> +++ b/pmb/parse/arguments.py> @@ -135,6 +135,8 @@ def arguments_install(subparser):> group.add_argument("--iter-time", help="cryptsetup iteration time (in"> " milliseconds) to use when encrypting the system"> " partition")> + group.add_argument("--zap", help="zap chroots before installing",> + action="store_true")> > # Packages> group = ret.add_argument_group(
On Fri Dec 15, 2023 at 12:40 AM CET, Clayton Craft wrote:
> I zap chroots a lot, since I've found that it often "fixes" a lot of> weird issues that come about if you have stale chroots laying around.> So a common pattern I do is "pmb zap && pmb install ...". Having an> option to pmb install let's me simplify this.
I find myself writing "pmbootstrap zap && pmbootstrap install" a lot as
well, so I think this is a good improvement even though it adds another
argument. (At least the arguments are grouped by purpose if looking at
-h).
Thank you for the patch!
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
> --- a/pmb/parse/arguments.py> +++ b/pmb/parse/arguments.py> @@ -135,6 +135,8 @@ def arguments_install(subparser):> group.add_argument("--iter-time", help="cryptsetup iteration time (in"> " milliseconds) to use when encrypting the system"> " partition")> + group.add_argument("--zap", help="zap chroots before installing",> + action="store_true")
This needs to be moved, currently it adds it to the FDE group of
arguments. I'll fix it before merge.
On Thu, 14 Dec 2023 15:40:51 -0800, Clayton Craft wrote:
> I zap chroots a lot, since I've found that it often "fixes" a lot of> weird issues that come about if you have stale chroots laying around.> So a common pattern I do is "pmb zap && pmb install ...". Having an> option to pmb install let's me simplify this.> >
Applied, thanks!
[1/1] pmb.install: add --zap option
commit: 1020ea1a8b0c30bec57d038f19a08ad21455e6c2
Best regards,
--
Oliver Smith <ollieparanoid@postmarketos.org>