[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [stage1-xen (RFC) PATCH 04/10] build/fedora: Add `run`



From: Rajiv M Ranganath <rajiv.ranganath@xxxxxxxxxxx>


---
 build/fedora/run |   87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100755 build/fedora/run

diff --git a/build/fedora/run b/build/fedora/run
new file mode 100755
index 0000000..37e1dac
--- /dev/null
+++ b/build/fedora/run
@@ -0,0 +1,87 @@
+#!/usr/bin/python2
+
+import shlex
+import subprocess
+import sys
+import os
+
+
+# helper function to capture stdout from a long running process
+def subprocess_stdout(cmd, cwd, env):
+    p = subprocess.Popen(
+        shlex.split(cmd), cwd=cwd, env=env, stdout=subprocess.PIPE)
+    while p.poll() is None:
+        l = p.stdout.readline()
+        sys.stdout.write(l)
+
+
+env = os.environ.copy()
+
+# build and install xen-unstable
+print "Cloning xen-unstable..."
+cmd = 'git clone git://xenbits.xen.org/xen.git'
+subprocess.check_output(shlex.split(cmd), cwd='/root')
+
+steps = [
+    './configure --prefix=/opt/xen-unstable 
--with-system-qemu=/opt/xen-unstable/lib/xen/bin/qemu-system-i386 
--disable-stubdom --disable-qemu-traditional --disable-rombios 
--sysconfdir=/opt/xen-unstable/etc --enable-rpath --disable-systemd',
+    'make',
+    'make install BOOT_DIR=/opt/xen-unstable/boot 
DEBUG_DIR=/opt/xen-unstable/lib/debug 
EFI_DIR=/opt/xen-unstable/boot/efi/EFI/xen'
+]
+for cmd in steps:
+    cwd = '/root/xen'
+    subprocess_stdout(cmd, cwd, env)
+
+# build and install qemu-unstable
+print "Cloning qemu-unstable..."
+cmd = 'git clone git://git.qemu.org/qemu.git'
+subprocess.check_output(shlex.split(cmd), cwd='/root')
+
+steps = [
+    './configure --prefix=/opt/qemu-unstable --enable-xen 
--target-list=i386-softmmu --extra-cflags="-I/opt/xen-unstable/include" 
--extra-ldflags="-L/opt/xen-unstable/lib -Wl,-rpath,/opt/xen-unstable/lib" 
--disable-kvm --enable-virtfs --enable-linux-aio',
+    'make', 'make install'
+]
+for cmd in steps:
+    cwd = '/root/qemu'
+    subprocess_stdout(cmd, cwd, env)
+
+cmd = 'cp i386-softmmu/qemu-system-i386 
/opt/xen-unstable/lib/xen/bin/qemu-system-i386'
+subprocess.check_output(shlex.split(cmd), cwd='/root/qemu')
+
+# build rkt
+print "Cloning rkt..."
+cmd = 'git clone https://github.com/rkt/rkt.git'
+subprocess.check_output(shlex.split(cmd), cwd='/root')
+
+steps = [
+    './autogen.sh', './configure --disable-tpm --with-stage1-flavors=coreos',
+    'make'
+]
+for cmd in steps:
+    cwd = '/root/rkt'
+    subprocess_stdout(cmd, cwd, env)
+
+# build stage1-xen
+env['GOPATH'] = '/root/gopath'
+cwd = '/root/gopath/src/github.com/rkt/stage1-xen'
+cmd = 'bash build.sh'
+subprocess_stdout(cmd, cwd, env)
+
+# install build artifacts to `/opt/`
+steps = [
+    'mkdir -p /opt/stage1-xen/bin', 'mkdir -p /opt/stage1-xen/aci',
+    'cp /root/rkt/build-rkt-1.28.1+git/target/bin/rkt /opt/stage1-xen/bin/rkt',
+    'cp /root/gopath/src/github.com/rkt/stage1-xen/stage1-xen.aci 
/opt/stage1-xen/aci/stage1-xen.aci',
+    'cp /root/gopath/src/github.com/rkt/stage1-xen/build/fedora/source_path.sh 
/opt/stage1-xen/bin/source_path.sh',
+    'cp -r 
/root/gopath/src/github.com/rkt/stage1-xen/build/fedora/xen-unstable-runit 
/opt/xen-unstable-runit'
+]
+for cmd in steps:
+    cwd = '/root'
+    subprocess_stdout(cmd, cwd, env)
+
+cwd = '/opt'
+cmd = 'tar zcvf /root/stage1-xen-build.tar.gz qemu-unstable/ stage1-xen/ 
xen-unstable/ xen-unstable-runit/'
+subprocess_stdout(cmd, cwd, env)
+
+cwd = '/root'
+cmd = 'mv /root/stage1-xen-build.tar.gz /tmp'
+subprocess_stdout(cmd, cwd, env)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.