%post problems via CDROM to VM

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

 




My shell code in the %post section of an all-CDROM-contained kickstart does not work the same as it network build. I'm still troubleshooting, but it appears I have a severly restricted shell environment during this phase. (Why would it be different from network install? same code?)  

Is it possible the %post section really does not kick in until after it's first reboot?? If so, that may be the difference, because I must manually, unmount the virtual CDROM after the first boot, or it will simply boot from the CDROM again & repeat all over. However,  I do see the message that says it's doing post installation, but it's definately not working as expected.  

My new RHEL 5.1 32-bit VM is indeed installed, but with NONE of the post script stuff.

I set up some echo statements to help me troubleshoot...note that it does not create a mount point like I tell it, and certainly does not copy off script:

-------------------------------------------------------------------------------------------------
%post --interpreter /bin/bash
#
echo "Entering into %POST section" >> /opt/POST.txt
#export METHOD=NETWORK
export METHOD=CDROM
echo "METHOD=${METHOD}" >> /opt/POST.txt
export VER=RHEL5_32
echo "VERSION=${VER}" >> /opt/POST.txt
#####################
mkdir -p /cdrom
/bin/mount -t iso96660 -o ro /dev/cdrom /cdrom
#
mount >> /opt/POST.txt
echo "Copy and execute post configure script." >> /opt/POST.txt
#
cp /cdrom/third-party/rhel_post.bash /opt/rhel_post.bash

ls -la /opt >> /opt/POST.txt

[ -f /opt/rhel_post.bash ] && cd /opt;./rhel_post.bash||\
echo "Trying just copy from third-party...not /cdrom/third-party" >> /opt/POST.txt

cp third-party/rhel_pst.bash /opt/rhel_post.bash

ls -al /opt >> /opt/POST.txt
-------------------------------------------------------------------------------------------------
What's weird, is that it produced an /opt/POST.txt?   file and a /opt/POST.txt file:

cat POST.txt?

Entering into %POST section
METHOD=CDROM
VERSION=RHEL5_32
/dev/root on / type ext3 (ro)
Copy and execute post configure script.
total 24
drwxr-xr-x    2 root  root   4096 Mar   6 09:19.
drwxr-xr-x  24 root  root   4096 Mar   6 09:19..
-rw-r--r--        1 root  root     121 Mar   6 09:19 POST.txt?

total 32
drwxr-xr-x    2 root  root   4096 Mar   6 09:19.
drwxr-xr-x  24 root  root   4096 Mar   6 09:19..
-rw-r--r--        1 root  root       61 Mar   6 09:19 POST.txt
-rw-r--r--        1 root  root     271 Mar   6 09:19 POST.txt?

cat POST.txt
Tyring just copy from third-party..not /cdrom/third-party


Any ideas?

Gene
_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[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