Hi
I've been migrating my "Gold Build Automation" scripts to work with Fedora 12 and have run into a problem whereby my "%pre" python script is unable to read any user input, even on tty3.
My issues started when I noticed Fedora 12 does not have the "chvt" command. I added "chvt" to the "install.img" and it seems to work (switches to tty3 during the install) however I do not see my "%pre" python script "Enter hostname: " prompt on tty3. The script is running in that it has created files inside /tmp, however tty3 does not cater for "input"
I'm guessing there is a fundamental change in anaconda where std/stdout have been re-directed and are no longer available on tty3?
Any ideas?
My %pre looks like this:
%pre
chvt 3
PREINSTALL='http://192.100.1.161/build/fedora/FGB-12.0/FGB-12.0_preinstall.py'
wget -q -O/tmp/preinstall.py $PREINSTALL || echo "Error: Fetching $PREINSTALL failed."
/usr/bin/python /tmp/preinstall.py || cat
chvt 1
and a test python script:
#!/usr/bin/env python
import sys
import os
print "STARTING PREINSTALL SCRIPT"
answer = raw_input("Type return to continue: ")
---------- Post added at 12:22 PM CST ---------- Previous post was at 10:53 AM CST ----------
In answer to my own question, I got the following from the anaconda mail archives:
%pre
PREINSTALL='http://192.100.1.161/build/fedora/FGB-12.0/FGB-12.0_preinstall.py'
wget -q -O/tmp/preinstall.py $PREINSTALL || echo "Error: Fetching $PREINSTALL failed."
chvt 3
exec < /dev/tty3 > /dev/tty3 2>&1
/usr/bin/python /tmp/preinstall.py
exec < /dev/tty1 > /dev/tty1
chvt 1
Adding the stderr to stdout appears to have done the trick