Prepare
-
Download and decompress an Ubuntu ISO image.
-
Enter the casper file, there should be an initrd.lz, an vmlinuz.efi, and filesystem.squashfs. They are the files we need to modify.
Update squashfs
-
Decompress filesystem.squashfs with
unsquashfs filesystem.squashfs -
mount --bind /run ./squashfs-root/run -
mount --bind /dev ./squashfs-root/dev -
mount --bind /proc ./squashfs-root/proc -
mount --bind /sys ./squashfs-root/sys -
chroot ./squashfs-root -
cp sources.list /etc/apt/ -
apt-get update -
vim /etc/environment add:
export GIT_PROXY_COMMAND=/usr/local/bin/git-proxy.sh export no_proxy="localhost,127.0.0.1,.intel.com" export http_proxy="http://child-prc.intel.com:913/" export https_proxy="http://child-prc.intel.com:913/" export ftp_proxy="http://child-prc.intel.com:913/" -
scp root@10.239.156.51:/git-proxy.sh /usr/local/bin/ -
source /etc/environment -
scp root@10.239.156.51:/usr/local/bin/connect.c /usr/local/bin/connect.c -
gcc connect.c -o /usr/bin/connect -
Install packages here.
apt-get install libepoxy-dev libdrm-dev libgbm-dev spice-client-gtk libegl1-mesa-dev libgtk2.0-dev bin86 bcc iasl uuid-dev libncurses-dev libyajl-dev libc6-dev-i386
-
Install kernel here. While compiling the kernel, make sure to turn on
CONFIG_OVERLAY_FSand other modules kernel might require according to the wiki. A good way is to generate the new config with previous config withmake oldconfig. -
Install KVM and Xen here. You might want to put igvtg-qemu and igvtg-xen directory right under
/root, otherwise some path problems would occur later. -
Delete
gvt-linux,igvtg-xenandigvtg-qemudirectories. -
Delete old kernels and bash history, then exit and umount everything.
-
Modify files in
squashfs-root/etc/grub.dto meet grub needs. -
Copy necessary scripts into
usr/share/script, and Launch_Guest.desktop intousr/share/applications. -
Copy out
lib/modules/$YOUR_MODULES,usr/lib/modules/efi64/mboot.c32,vmlinuzandxen.gzto modify initrd later. -
cp sources.list /etc/apt/ -
apt-get update -
vim /etc/environment remove:
export GIT_PROXY_COMMAND=/usr/local/bin/git-proxy.sh
export no_proxy=”localhost,127.0.0.1,.intel.com”
export http_proxy=”http://child-prc.intel.com:913/”
export https_proxy=”http://child-prc.intel.com:913/”
export ftp_proxy=”http://child-prc.intel.com:913/” -
remove
/usr/local/bin/git-proxy.sh -
remove
/usr/bin/connect、/usr/local/bin/connect.c -
Re-package filesystem.squashfs with
mksquashfs squashfs-root filesystem.squashfs. Replace the old squashfs with the new one.
Update initrd
-
Copy initrd.lz to a directory. It is actually a LZMA format file. Use
mv initrd.lz initrd.lzma,lzma -d initrd.lzmaandcpio -idmv < initrdto decompress it. Remove the original initrd file. -
Remove
lib/modules/*, and then copy$YOUR_MODULESthere. -
In
scripts/casper-bottom/25adduser, around line 81, add the files you want to copy to the desktop. -
Repackage initrd.lz
find ./* | cpio -H newc -o > ../initrd lzma initrd mv initrd.lzma initrd.lz
Update files in /casper
-
Replace vmlinuz, filesystem.squashfs, initrd.lz with the new ones.
-
Add xen.gz and mboot.c32 here.
Modify ISO GRUB
- Under ISO directory, modify ./boot/grub/grub.cfg and ./isolinux/txt.cfg
Repackage ISO
-
Find my.bin to support booting from ISO.
-
xorriso -as mkisofs -isohybrid-mbr ../my.bin -D -r -V "Intel GVT-g" -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -o ../ISO_NAME.iso .