Bug 120252 - Scripted (kickstart) installation fails
Summary: Scripted (kickstart) installation fails
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: anaconda   
(Show other bugs)
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: FC2Blocker FC3Target 166250
TreeView+ depends on / blocked
 
Reported: 2004-04-07 11:20 UTC by Benny Amorsen
Modified: 2007-04-18 17:05 UTC (History)
0 users

Fixed In Version: rhel4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-03 18:00:10 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Kickstart file that causes the problem (1.72 KB, text/plain)
2004-04-08 09:22 UTC, Benny Amorsen
no flags Details
Ugly workaround patch (602 bytes, patch)
2004-05-07 11:54 UTC, Benny Amorsen
no flags Details | Diff
patch to fix undefined 'script' variable in readKickstart (473 bytes, patch)
2006-02-01 17:55 UTC, Michael Rice
no flags Details | Diff

Description Benny Amorsen 2004-04-07 11:20:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040312 Epiphany/1.1.12

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 ?
    instClass.setInstallData(id)
  File "/usr/lib/anaconda/kickstart.py", line 1318, in setInstallData
    self.readKickstart(id, self.file)
  File "/usr/lib/anaconda/kickstart.py", line 698, in readKickstart
    where = self.readKickstart(id, args[1], 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):


How reproducible:
Always

Steps to Reproduce:
1. Build installable CD with buildinstall
2. Add kickstart script to it (with %post section)
3. Boot the CD
    

Additional info:

It is not clear to me where the variable "script" is supposed to be
assigned, so I can't fix the bug myself.

Comment 1 Jeremy Katz 2004-04-08 01:45:44 UTC
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?

Comment 2 Benny Amorsen 2004-04-08 09:22:26 UTC
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.

Comment 3 Benny Amorsen 2004-04-08 09:24:29 UTC
Heh, off to change the default root password now... Duh.

Comment 4 Jeremy Katz 2004-05-06 21:50:20 UTC
Is this reproducible with newer trees?

Comment 5 Benny Amorsen 2004-05-07 11:53:54 UTC
The problem persists with anaconda-9.92-8. I haven't tried anything
later. I have an ugly workaround patch.

Comment 6 Benny Amorsen 2004-05-07 11:54:51 UTC
Created attachment 100072 [details]
Ugly workaround patch

Comment 7 Need Real Name 2004-06-03 23:09:45 UTC
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.

Comment 8 Jeremy Katz 2004-10-04 20:31:13 UTC
Finally reproduced.  Fixed in CVS.

Comment 9 Michael Rice 2006-02-01 17:54:31 UTC
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.  

Patch attached.

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.
$CDROM/RedHat/base/stage2.img).


Comment 10 Michael Rice 2006-02-01 17:55:31 UTC
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
it.


Note You need to log in before you can comment on or make changes to this bug.