Display progress during long kickstart %post script

Brad Doctor bdoctor at ps-ax.com
Thu Mar 3 15:43:26 UTC 2005


If you want to get into the code, kickstart.py is where to look.  For example:

# added intf as the final call argument
    def postAction(self, rootPath, serial, intf):
        mylen = len(self.postScripts)
        if mylen <= 1:
            waitwin = intf.waitWindow(_("Running post configuration scripts"),_("Please wait, this may take a few moments.. %s script to execute") %mylen )
        else:
            waitwin = intf.waitWindow(_("Running post configuration scripts"),_("Please wait, this may take a few moments.. %s scripts to execute") %mylen )


    log("Running kickstart %%post script(s)")
    for script in self.postScripts:
        script.run(rootPath, serial)
    log("All kickstart %%post script(s) have been run")
# added this waitwin.pop()
        waitwin.pop()

You have to also modify packages.py to provide the intf, which provides the
window functionality as well:

# Added intf=None in call so we can provide a gui
def doPostAction(id, instPath, intf=None):
    id.instClass.postAction(instPath, flags.serial,intf)

Having 'intf=None' maintains compatibility with other callers to this 
method, minimizing the ripple effect - if it is provided, cool, if not, cool.

I think that is the extent of it.  You then get a little window letting
the user know how many scripts there are.  No progress bar, but extending
it should be simple -- however how will you update it's progress?  I don't 
think you can do callbacks from the post interpreters.  That was my issue
and why I didn't do that.

-brad

> One of the virtual consoles, I think Ctrl+Alt+F3 already displays the
> progress of %post. You will probably not require any such script but
> just to educate the users.
> 
> Regards,
> Ajay
> 
> 
> On Thu, 3 Mar 2005 15:10:50 +0000 (GMT), David Bartlett
> <davidbartlett2003 at yahoo.co.uk> wrote:
> > Hi all,
> > 
> > I run a quite lengthy %post script (runtime = 5-10
> > minutes) as part of my kickstart build and would like
> > to include some useful output to reassure my users
> > that the build process is running normally and has not
> > hung. A progress bar to match the [text interface]
> > anaconda style would be ideal, but lines of text
> > simply echoed to screen would be ok in the meantime.
> > 
> > It looks as though the %post is spawned out of
> > anaconda and I'm not sure how to display messages to
> > screen from within my %post script (as anaconda still
> > owns the screen). I am reluctant to change the
> > anaconda python code as I really want to keep the
> > vendor tools standard. I use the text-only version of
> > anaconda and have no interest in the GUI component.
> > 
> > Has anyone else successfully controlled the screen
> > whilst anaconda is running, or have any thoughts on
> > this?
> > 
> > Thanks in advance.
> > 
> > Rgds, David Bartlett.
> > 
> > Send instant messages to your online friends http://uk.messenger.yahoo.com
> > 
> > _______________________________________________
> > Kickstart-list mailing list
> > Kickstart-list at redhat.com
> > https://www.redhat.com/mailman/listinfo/kickstart-list
> >
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 

-- 
Brad Doctor, CISSP




More information about the Kickstart-list mailing list