Wednesday, March 6, 2013

keeping alix devices up-to-date

Over one and a half year passed by since i last mentioned my alix device. However, it's still working as it should and i'm really happy with it. Today i'm showing you how i've managed to update my alix. Updating on the device directly would work, but it would take ages for packages like gcc and it also reduce the lifetime of a compact flash card drastically.

Right now i'm using +QEMU for upgrading my alix. A complete copy of the system is running in virtual machine  It's not directly started in the virtual machine but it's booting up a live-cd. When it's up i just have to mount the file system and make a chroot. It's really simple and compiles much faster.
When the update process is finish i only have to copy the image back to the compact flash card, usually done with dd.

Qemu settings for the alix image:
 /usr/bin/qemu-system-x86_64 -name img_name -runas kvm \  
 -monitor unix:/var/run/kvm/img_name.sock,server,nowait \  
 -pidfile /var/run/kvm/ -m 2048 -smp 2 -daemonize \  
 -device virtio-serial -chardev spicevmc,id=vdagent,name=vdagent \  
 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \  
 -drive file=/dev/vms/img_name,if=ide,cache=none,aio=threads \  
 -netdev type=tap,id=img_name_2,vhost=on,ifname=qtap2,script=no,downscript=no \  
 -device rtl8139,netdev=img_name_2,mac=DE:AD:CA:5E:DC:A7 \  
 -spice port=5802,addr=,password="",disable-ticketing -k de \  
 -cpu host -vga qxl -cdrom /mnt/data/data/isolinks/gentoo_x86 -boot d  

A side effect of this update process is that i have to keep to two configuration in sync, because usually changes are made on the life system. If i wouldn't make those changes in the guest system too, i would lost them so i've wrote an script which syncs all configurations from the live system to the guest system.

More specifically it doesn't sync directly from the live system. On the alix device is a backup script which copies daily "/etc" to my server (where also the vm runs). I'll pass the backup file to my script which copies given configurations directly from the backup file to the guest vm's filesystem.

This saves my a lot of time because i only have to care about one system. For those who are interested in this script, i've uploaded it here: Link

No comments:

Post a Comment