DRAFT
This guide is to show you how to deploy a MeeGo-enabled OBS appliance with two built-in workers in a virtualized environment for developing for and with MeeGo. The tips is based on http://en.opensuse.org/openSUSE:Build_Service_Appliance and I've tested this within VirtualBox.
You'll need a Virtual Machine like this:
This can also be a physical machine with a physical disk where obs-server.i686-2.0.105-Build1.1.raw.bz2 (bunzipped and dd'ed to a USB stick) can be used as boot device.
Contents |
Power on the machine. At the first setup the image will set itself up to fit with the machine. You'll arrive at a login: prompt where you can log in as 'root'
We need to set up LVM on the virtual disk, sdb. Log in as root and run: (WARNING: this will erase your 'sdb' disk)
# This will partition your disk sfdisk /dev/sdb << EOF ,,8e EOF # This will set up LVM with various file systems. You can adjust sizes as wished. pvcreate /dev/sdb1 vgcreate "OBS" /dev/sdb1 lvcreate -L 50G -n "server" /dev/OBS vgscan mkfs /dev/OBS/server lvcreate -L 20G -n "cache" OBS vgscan mkfs /dev/OBS/cache lvcreate -L 4G -n "worker_root_1" /dev/OBS lvcreate -L 4G -n "worker_root_2" /dev/OBS lvcreate -L 512M -n "worker_swap_1" /dev/OBS lvcreate -L 512M -n "worker_swap_2" /dev/OBS vgscan mkfs /dev/OBS/worker_root_1 mkfs /dev/OBS/worker_root_2
Run the following commands on the machine:
# Install QEMU for ARM support. This will ask you a couple of times to accept a repository key zypper install qemu-svn # This will indicate to the OBS which architectures to work with (ARMv7 and i586) sed s/OBS_SCHEDULER_ARCHITECTURES=\"i586 x86_64\"/OBS_SCHEDULER_ARCHITECTURES=\"i586 armv7el\"/g /etc/sysconfig/obs-server # This will reboot the virtual machine to pick up the LVM partitions from before shutdown -h now
After the reboot, log in as root and do the following commands:
mkdir -p /obs/imports mkdir -p /obs/build ln -s /obs/build /srv/obs/build
A MeeGo release is approximately 4-5 gb each - and this is even without the debug symbols.
Run the following command - this will set up a script which is handy to import MeeGo releases in the future:
cat > /usr/sbin/import-meego-release.sh << EOF
#!/bin/sh -e
#
# SYNTAX: import-meego-release.sh <RELEASE NUMBER> <DOWNLOAD LOCATION>
# Example: import-meego-release.sh 1.0.99.0.20101005.1 rsync://mirrors.kernel.org/meego/builds/1.0.99/
# This will set up a OBS project MeeGo:RELEASE NUMBER:Core
# You might have to use login for OBS, that is, login Admin password opensuse
# Download the RPMs
mkdir -p /obs/imports/MeeGo_$1/core/
for x in ia32 armv7l
do
mkdir -p /obs/imports/MeeGo_$1/core/$x/
cd /obs/imports/MeeGo_$1/core/$x/
rsync -a --progress $2/$1/core/repos/$x/packages/* .
done
# Set up symlinks to packages
mkdir -p /obs/build/MeeGo:$1:Core/standard/i586/:full
cd /obs/build/MeeGo:$1:Core/standard/i586/:full
find /obs/imports/MeeGo_$1/core/ia32/ -name *.rpm | xargs -I@ ln @ .
mkdir -p /obs/build/MeeGo:$1:Core/standard/armv7el/:full
cd /obs/build/MeeGo:$1:Core/standard/armv7el/:full
find /obs/imports/MeeGo_$1/core/armv7l/ -name *.rpm | xargs -I@ ln @ .
chown -R obsrun:obsrun /obs/build/
chown -R obsrun:obsrun /obs/imports/
# Set up prj information in OBS
osc -A http://localhost:81 meta prj -F - MeeGo:$1:Core << OTHEREOF
<project name="MeeGo:$1">
<title/>
<description/>
<build>
<enable/>
</build>
<repository name="standard">
<arch>armv7el</arch>
<arch>i586</arch>
</repository>
</project>
OTHEREOF
for x in i586 armv7el
do
/usr/lib/obs/server/bs_admin --rescan-repository MeeGo:$1:Core standard $x
done
echo "MeeGo:$1:Core imported into OBS, after rescan is done."
EOF