public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] livecd_stage2 autoresume clear
@ 2016-04-11 14:07 Marco Gigante
  2016-04-11 17:39 ` Brian Dolbec
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Gigante @ 2016-04-11 14:07 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

Hi. I'm using catalyst to generate installcd-stage2-minimal with custom 
changes and packages.
I realized catalyst clears autoresume states once the iso image was 
successfully generated, regardless the fact I run catalyst with or 
without --clear-autoresume option.

Poking around the code, for my convenience I made the change as in the 
attached diff (vs. master branch).
Could such modification bring to unexpected behaviour?

I tried with all 2.X, 3.0, and master branches seeing the same behaviour.

Thanks in advance for any help.
marco

[-- Attachment #2: 0001-Set-autoresume-clear-option-dependent-for-livecd_sta.patch --]
[-- Type: text/x-patch, Size: 921 bytes --]

From 60458178bdbd3d18e4264a16641365b898880774 Mon Sep 17 00:00:00 2001
From: Marco Gigante <m.gigante@nextworks.it>
Date: Mon, 11 Apr 2016 15:23:31 +0200
Subject: [PATCH] Set autoresume clear option-dependent for livecd_stage2

---
 catalyst/targets/livecd_stage2.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index ea916b8..e1e7496 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -83,4 +83,5 @@ class livecd_stage2(StageBase):
 				"livecd_update","root_overlay","fsscript","rcupdate","unmerge",\
 				"unbind","remove","empty","target_setup",\
 				"setup_overlay","create_iso"]
-		self.settings["action_sequence"].append("clear_autoresume")
+		if "clear-autoresume" not in self.settings["options"]:
+			self.settings["action_sequence"].append("clear_autoresume")
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-catalyst] livecd_stage2 autoresume clear
  2016-04-11 14:07 [gentoo-catalyst] livecd_stage2 autoresume clear Marco Gigante
@ 2016-04-11 17:39 ` Brian Dolbec
  2016-04-12  6:37   ` Marco Gigante
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dolbec @ 2016-04-11 17:39 UTC (permalink / raw
  To: gentoo-catalyst

On Mon, 11 Apr 2016 16:07:11 +0200
Marco Gigante <m.gigante@nextworks.it> wrote:

> Hi. I'm using catalyst to generate installcd-stage2-minimal with
> custom changes and packages.
> I realized catalyst clears autoresume states once the iso image was 
> successfully generated, regardless the fact I run catalyst with or 
> without --clear-autoresume option.
> 
> Poking around the code, for my convenience I made the change as in
> the attached diff (vs. master branch).
> Could such modification bring to unexpected behaviour?
> 
> I tried with all 2.X, 3.0, and master branches seeing the same
> behaviour.
> 
> Thanks in advance for any help.
> marco


catalyst always clears resume points when any stage has completed
successfully.  

Why would it do anything else???

Not clearing the resume point would render the stage unable to run
again, skipping past everything already completed which would be the
whole process.   That would force you to use the clear-autoresume
option each time you want to do a new run.

I don't understand the reasoning for this patch


-  self.settings["action_sequence"].append("clear_autoresume")
+  if "clear-autoresume" not in self.settings["options"]:
+	self.settings["action_sequence"].append("clear_autoresume")

This if statement causes kind of the opposite of what I expect the
clear-autoresume option to do.  This action sequence setting is for
clearing the resume points after it has successfully done all previous
action sequences.  What you appear to be doing avove seems more like
the "keepwork" option.  Please look at the set_completion_action_sequences()
function in base/stagebase.py.  That is a relatively recently created
function which cleans up some code duplication I found.  Perhaps that
function can apply to the livecd_stage2 operation as well.  If not all
of it applies then you can use part of it to maintain consistent option
use and behaviour.
-- 
Brian Dolbec <dolsen>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-catalyst] livecd_stage2 autoresume clear
  2016-04-11 17:39 ` Brian Dolbec
@ 2016-04-12  6:37   ` Marco Gigante
  0 siblings, 0 replies; 3+ messages in thread
From: Marco Gigante @ 2016-04-12  6:37 UTC (permalink / raw
  To: gentoo-catalyst

On 11/04/2016 19:39, Brian Dolbec wrote:
> On Mon, 11 Apr 2016 16:07:11 +0200
> Marco Gigante <m.gigante@nextworks.it> wrote:
>
>> Hi. I'm using catalyst to generate installcd-stage2-minimal with
>> custom changes and packages.
>> I realized catalyst clears autoresume states once the iso image was
>> successfully generated, regardless the fact I run catalyst with or
>> without --clear-autoresume option.
>>
>> Poking around the code, for my convenience I made the change as in
>> the attached diff (vs. master branch).
>> Could such modification bring to unexpected behaviour?
>>
>> I tried with all 2.X, 3.0, and master branches seeing the same
>> behaviour.
>>
>> Thanks in advance for any help.
>> marco
>
> catalyst always clears resume points when any stage has completed
> successfully.
>
> Why would it do anything else???

Because during development and test it is useful to tun just some of the 
steps without going through all the steps, which is very time consuming.
Since there is the --clear-autoresume option to explicitly clears the 
states, I assumed the default would be to not clear them.

>
> Not clearing the resume point would render the stage unable to run
> again, skipping past everything already completed which would be the
> whole process.   That would force you to use the clear-autoresume
> option each time you want to do a new run.
>
> I don't understand the reasoning for this patch

Well, the patch was intended to better illustrate my question, not to 
apply it.

>
>
> -  self.settings["action_sequence"].append("clear_autoresume")
> +  if "clear-autoresume" not in self.settings["options"]:
> +	self.settings["action_sequence"].append("clear_autoresume")
>
> This if statement causes kind of the opposite of what I expect the
> clear-autoresume option to do.  This action sequence setting is for
> clearing the resume points after it has successfully done all previous
> action sequences.  What you appear to be doing avove seems more like
> the "keepwork" option.  Please look at the set_completion_action_sequences()
> function in base/stagebase.py.  That is a relatively recently created
> function which cleans up some code duplication I found.  Perhaps that
> function can apply to the livecd_stage2 operation as well.  If not all
> of it applies then you can use part of it to maintain consistent option
> use and behaviour.

oh, ok. keepwork went completely unnoticed to me. I'm running catalyst 
v2 and from there I went into the repository to look at the code. Then I 
used the latest code on master branch to illustrate my question.
I'm pretty new to catalyst and I'm still figuring out the whole picture.

Thanks for the explanation.
marco



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-12  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 14:07 [gentoo-catalyst] livecd_stage2 autoresume clear Marco Gigante
2016-04-11 17:39 ` Brian Dolbec
2016-04-12  6:37   ` Marco Gigante

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox