Archive/Repacking the XCP ISO

From Xen


In order to speed up testing, it is often easy to build an individual component and repackage that into the install images.


The install.img contains the necessary file for the host installer to boot and install XenServer/XCP. This is a gzip compressed archive which can be unpacked and repacked as follows:

# Unpack
mkdir dump
sudo bash -c 'cd dump; zcat ../install.img | cpio -idu'

# Repack
sudo bach -c 'cd dump; find . | cpio -o -H newc | gzip -9c > ../install.img'


The main.iso/main-xcp.iso are the images used to install XenServer/XCP via the CD drive. This contains the install.img in addition to all the XenServer/XCP files. As this is an ISO file it can just be mounted to view the files. However, to make changes this must be copied to become read/write.

# Unpack
mkdir mnt
sudo mount -o loop main.iso mnt
sudo cp -r mnt mnt-rw

# Repack
echo "/boot 1000" > main.list
sudo bash -c 'cd mnt-rw; \
mkisofs -joliet -joliet-long -r \
-b boot/isolinux/isolinux.bin -c boot/isolinux/ \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-sort ../main.list \
-V "XenServer-6.0.50 Base Pack" \
-o ../main.iso .'

# Unpack
mkdir dump
sudo bash -c 'cd dump; tar xf ../'

# Repack
sudo bash -c 'tar --directory dump -cjf .'