viewtopic.php?t=61663
But since that thread is marked solved I figured it's better to start a new thread.
I'm in the process of porting a CentOS 6 system to CentOS 7, and I'm looking for someone with more kickstart experience to help me figure out an issue.
In the referenced thread, in order to eject the DVD at the end of the kickstart script they recommended "reboot --eject". However, this is not sufficient for my use. On many machines the DVD is sucked back in when the machine reboots, and the installation process repeats.
In our CentOS 6 system the ks.cfg used the plain "reboot" command. But in the %post section we ejected the DVD and prompted the user to "Press enter to continue" as follows:
Code: Select all
%post
eject
exec < /dev/tty3 > /dev/tty3 2>&1
chvt 3
continue="no"
clear
echo 'Remove DVD and press Enter to reboot'
read KEY
chvt 1
%end
However in CentOS 7 this fails. The DVD does eject, but upon completing the %post section and returning to terminal 1 it looks like anaconda has crashed. Either I get a "Pane is Dead" error, or the system simply hangs with no error.
I tried to replace "reboot" with "poweroff". The problem then is that the user now has to remove the DVD from a powered down machine before restarting. (with a paper clip?) ... Not very user friendly!
I've tried different formatting of this post block ... like :
Code: Select all
exec < /dev/tty3 > /dev/tty3
chvt 3
(
eject
exec < /dev/tty3 > /dev/tty3 2>&1
chvt 3
continue="no"
clear
echo 'Remove DVD and press Enter to reboot'
read KEY
chvt 1
) 2>&1
exit 0
I tried closing stderr and stdout with "exec 2<&-" and "exec 1<&-".
Everything I tried fails in the same way.
So, my question:
Is there something mal-formated with my %post section above? I'm a bit confused as this used to work reliably in CentOS 6. Any pointers would be greatly appreciated.
Please note that I'm very much a noob in this area, so please speak slowly and use small words for me ...
TIA!
- Bob
The following is my test ks.cfg:
Code: Select all
install
text
cdrom
lang en_US.UTF-8
keyboard us
timezone UTC
auth --enableshadow --passalgo=sha512
selinux --enforcing
eula --agreed
firstboot --disable
zerombr
clearpart --all --initlabel
part /boot --fstype=ext4 --size=500 --ondisk=sda
part / --fstype=ext4 --size=10000 --ondisk=sda
part swap --fstype=swap --size=1000 --ondisk=sda
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
rootpw my_root_password
user --name my_user --password my_user_password --plaintext
network --onboot no
#reboot --eject
poweroff
%packages
@core
## I removed most of the packages just to make testing faster ##
%end
%post --nochroot
## copy in product specific files ##
mkdir -p /mnt/sysimage/install_tmp/Product
cp -R /run/install/repo/product/* /mnt/sysimage/install_tmp/Product
cp /tmp/*log /mnt/sysimage/install_tmp
%end
%post
LOG=/tmp/postlog
echo "==== Post Installation log ==== " > $LOG
## a bunch of product specific configuration removed ##
eject
exec < /dev/tty3 > /dev/tty3 2>&1
chvt 3
continue="no"
clear
echo 'Remove DVD and press Enter to reboot'
read KEY
chvt 1
%end
Also, If it matters:
uname -rmi
3.10.0-862.el7.x86_64 x86_64 x86_64
rpm -qa \*-release\*
centos-release-7-5.1804.el7.centos.x86_64
cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)