Red Hat Bugzilla – Bug 120252
Scripted (kickstart) installation fails
Last modified: 2007-04-18 13:05:34 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Description of problem:
When doing an install with kickstart and a %post-script, the following
error appears (copied by hand):
Traceback (most recent call last):
File "/usr/bin/anaconda", line 1090, in ?
File "/usr/lib/anaconda/kickstart.py", line 1318, in setInstallData
File "/usr/lib/anaconda/kickstart.py", line 698, in readKickstart
where = self.readKickstart(id, args, where = where)
File "/usr/lib/anaconda/kickstart.py", line 758, in readKickstart
script = script + n
UnboundLocalError: local variable 'script' referenced before assignment
install exited abnormally
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build installable CD with buildinstall
2. Add kickstart script to it (with %post section)
3. Boot the CD
It is not clear to me where the variable "script" is supposed to be
assigned, so I can't fix the bug myself.
Can you save the complete dump and attach it? I can't reproduce this
here (I do lots of kickstarts with a %post that always gets run). Any
odd kernel messages on tty4?
Created attachment 99231 [details]
Kickstart file that causes the problem
Here is the kickstart file that causes the problem. The traceback I posted
earlier is all I get as far as I can tell.
Heh, off to change the default root password now... Duh.
Is this reproducible with newer trees?
The problem persists with anaconda-9.92-8. I haven't tried anything
later. I have an ugly workaround patch.
Created attachment 100072 [details]
Ugly workaround patch
I am seeing this bug also. My commonality with this kickstart script
is that I'm using %includes (much more frequently in my case however)
in %post, as well as all other sections. I will be happy to attach my
ks.cfg if you desire.
Finally reproduced. Fixed in CVS.
I had this problem in 3ES U4 with a kickstart config with both %include and
%post scripts. Remove either and it didn't generate the error noted above.
The fix is VERY similar to Benny's, but I pulled the code from a 4ES U2 anaconda
where the readKickstart method is very similar.
To use this loopback mount your stage2.img file somewhere, copy all the files to
a working directory. Patch $workingdir/usr/lib/anaconda/kickstart.py with the
attached patch. mkcramfs $workingdir /tmp/stage2-patched.img
copy the /tmp/stage2-patched.img to your kickstart base directory (e.g.
Created attachment 123980 [details]
patch to fix undefined 'script' variable in readKickstart
Read the posting where this is attached for more information on how to apply