RE: %post questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dave,
	
> 	Every faq/howto I've read goes on at length about %post contents
> crashing or hanging the ks, so I wanted to clear up what 
> would happen if
> I set it to run commands that require user interaction (e.g. up2date

About the only issue I've come across with running %post commands is that the
display is not left in an ideal state for accepting user interaction. i.e. the
cursor is turned off, there's a blue background rather than the normal black,
etc.

I use the following code to fix the display, and then return it to how it was.
This works for me with RH 7.1; YMMV of course. Ignore the C-style comments, I
run my Kickstart scripts through cpp.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#define TTY_B /dev/tty1

echo -ne "\e[0;0m" > TTY_B      // Reset display attributes
clear > TTY_B                   // Clear the screen
stty echo                       // Turn echo back on
stty opost                      // Post-process output
echo -ne "\e[?25h\e[?0c"> TTY_B // Turn the cursor back on

/do/something/here

read some_input here

/do/something/else

/* Put the screen back to how it was */
echo -ne "\e[44m" > TTY_B               // Blue background
clear > TTY_B                           // Clear the screen
echo -ne "\e[1;33m" > TTY_B             // Bright yellow
echo -ne "\e[?25l\e[?1c" > TTY_B        // Turn the cursor back off
stty -echo                              // Turn echo back off
stty -opost                             // Do not postprocess output
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Hope that helps,

Jonathan





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux