summaryrefslogtreecommitdiffstats
path: root/recipes-core/runx/runx
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@xilinx.com>2019-12-17 17:25:31 -0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-03-11 12:20:04 -0400
commit4ff05c1bc7313743b572b116b37c893b69c68971 (patch)
treeec51e913ecae1cf18d512ca8deaca261b371b7be /recipes-core/runx/runx
parent7a8ee8e986ea180f3a4d94d4d83d01c786488d96 (diff)
downloadmeta-virtualization-4ff05c1bc7313743b572b116b37c893b69c68971.tar.gz
runx: introduce xen OCI container recipe
This is the initial version of the runX OCI wrapper to allow Xen based virtual machines to be launched and managed as containers via an OCI interface. In this first version, runx consists of the following components: - runX binary/wrapper (/usr/bin/) - state control wrappers (/usr/share/runX) - runx kernel - initrd Once built and installed these allow the launching of Xen virtual machines in an OCI compliant manner. Dependencies of this recipe include: - kernel: must be a specific version, currently 4.15. This is done as a nested build and not as a multiconfig (by design). - static target busybox: used for the initrd - initrd: constructed from the kernel + busybox The configuration of the system to build the dependencies in the right mode for use in runX is controlled via the DISTRO_FEATURE "vmsep". If this feature is missing, and runx is bitbaked, an error is thrown. Installing the "runx" package to a rootfs will install all the required support components (and dependencies). Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
Diffstat (limited to 'recipes-core/runx/runx')
-rw-r--r--recipes-core/runx/runx/0001-make-initrd-cross-install-tweaks.patch42
-rw-r--r--recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch86
2 files changed, 128 insertions, 0 deletions
diff --git a/recipes-core/runx/runx/0001-make-initrd-cross-install-tweaks.patch b/recipes-core/runx/runx/0001-make-initrd-cross-install-tweaks.patch
new file mode 100644
index 00000000..c9fdc5d6
--- /dev/null
+++ b/recipes-core/runx/runx/0001-make-initrd-cross-install-tweaks.patch
@@ -0,0 +1,42 @@
1From d8bd5749e6fc6e0c86a8720044ec78167bab3569 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@xilinx.com>
3Date: Mon, 16 Dec 2019 22:03:14 -0800
4Subject: [PATCH] make-initrd: cross install tweaks
5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
7---
8 kernel/make-initrd | 18 ++++++++++++++++--
9 1 file changed, 16 insertions(+), 2 deletions(-)
10
11diff --git a/kernel/make-initrd b/kernel/make-initrd
12index 4c299dc..9ef386f 100755
13--- a/kernel/make-initrd
14+++ b/kernel/make-initrd
15@@ -16,8 +16,22 @@ mkdir -p $tmpdir/sys
16 mkdir -p $tmpdir/lib
17 mkdir -p $tmpdir/var
18 mkdir -p $tmpdir/mnt
19-cp `which busybox` $tmpdir/bin
20-$tmpdir/bin/busybox --install $tmpdir/bin
21+
22+
23+if [ -z "$BUSYBOX" ]; then
24+ BUSYBOX=`which busybox`
25+fi
26+cp $BUSYBOX $tmpdir/bin
27+if [ -n "$CROSS_COMPILE" ]; then
28+ echo "cross compiling, busybox --install emulation"
29+ if [ -n "$QEMU_USER" ]; then
30+ $QEMU_USER $tmpdir/bin/busybox --install $tmpdir/bin
31+ else
32+ echo "QEMU_USER is not defined, no binary symlinks will be available"
33+ fi
34+else
35+ $tmpdir/bin/busybox --install $tmpdir/bin
36+fi
37
38 cp $init $tmpdir/init
39 chmod +x $tmpdir/init
40--
412.17.1
42
diff --git a/recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch b/recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch
new file mode 100644
index 00000000..7d66f421
--- /dev/null
+++ b/recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch
@@ -0,0 +1,86 @@
1From 7e3498ab7c375bd545de501920acffa77eb24120 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@xilinx.com>
3Date: Mon, 16 Dec 2019 20:42:04 -0800
4Subject: [PATCH] make-kernel: cross-compilation tweaks
5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
7---
8 kernel/make-kernel | 41 +++++++++++++++++++++++++++++++++--------
9 1 file changed, 33 insertions(+), 8 deletions(-)
10
11diff --git a/kernel/make-kernel b/kernel/make-kernel
12index 33b7150..c684669 100755
13--- a/kernel/make-kernel
14+++ b/kernel/make-kernel
15@@ -13,6 +13,7 @@ fi
16
17 kernel_stuffdir=`readlink -f kernel`
18 kernel_outpath=$kernel_stuffdir/out
19+kernel_srcdir=$kernel_stuffdir/src
20 kernel_builddir=$kernel_stuffdir/build
21 kernel_out=$kernel_outpath/kernel
22
23@@ -22,28 +23,52 @@ kernel_tarball="$kernel_name".tar.xz
24 kernel_url=https://www.kernel.org/pub/linux/kernel/v4.x/"$kernel_tarball"
25 kernel_src_config="$kernel_stuffdir"/cutdown-config.$ARCH
26 kernel_patchesdir="$kernel_stuffdir"/patches
27-kernel_image="$kernel_builddir"/"$kernel_name"/arch/"$ARCH"/boot/"$image"
28+kernel_image="$kernel_builddir"/arch/"$ARCH"/boot/"$image"
29
30+echo "#########################"
31+echo "kernel build summary:"
32+echo " version: $kernel_version"
33+echo " url: $kernel_url"
34+echo " src dir: $kernel_srcdir"
35+echo " out dir: $kernel_builddir"
36+echo " artifacts: $kernel_out"
37+echo " image: $image"
38+echo " build vars: $build_vars"
39+echo "#########################"
40
41-rm -rf $kernel_outpath
42+if [ ! -e "$kernel_builddir/.config" ];
43+then
44+ rm -rf $kernel_buildir
45+fi
46 mkdir -p $kernel_outpath
47 mkdir -p $kernel_builddir
48+mkdir -p $kernel_srcdir
49
50 if [[ ! -f $kernel_builddir/$kernel_tarball ]]
51 then
52+ echo "fetching the kernel .."
53 wget -O $kernel_builddir/$kernel_tarball --tries=20 $kernel_url
54 fi
55-if [[ ! -d $kernel_builddir/$kernel_name ]]
56+
57+if [[ ! -d $kernel_srcdir/$kernel_name ]]
58 then
59- tar --extract --xz --touch --file="$kernel_builddir/$kernel_tarball" --directory="$kernel_builddir"
60- cd $kernel_builddir/$kernel_name
61+ echo "extracting the kernel ..."
62+ echo " tar --extract --xz --touch --file=\"$kernel_builddir/$kernel_tarball\" --directory=\"$kernel_srcdir\""
63+ tar --extract --xz --touch --file="$kernel_builddir/$kernel_tarball" --directory="$kernel_srcdir"
64+ cd $kernel_srcdir/$kernel_name
65 for i in $kernel_patchesdir/*
66 do
67 patch -p1 < $i
68 done
69- cp $kernel_src_config .config
70 fi
71-cd $kernel_builddir/$kernel_name
72-make -j4 $image
73+if [[ ! -f $kernel_builddir/.config ]]
74+then
75+ cp $kernel_src_config $kernel_builddir/.config
76+fi
77+cd $kernel_srcdir/$kernel_name
78+
79+echo "building the kernel ..."
80+eval make O=$kernel_builddir $build_vars oldconfig
81+eval make -j4 O=$kernel_builddir $build_vars $image
82
83 cp $kernel_image $kernel_out
84--
852.17.1
86