I’m trying to update the %post section in config. I have added a new section to test this, labeled as test install:
DEFAULT menu.c32
MENU TITLE ESXi 6 Boot Menu - per Vsphere 6 documentation center NOHALT 1 PROMPT 0 TIMEOUT 10000 LABEL default install
KERNEL vboot.c32
APPEND -c boot.cfg MENU LABEL ESXi 6 ^Installer - default LABEL test install
KERNEL vboot.c32
APPEND -c boot2.cfg MENU LABEL ESXi 6 ^Installer - test LABEL hddboot
LOCALBOOT 0x80
MENU LABEL ^Boot from local disk
As you can see, the only difference is what it’s appending. My intent is to test some new python code with boot2.cfg, where the difference between the two files would be one line:
[root@cm-di-msdc02 pxelinux.cfg]# diff boot2.cfg boot.cfg
5c5
< kernelopt=runweasel ks=http://10.26.85.233/ks/vmware/esxi_test.cfg
---
> kernelopt=runweasel ks=http://10.26.85.233/ks/vmware/esxi_default.cfg
The updated python code is in esxi_test.cfg.
However, I get the following error when I try to PXE install:
Loading operating system
[bar shows no progress here]
Configuration error while parsing boot2.cfg Fatal error: 15 (Not found)
So, I try and copy one to the other to isolate the problem:
[root@cm-di-msdc02 pxelinux.cfg]# cp -p boot.cfg boot2.cfg
cp: overwrite `boot2.cfg'? y
[root@cm-di-msdc02 pxelinux.cfg]# ls -l boot*cfg -r-xr-xr-x 1 root root 1819 Aug 13 21:22 boot2.cfg -r-xr-xr-x 1 root root 1819 Aug 13 21:22 boot.cfg
And try to PXE boot again, and I get the same thing. Next, I try to change the line above in the new test install section:
APPEND -c boot2.cfg
to
APPEND -c boot.cfg
To match what I know works. I try the PXE boot again, and that works. Why is this happening? As you can see above, I know the file exists, and boot.cfg and boot2.cfg are in the same directory, with the same permissions, etc.
The additional code in esxi_test.cfg is as follows. However, it seems to be getting hung up just on a different version of the .cfg file.
#paranoid
# A sample post-install script
%post --interpreter=python --ignorefailure=true import time stampFile = open('/finished.stamp', mode='w')
- stampFile.write(time.asctime())
hostname = raw_input("Enter the hostname of the server: ")
- stampFile.write(hostname)
- stampFile.close