Create XEN GeeXboX Dev Domain

# set domU parameter
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=builder32
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:00:0b:32
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=256Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=8Gb

xen-create-image --hostname=${DOMAIN_NAME} --dhcp --mac=${DOMAIN_MAC} --lvm=vg01 \
--dist=maverick --mirror=http://archive.ubuntu.com/ubuntu --size=${DOMAIN_HDD} \
--memory=${DOMAIN_RAM} --swap=${DOMAIN_RAM} --arch=i386

# create domU
http://www.panticz.de/Xen-domU-ubuntu-jaunty

# add to autostart (optional)
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto

# create lvm for home
lvcreate --name ${DOMAIN_NAME}-home --size 50G vg01
mkfs.ext3 /dev/vg01/${DOMAIN_NAME}-home

# configure domU
vi /etc/xen/${DOMAIN_NAME}
(add)
'phy:/dev/vg01/mx-home,sda3,w'

# post config domU
mount /dev/vg01/${DOMAIN_NAME}-disk /mnt/
echo "/dev/sda3 /home ext3 defaults 0 0" >> /mnt/etc/fstab
umount /mnt

# start domU
xm create -c ${DOMAIN_NAME}

# install mailserver
http://www.panticz.de/install_mx

# filename: createXenImageGeeXboxDev.sh

# !!! Warning !!!
# This script are currently under development and not full testet yet!

# create xen image
xen-create-image --hostname=gxdev --dhcp --dir=/home/xen --dist=gutsy --mirror=http://archive.ubuntu.com/ubuntu/ --size=4Gb --memory=256Mb

# mount image
mount /home/xen/domains/gxdev/disk.img /mnt -o loop

# configure network
mv /mnt/etc/network/interfaces /mnt/etc/network/interfaces.org
sed 's|# post-up ethtool -K eth0 tx off|post-up ethtool -K eth0 tx off|g' /mnt/etc/network/interfaces.org > /mnt/etc/network/interfaces

# install dev apps
chroot /mnt
apt-get update
apt-get -y dist-upgrade
apt-get -y install mercurial make perl binutils cpp gcc g++ libncurses5-dev libreadline5-dev patch nasm flex mkisofs bzip2 screen bison gawk zlib1g-dev texinfo texi2html xfonts-utils genisoimage wget

# get full build script
wget http://www.konczalski.de/geexbox/howto/mkFullBuild.sh
chmod a+x mkFullBuild.sh

# umount
exit
umount /mnt/

# update config file
cp /etc/xen/gxdev.cfg /etc/xen/gxdev.cfg.org
cat <> /etc/xen/gxdev.cfg
extra='xencons=tty'
vif=['bridge=xenbr0,mac=00:aa:bb:cc:dd:ee']
EOF

# rename config file
mv /etc/xen/gxdev.cfg /etc/xen/gxdev

# start
xm create gxdev -c

# todo
# ? check with geexbox-hdtv (porblems with Xorg compilation)