~postmarketos/pmbootstrap-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
4 3

[PATCH pmbootstrap] pmb.install: add --zap option

Details
Message ID
<20231214234051.4673-1-clayton@craftyguy.net>
DKIM signature
missing
Download raw message
Patch: +5 -0
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

[pmbootstrap/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CXOGPLZE9S4X.1AM146XQZK7KM@cirno2>
In-Reply-To
<20231214234051.4673-1-clayton@craftyguy.net> (view parent)
DKIM signature
missing
Download raw message
pmbootstrap/patches/.build.yml: SUCCESS in 16m38s

[pmb.install: add --zap option][0] from [Clayton Craft][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/47750
[1]: clayton@craftyguy.net

✓ #1114981 SUCCESS pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/1114981
Details
Message ID
<2708662.mvXUDI8C0e@z3ntu.xyz>
In-Reply-To
<20231214234051.4673-1-clayton@craftyguy.net> (view parent)
DKIM signature
missing
Download raw message
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(
Details
Message ID
<CYA959PXNOKW.2LLHRMT64KX2B@pm-mail-aerc>
In-Reply-To
<20231214234051.4673-1-clayton@craftyguy.net> (view parent)
DKIM signature
missing
Download raw message
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.
Details
Message ID
<170481592330.2313.10774484647915503787.b4-ty@postmarketos.org>
In-Reply-To
<20231214234051.4673-1-clayton@craftyguy.net> (view parent)
DKIM signature
missing
Download raw message
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>
Reply to thread Export thread (mbox)