[Libguestfs] [PATCH 03/11] customize: fix windows firstboot script

Pino Toscano ptoscano at redhat.com
Fri May 13 08:48:25 UTC 2016


On Friday 13 May 2016 10:36:10 Roman Kagan wrote:
> On Fri, May 13, 2016 at 09:17:40AM +0200, Cedric Bosdonnat wrote:
> > On Thu, 2016-05-12 at 17:24 +0300, Roman Kagan wrote:
> > > On Thu, May 12, 2016 at 03:29:11PM +0200, Cédric Bosdonnat wrote:
> > > > @@ -244,15 +244,14 @@ if not exist \"%%scripts_done%%\" (
> > > >  
> > > >  for %%%%f in (\"%%scripts%%\"\\*.bat) do (
> > > >    echo running \"%%%%f\"
> > > > -  call \"%%%%f\"
> > > > -  set elvl=!errorlevel!
> > > > -  echo .... exit code !elvl!
> > > > -  if !elvl! equ 0 (
> > > > -    move \"%%%%f\" \"%%scripts_done%%\"
> > > > -  )
> > > > +  move \"%%%%f\" \"%%scripts_done%%\"
> > > > +  pushd \"%%scripts_done%%\"
> > > > +  call \"%%%%~nf\"
> > > > +  popd
> > > >  )
> > > >  
> > > >  echo uninstalling firstboot service
> > > > +rmdir /S /Q \"%%scripts_done%%\"
> > > 
> > > How will you debug failures then?
> > > (And yes, linux firstboot is broken in this regard, too)
> > 
> > Good question! But I think this should be fixed in both linux and
> > windows cases in another commit. This one is only catching up what we
> > have in the linux case.
> > 
> > For the debugging purpose, couldn't we delete the successfully run
> > scripts one by one after they have run?
> 
> IMO deleting anything is a bad idea, in particular, because a succefully
> completed script may cause the following ones to fail.
> 
> The whole point of scripts_done is to preserve all the steps but move
> them out of the way.
> 
> I think the only controversial item is whether to move them to
> scripts_done on success only or regardless of the status: there are pros
> and cons either way.

Moving a script to scripts_done only after its execution ended means
that scripts which cause a reboot will be executed over and over. See
rhbz#1159651 and commit f8ed15462fbb03c5b19972361f2a2e6fed4c5f02.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160513/f3821d57/attachment.sig>


More information about the Libguestfs mailing list