1

I am have an issue where I am trying to store a user's input in the variable called $mail, in the %pre environment of anaconda, and then pass it into the %post script, where it will append to the file /foo/bar. I've tried it as such:

%pre
exec < /dev/tty5 > /dev/tty5 2> /dev/tty5
chvt5

echo "Please enter your Email Address."
read emailaddr
echo "$emailaddr" > /tmp/email.tmp

%post --nochroot
%include /tmp/email.tmp
emailaddr=$(cat /tmp/email.tmp)
echo "$emailaddr" >> /foo/bar
rm -f /tmp/email.tmp
%end

However, this does not appear to be working at all. I believe I may be making a mistake in the transition from the %pre directory to the %post directory. And help would be greatly appreciated. Thank you!

fixer1234
  • 28,064

1 Answers1

0

It happens because %post section is chrooted to /mnt/sysimage (where the system you are installing is).

To get access to /tmp created in your %pre, you need to use "--nochroot " option in the %post section. This may lead to create 2 distinct post sections (one with "--nochroot " the other without), or you'll need to prefix any path with /mnt/sysimage.

take a look at redhat doc: "https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-postinstallconfig.html"

tonioc
  • 959