-
Notifications
You must be signed in to change notification settings - Fork 13
developer howto
NOTE: you may want to read code layout first, to understand what various files in the source tree are.
Most people think of Silvereye as an ISO full of RPMs. From a developer perspective, though, it's just a few shell scripts and some python modules. Here's a rundown of how I develop Silvereye on a Fedora 18 system without building ISOs.
- Have mirrors of centos base and updates, epel, elrepo, euca2ools and eucalyptus repositories. This isn't a strict requirement, but it makes install times much faster.
- Install some dependencies:
sudo yum install -y ImageMagick git
- Get the code:
git clone git://github.com/eucalyptus/silvereye.git
cd silvereye
- Build just an updates.img:
./silvereye.py --distroname CentOS --distroversion 6 --eucaversion 3.2 --no-iso --builddir /tmp/silvereye-build
- Copy the updates.img to Apache's root directory:
cp /tmp/silvereye-build/image/images/updates.img /var/www/html
- Make a disk image:
qemu-img create -f qcow2 ciab.img 60G
- Make a kickstart file:
# This is a funky sudo technique to write a file as root. You don't have to follow this verbatim
cat <<EOF | sudo sh -c "cat - >/var/www/html/ks.cfg"
lang en_US.UTF-8
keyboard us
install
shutdown
timezone America/New_York --isUtc
network --device=eth0 --bootproto=dhcp
authconfig --enableshadow --enablemd5
# If you don't have some of these mirrored, remove those lines, and defaults will be used.
repo --name=base --baseurl=http://10.0.2.2/centos/6.3/os/x86_64
repo --name=updates --baseurl=http://10.0.2.2/centos/6.3/updates/x86_64
repo --name=euca2ools --baseurl=http://10.0.2.2/euca2ools/2.1/centos/6/x86_64
repo --name=eucalyptus --baseurl=http://10.0.2.2/eucalyptus/3.2/centos/6/x86_64/
repo --name=epel --baseurl=http://10.0.2.2/epel/6/x86_64/
repo --name=elrepo --baseurl=http://10.0.2.2/elrepo/el6/x86_64/
EOF
- Launch the installer:
CENTOSPATH=/var/www/html/centos/6/os/x86_64
CENTOSURL=http://10.0.2.2/centos/6/os/x86_64
sudo qemu-kvm -m 2048 -cpu qemu64,+vmx \
-kernel $CENTOSPATH/images/pxeboot/vmlinuz \
-initrd $CENTOSPATH/images/pxeboot/initrd.img \
-drive file=/home/agrimm/silvereye/ciab.img,if=virtio \
-net nic,model=virtio -net user,hostfwd=tcp::2222-:22
-append "updates=http://10.0.2.2/updates.img repo=$CENTOSURL ks=http://10.0.2.2/ks.cfg debug=1 ciab sshd"
That will boot you into a silvereye cloud-in-a-box install with debugging enabled. If there are any problems during the install, you can click the "Debug" button to get a python debug prompt. Also, the sshd option and port forwarding setup allows you to ssh to port 2222 on your host system to get a shell in the VM. This can be very helpful when an install goes wrong.
All of the code for the installer customizations lives in anaconda-updates/6/ in the git repository. When you make changes, just rerun silvereye.py, copy the new updates.img into /var/www/html, and restart the VM.
When you get a successful install to run, the VM will shut down automatically (if you use the kickstart shown above). The reason for doing this is that you want to run the installed VM with different boot options:
sudo qemu-kvm -m 2048 -cpu qemu64,+vmx \
-drive file=/home/agrimm/silvereye/ciab.img,if=virtio \
-net nic,model=virtio -net user,hostfwd=tcp::2222-:22
I hope this makes it easier for people to explore and improve our custom installer. Feedback is always appreciated.