CentOS on CentOS image build issues
tdyas Feb 24, 2011 6:15 PMI installed BoxGrinder on my CentOS 5.5 workstation. I have encountered some problems in building a CentOS VM image in this environment. I solved or worked around some of the problems, but others remain. Here are my notes:
1. Appliance-creator was throwing errors during the RPM install process related to "lsetfilecon." Putting SELinux on the host into Permissive mode did not work. I had to disable SELinux entirely on the host.
2. The version of parted that comes with CentOS is buggy with respect to requesting the kernel to re-read a parition table on a loop device. I had to upgrade parted to the latest upstream GNU release (2.3) in order to get it to work properly. (I forward ported the patches in the CentOS RPM that had not been upstreamed and remade the parted RPM if anyone wants to take a look at it. There is a problem with .so versioning with the RPM but that can probably be solved easily enough.)
3. I believe I've encountered a race condition in the install process where the RPM installation is still proceeding when the code attempts to run the grub install. I encountered a version of this race condition when I was building a Fedora VM on a Fedora host. I tracked it to a RPM package with non-trivial %post scripts that was not completing instantly. I removed that package from the appliance and the boxgrinder failure went away.
Here is relevant snippet of my BoxGrinder log:
D, [2011-02-23T18:03:33.234064 #4472] DEBUG -- : Installing: pm-utils ##############
####### [290/291]
D, [2011-02-23T18:03:34.298630 #4472] DEBUG -- : Writing grub /home/tdyas/BoxGrinder/build/appliances/x8
6_64/centos/5/centos-node/centos-plugin/tmp/imgcreate-mDrAaF/install_root/boot/grub/device.map
D, [2011-02-23T18:03:36.853613 #4472] DEBUG -- : ls: /home/tdyas/BoxGrinder/build/appliances/x86_64/cent
os/5/centos-node/centos-plugin/tmp/imgcreate-mDrAaF/install_root/boot/initramfs*: No such file o
r directory
D, [2011-02-23T18:03:36.856012 #4472] DEBUG -- : Writing grub config /home/tdyas/BoxGrinder/build/applia
nces/x86_64/centos/5/centos-node/centos-plugin/tmp/imgcreate-mDrAaF/install_root/boot/grub/grub.
conf
D, [2011-02-23T18:03:36.856191 #4472] DEBUG -- : Copying /home/tdyas/BoxGrinder/build/appliances/x86_64/
centos/5/centos-node/centos-plugin/tmp/imgcreate-mDrAaF/install_root/usr/share/grub/x86_64-redha
t/e2fs_stage1_5 to /home/tdyas/BoxGrinder/build/appliances/x86_64/centos/5/centos-node/centos-pl
ugin/tmp/imgcreate-mDrAaF/install_root/boot/grub/e2fs_stage1_5
D, [2011-02-23T18:03:36.868901 #4472] DEBUG -- : Copying /home/tdyas/BoxGrinder/build/appliances/x86_64/
centos/5/centos-node/centos-plugin/tmp/imgcreate-mDrAaF/install_root/usr/share/grub/x86_64-redha
t/stage1 to /home/tdyas/BoxGrinder/build/appliances/x86_64/centos/5/centos-node/centos-plugin/tm
p/imgcreate-mDrAaF/install_root/boot/grub/stage1
D, [2011-02-23T18:03:36.870879 #4472] DEBUG -- : Copying /home/tdyas/BoxGrinder/build/appliances/x86_64/
centos/5/centos-node/centos-plugin/tmp/imgcreate-mDrAaF/install_root/usr/share/grub/x86_64-redha
t/stage2 to /home/tdyas/BoxGrinder/build/appliances/x86_64/centos/5/centos-node/centos-plugin/tm
p/imgcreate-mDrAaF/install_root/boot/grub/stage2
D, [2011-02-23T18:03:38.757879 #4472] DEBUG -- : Installing grub to /dev/loop1
D, [2011-02-23T18:03:38.845241 #4472] DEBUG -- : Probing devices to guess BIOS drives. This may take a l
ong time.
D, [2011-02-23T18:03:38.926735 #4472] DEBUG -- : Installing: kudzu ##############
####### [291/291]
D, [2011-02-23T18:03:38.926846 #4472] DEBUG -- :
D, [2011-02-23T18:03:38.926904 #4472] DEBUG -- : GNU GRUB version 0.97 (640K lower / 3072K upper memor
y)
D, [2011-02-23T18:03:38.926954 #4472] DEBUG -- :
D, [2011-02-23T18:03:38.927005 #4472] DEBUG -- : [ Minimal BASH-like line editing is supported. For the
first word, TAB
D, [2011-02-23T18:03:38.927062 #4472] DEBUG -- : lists possible command completions. Anywhere else TAB
lists the possible
D, [2011-02-23T18:03:38.927116 #4472] DEBUG -- : completions of a device/filename.]
D, [2011-02-23T18:03:38.927184 #4472] DEBUG -- : grub> device (hd0) /dev/loop1
D, [2011-02-23T18:03:38.927241 #4472] DEBUG -- : grub> root (hd0,0)
You will note that kudzu installed after the grub stage had already started. Is there any way to make appliance-creator wait for the RPM install stage to complete?
-Tom