Archive/Repacking the XCP ISO

From Xen
Jump to: navigation, search

Overview

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

install.img

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'

main.iso

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/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-sort ../main.list \
-V "XenServer-6.0.50 Base Pack" \
-o ../main.iso .'

dom0fs.tar.bz

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

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