Skip to contentSkip to conversation

xen: Move x86/arch specific components into RRECOMMENDS

PATCH New Nathan Rossi 1 participant 14 messages Feb 16, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/14 xen: Fix and refactor common include

* Add missing DEPENDS (dtc, lzo, libaio)
* Fix up QA issues around missing rdepends and un-shipped files/directories
* Add export for XEN_OS
* Add the /var/lib/xen directory as a volatile directory

---
 recipes-extended/xen/xen.inc | 69 ++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 64 insertions(+), 5 deletions(-)
recipes-extended/xen/xen.inc +64 -5
index b121250..ed902b2 100644
@@ -8,16 +8,41 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e0f0f3ac55608719a82394cc353928df"
 
 COMPATIBLE_HOST = '(x86_64.*).*-linux'
 
-inherit autotools gettext setuptools update-rc.d
+inherit autotools-brokensep gettext setuptools update-rc.d
 
 PACKAGECONFIG ??= " \
     sdl \
-"
+    "
 
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl,"
 PACKAGECONFIG[xsm] = "--enable-xsmpolicy,--disable-xsmpolicy,checkpolicy-native,"
 
-DEPENDS = "util-linux util-linux-native file-native zlib ncurses openssl bison-native flex-native gettext dev86-native iasl-native pciutils bridge-utils iproute2 procps yajl pixman python xz xz-native glib-2.0"
+DEPENDS = " \
+    bison-native \
+    dev86-native \
+    flex-native \
+    file-native \
+    iasl-native \
+    util-linux-native \
+    xz-native \
+    bridge-utils \
+    dtc \
+    gettext \
+    glib-2.0 \
+    iproute2 \
+    ncurses \
+    openssl \
+    pciutils \
+    pixman \
+    procps \
+    python \
+    libaio \
+    lzo \
+    util-linux \
+    xz \
+    yajl \
+    zlib \
+    "
 
 # inherit setuptools adds python to RDEPENDS, override it
 RDEPENDS_${PN} = ""
@@ -50,13 +75,24 @@ RDEPENDS_${PN}-base = "\
     ${PN}-xl \
     "
 
+RDEPENDS_${PN}-misc = " \
+    perl \
+    python \
+    "
+
+RDEPENDS_${PN}-remus = "python"
+
 RDEPENDS_${PN}-scripts-block = "\
+    bash \
     ${PN}-scripts-common \
     ${PN}-udev \
     ${PN}-volatiles \
     "
 
+RDEPENDS_${PN}-scripts-common = "bash"
+
 RDEPENDS_${PN}-scripts-network = "\
+    bash \
     bridge-utils \
     ${PN}-scripts-common \
     ${PN}-udev \
@@ -64,6 +100,7 @@ RDEPENDS_${PN}-scripts-network = "\
     "
 
 RDEPENDS_${PN}-xencommons = "\
+    bash \
     ${PN}-console \
     ${PN}-xenstore \
     ${PN}-xenstored \
@@ -71,6 +108,7 @@ RDEPENDS_${PN}-xencommons = "\
     "
 
 RDEPENDS_${PN}-xendomains = "\
+    bash \
     ${PN}-console \
     ${PN}-scripts-block \
     ${PN}-scripts-common \
@@ -79,6 +117,10 @@ RDEPENDS_${PN}-xendomains = "\
 
 RDEPENDS_${PN}-xl = "libgcc"
 
+RDEPENDS_${PN}-xentrace = "python"
+
+RDEPENDS_${PN}-xen-watchdog = "bash"
+
 PACKAGES = "\
     ${PN}-base \
     ${PN}-blktap \
@@ -156,8 +198,10 @@ FILES_${PN}-dbg += "\
     ${libdir}/fs/zfs/.debug \
     ${libdir}/fs/reiserfs/.debug \
     ${libdir}/fs/iso9660/.debug \
+    ${libdir}/fs/*/.debug \
     ${sbindir}/.debug \
     ${libdir}exec/.debug \
+    ${libdir}/xen/libexec/.debug \
     ${bindir}/.debug \
     ${libdir}/python2.7/dist-packages/.debug \
     ${libdir}/python2.7/dist-packages/xen/lowlevel/.debug \
@@ -299,6 +343,7 @@ FILES_${PN}-misc = "\
     ${sbindir}/xen-hvmctx \
     ${sbindir}/xenlockprof \
     ${sbindir}/xen-lowmemd \
+    ${sbindir}/xen-mfndump \
     "
 
 FILES_${PN}-pygrub = "\
@@ -323,8 +368,10 @@ FILES_${PN}-qemu = " \
     ${libdir}/xen/bin/qemu-dm \
     ${libdir}/xen/bin/virtfs-proxy-helper \
     /usr/libexec/qemu-bridge-helper \
+    ${libdir}/xen/libexec/qemu-bridge-helper \
     /usr/etc/qemu \
     /usr/etc/qemu/target-x86_64.conf \
+    ${libdir}/xen/etc/qemu/target-x86_64.conf \
     ${datadir}/qemu-xen \
     ${datadir}/qemu-xen/qemu \
     ${datadir}/qemu-xen/qemu/bamboo.dtb \
@@ -421,6 +468,7 @@ FILES_${PN}-scripts-block = " \
     ${sysconfdir}/xen/scripts/block-enbd \
     ${sysconfdir}/xen/scripts/block-iscsi \
     ${sysconfdir}/xen/scripts/block-nbd \
+    ${sysconfdir}/xen/scripts/block-drbd-probe \
     ${sysconfdir}/xen/scripts/vscsi \
     "
 
@@ -505,6 +553,7 @@ FILES_${PN}-xl = "\
     ${sysconfdir}/xen/xl.conf \
     ${libdir}/xen/bin/libxl-save-helper \
     ${sbindir}/xl \
+    ${libdir}/xen/bin/xen-init-dom0 \
     "
 
 FILES_${PN}-xl-examples = "\
@@ -522,7 +571,7 @@ FILES_${PN}-xm-examples = "\
     ${sysconfdir}/xen/xmexample.pv-grub \
     ${sysconfdir}/xen/xmexample.vti \
     "
-    
+
 FILES_${PN}-xenmon = "\
     ${sbindir}/xenbaked \
     ${sbindir}/xentrace_setmask \
@@ -546,6 +595,7 @@ FILES_${PN}-xend += " \
     "
 
 FILES_${PN}-xendomains += "\
+    ${libdir}/xen/bin/xendomains \
     ${sysconfdir}/default/xendomains \
     ${sysconfdir}/init.d/xendomains \
     ${sysconfdir}/sysconfig/xendomains \
@@ -572,6 +622,9 @@ export STAGING_LIBDIR
 export XEN_TARGET_ARCH="x86_64"
 export XEN_COMPILE_ARCH="x86_64"
 
+# hardcoded as Linux, as the only compatible hosts are Linux.
+export XEN_OS = "Linux"
+
 # this is used for the header (#!${bindir}/python) of the install python scripts
 export PYTHONPATH="${bindir}/python"
 
@@ -620,7 +673,11 @@ do_install() {
     oe_runmake DESTDIR="${D}" install
 
     # remove installed volatiles
-    rm -rf ${D}${localstatedir}/run ${D}${localstatedir}/lock ${D}${localstatedir}/log ${D}${localstatedir}/volatile
+    rm -rf ${D}${localstatedir}/run \
+        ${D}${localstatedir}/lock \
+        ${D}${localstatedir}/log \
+        ${D}${localstatedir}/volatile \
+        ${D}${localstatedir}/lib/xen
 
     # install volatiles using populate_volatiles mechanism
     install -d ${D}${sysconfdir}/default/volatiles
@@ -638,6 +695,8 @@ do_install() {
          >> ${D}${sysconfdir}/default/volatiles/99_xen
     echo "d root root 0755 ${localstatedir}/lock/subsys none" \
          >> ${D}${sysconfdir}/default/volatiles/99_xen
+    echo "d root root 0755 ${localstatedir}/lib/xen none" \
+         >> ${D}${sysconfdir}/default/volatiles/99_xen
 
     # workaround for xendomains script which searchs sysconfig if directory exists
     install -d ${D}${sysconfdir}/sysconfig
Signature · 1 line
2.1.1
#2 lore raw

PATCH 2/14 xen: Add Build and Target architecture mapping

In reply to a message not in the archive

* Setup the XEN_TARGET_ARCH and XEN_COMPILE_ARCH based on the running environments TARGET_ARCH and BUILD_ARCH

---
 recipes-extended/xen/xen-arch.inc | 18 ++++++++++++++++++
 recipes-extended/xen/xen.inc      |  8 +++++---
 2 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 recipes-extended/xen/xen-arch.inc
recipes-extended/xen/xen-arch.inc new file +18 -0
new file mode 100644
index 0000000..bcf9f54
@@ -0,0 +1,18 @@
+
+valid_xen_archs = " \
+        x86_64 x86_32 \
+        arm32 arm64 \
+        "
+
+def map_xen_arch(a, d):
+    import re
+    valid_archs = d.getVar('valid_xen_archs').split()
+
+    if   re.match("i.86", a):        return "x86_32"
+    elif re.match("x86.64", a):      return "x86_64"
+    elif re.match("arm.*", a):       return "arm32"
+    elif re.match("aarch64.*", a):   return "arm64"
+    elif a in valid_archs:           return a
+    else:
+        bb.error("cannot map '%s' to a xen architecture" % a)
+
recipes-extended/xen/xen.inc +5 -3
index ed902b2..9ab8351 100644
@@ -10,6 +10,8 @@ COMPATIBLE_HOST = '(x86_64.*).*-linux'
 
 inherit autotools-brokensep gettext setuptools update-rc.d
 
+require xen-arch.inc
+
 PACKAGECONFIG ??= " \
     sdl \
     "
@@ -618,9 +620,9 @@ export HOST_SYS
 export STAGING_INCDIR
 export STAGING_LIBDIR
 
-# specify xen hypervisor to target x86_64 (x86_32 not supported)
-export XEN_TARGET_ARCH="x86_64"
-export XEN_COMPILE_ARCH="x86_64"
+# specify xen hypervisor to build/target
+export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH', True), d)}"
+export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}"
 
 # hardcoded as Linux, as the only compatible hosts are Linux.
 export XEN_OS = "Linux"
Signature · 1 line
2.1.1
#3 lore raw

PATCH 3/14 xen: Move x86/arch specific components into RRECOMMENDS

In reply to a message not in the archive

* The xen-base specifies features that are specific to x86 targets, these components include xen-libblktap, xen-flask, xen-hvmloader and xen-xenpaging

---
 recipes-extended/xen/xen.inc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
recipes-extended/xen/xen.inc +7 -2
index 9ab8351..54d6ffe 100644
@@ -64,11 +64,9 @@ RDEPENDS_${PN}-base = "\
     ${PN}-libxenstore \
     ${PN}-libfsimage \
     ${PN}-fsimage \
-    ${PN}-hvmloader \
     ${PN}-scripts-block \
     ${PN}-scripts-network \
     ${PN}-udev \
-    ${PN}-xenpaging \
     ${PN}-xen-watchdog \
     ${PN}-xencommons \
     ${PN}-xendomains \
@@ -77,6 +75,13 @@ RDEPENDS_${PN}-base = "\
     ${PN}-xl \
     "
 
+RRECOMMENDS_${PN}-base = " \
+    ${PN}-libblktap \
+    ${PN}-flask \
+    ${PN}-hvmloader \
+    ${PN}-xenpaging \
+    "
+
 RDEPENDS_${PN}-misc = " \
     perl \
     python \
Signature · 1 line
2.1.1
#4 lore raw

PATCH 4/14 xen: Fix up architecture specific steps

In reply to a message not in the archive

* Remove version specific sed pattern
* Add 'xen' as an output product instead of just 'xen.gz' as some architectures do not generate the 'xen.gz'

---
 recipes-extended/xen/xen.inc | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
recipes-extended/xen/xen.inc +15 -10
index 54d6ffe..c8fad6c 100644
@@ -274,6 +274,8 @@ FILES_${PN}-libfsimage-dev = "${libdir}/libfsimage.so"
 FILES_${PN}-fsimage = "${libdir}/fs/*/*fsimage.so"
 
 FILES_${PN}-hypervisor = "\
+    /boot/xen-* \
+    /boot/xen \
     /boot/xen-*.gz \
     /boot/xen.gz \
     /boot/xen-syms-* \
@@ -656,20 +658,18 @@ EXTRA_OECONF += " \
 
 do_configure() {
     # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu
-    test -d ${S}/tools/include/gnu || mkdir ${S}/tools/include/gnu
     if ! test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-32.h ; then
-        cat ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h | grep -v stub_bdflush | grep -v stub_getmsg | grep -v stub_putmsg > ${S}/tools/include/gnu/stubs-32.h
-        echo \#define __stub___kernel_cosl >> ${S}/tools/include/gnu/stubs-32.h
-        echo \#define __stub___kernel_sinl >> ${S}/tools/include/gnu/stubs-32.h
-        echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h
+        if test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h ; then
+            test -d ${S}/tools/include/gnu || mkdir ${S}/tools/include/gnu
+            cat ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h | grep -v stub_bdflush | grep -v stub_getmsg | grep -v stub_putmsg > ${S}/tools/include/gnu/stubs-32.h
+            echo \#define __stub___kernel_cosl >> ${S}/tools/include/gnu/stubs-32.h
+            echo \#define __stub___kernel_sinl >> ${S}/tools/include/gnu/stubs-32.h
+            echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h
+        fi
     fi
 
     # do configure
     oe_runconf
-
-    # seabios needs a patch to specify correct compiler - pull and patch Makefile
-    make -C ${S}/tools/firmware seabios-dir
-    sed -i 's/export HOSTCC.*$(CC)/export HOSTCC ?= $(CC)/g' ${S}/tools/firmware/seabios-dir/Makefile
 }
 
 do_compile() {
@@ -720,5 +720,10 @@ sysroot_stage_all_append() {
     sysroot_stage_dir ${D}/boot ${SYSROOT_DESTDIR}/kernel
 
     install -d ${DEPLOY_DIR_IMAGE}
-    install -m 0644 ${D}/boot/xen.gz ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
+    if [ -f ${D}/boot/xen ]; then
+        install -m 0644 ${D}/boot/xen ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}
+    fi
+    if [ -f ${D}/boot/xen.gz ]; then
+        install -m 0644 ${D}/boot/xen.gz ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
+    fi
 }
Signature · 1 line
2.1.1
#5 lore raw

PATCH 5/14 xen: Add aarch64 as compatible host

In reply to a message not in the archive
---
 recipes-extended/xen/xen.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/xen/xen.inc +1 -1
index c8fad6c..82bb3d2 100644
@@ -6,7 +6,7 @@ PR = "r0"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=e0f0f3ac55608719a82394cc353928df"
 
-COMPATIBLE_HOST = '(x86_64.*).*-linux'
+COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux'
 
 inherit autotools-brokensep gettext setuptools update-rc.d
 
Signature · 1 line
2.1.1
#6 lore raw

PATCH 6/14 xen-*image-minimal: Setup conditional based on MACHINE_FEATURES

In reply to a message not in the archive

* Conditionally add packages to the image depending on whether the machine supports the respective feature

---
 recipes-extended/images/xen-guest-image-minimal.bb | 2 +-
 recipes-extended/images/xen-image-minimal.bb       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
recipes-extended/images/xen-guest-image-minimal.bb +1 -1
index bcac4d7..f13940c 100644
@@ -4,7 +4,7 @@ inherit core-image
 
 IMAGE_INSTALL += " \
     packagegroup-core-boot \
-    kernel-module-xen-acpi-processor \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \
     "
 
 IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-fbdev', '', d)}"
recipes-extended/images/xen-image-minimal.bb +2 -2
index 13917c5..aed0526 100644
@@ -5,12 +5,12 @@ INITRD_IMAGE = "core-image-minimal-initramfs"
 IMAGE_INSTALL += " \
     packagegroup-core-boot \
     packagegroup-core-ssh-openssh \
-    kernel-module-xen-acpi-processor \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \
     kernel-module-xen-blkback \
     kernel-module-xen-gntalloc \
     kernel-module-xen-gntdev \
     kernel-module-xen-netback \
-    kernel-module-xen-pciback \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'kernel-module-xen-pciback', '', d)} \
     kernel-module-xen-wdt \
     xen-base \
     xen-qemu \
Signature · 1 line
2.1.1
#7 lore raw

PATCH 7/14 xen: Update recipe to 4.5.0

In reply to a message not in the archive

* Added configure step to fix handling of the CC, AS, etc. variables within the xen build scripts.
* Add configure options for handling of system config directories for cross building
* Use the qemu provided by oe instead of the xen built version for consistency as well as to remove the need to have two seperate flows for building qemu
* Disable building of SeaBIOS
* Removed no longer needed patches

squish

---
 ...lask-avoid-installing-policy-file-as-boot.patch | 26 ----------------
 recipes-extended/xen/xen_4.3.1.bb                  | 24 ---------------
 recipes-extended/xen/xen_4.5.0.bb                  | 36 ++++++++++++++++++++++
 3 files changed, 36 insertions(+), 50 deletions(-)
 delete mode 100644 recipes-extended/xen/files/flask-avoid-installing-policy-file-as-boot.patch
 delete mode 100644 recipes-extended/xen/xen_4.3.1.bb
 create mode 100644 recipes-extended/xen/xen_4.5.0.bb
recipes-extended/xen/files/flask-avoid-installing-policy-file-as-boot.patch deleted +0 -26
deleted file mode 100644
index d980807..0000000
@@ -1,26 +0,0 @@
-From 8bff3edead4318bfebc487f929f833d11922c238 Mon Sep 17 00:00:00 2001
-From: "Vadim A. Misbakh-Soloviov" <[email protected]>
-Date: Tue, 30 Jul 2013 16:34:38 +0400
-Subject: [PATCH] flask: avoid installing policy file as '/boot'
-
-Signed-off-by: Vadim A. Misbakh-Soloviov <[email protected]>
-Acked-by: Daniel De Graaf <[email protected]>
----
- tools/flask/policy/Makefile |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
-index e666f3e..df1e8f3 100644
---- a/tools/flask/policy/Makefile
-+++ b/tools/flask/policy/Makefile
-@@ -103,6 +103,7 @@ POLICY_SECTIONS += $(USERS) $(CONSTRAINTS) $(ISID_DEFS)
- all: $(POLICY_FILENAME)
- 
- install: $(POLICY_FILENAME)
-+	$(INSTALL_DIR) $(POLICY_LOADPATH)
- 	$(INSTALL_DATA) $^ $(POLICY_LOADPATH)
- 
- $(POLICY_FILENAME): policy.conf
--- 
-1.7.10.4
-
recipes-extended/xen/xen_4.3.1.bb deleted +0 -24
deleted file mode 100644
index 2c9806b..0000000
@@ -1,24 +0,0 @@
-require xen.inc
-
-SRC_URI = " \
-    http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \
-    file://flask-avoid-installing-policy-file-as-boot.patch \
-    "
-
-SRC_URI[md5sum] = "7616b8704e1ab89c81f011f0e3703bc8"
-SRC_URI[sha256sum] = "3b5b7cc508b1739753585b5c25635471cdcef680e8770a78bf6ef9333d26a9fd"
-
-S = "${WORKDIR}/xen-${PV}"
-
-RDEPENDS_${PN}-base += "\
-    ${PN}-libblktap \
-    ${PN}-flask \
-    "
-
-do_configure_prepend() {
-    # fixup qemu-xen-traditional pciutils check hardcoded to test /usr/include/pci
-    sed -i 's/\/usr\/include\/pci/$(STAGING_INCDIR)\/pci/g' ${S}/tools/qemu-xen-traditional/xen-hooks.mak
-
-    # fixup for qemu to cross compile
-    sed -i 's/configure --d/configure --cross-prefix=${TARGET_PREFIX} --d/g' ${S}/tools/qemu-xen-traditional/xen-setup
-}
recipes-extended/xen/xen_4.5.0.bb new file +36 -0
new file mode 100644
index 0000000..62d1d87
@@ -0,0 +1,36 @@
+require xen.inc
+
+SRC_URI = " \
+    http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \
+    "
+
+SRC_URI[md5sum] = "9bac43d2419d05a647064d9253bb03fa"
+SRC_URI[sha256sum] = "5bdb40e2b28d2eeb541bd71a9777f40cbe2ae444b987521d33f099541a006f3b"
+
+S = "${WORKDIR}/xen-${PV}"
+
+# Xen suffixes the libexecdir within its configure scripts, prevent the nested xen/xen/
+libexecdir = "${libdir}"
+
+# These options override detected values from the build.
+EXTRA_OECONF_append += " \
+    --with-initddir=${INIT_D_DIR} \
+    --with-sysconfig-leaf-dir=default \
+    --with-system-qemu=/usr/bin/qemu-system-i386 \
+    --disable-qemu-traditional \
+    --disable-seabios \
+    "
+
+do_configure_prepend() {
+    # fixup AS/CC/CCP/etc variable within StdGNU.mk
+    for i in AS LD CC CPP AR RANLIB NM STRIP OBJCOPY OBJDUMP; do
+        sed -i "s/^\($i\s\s*\).*=/\1?=/" ${S}/config/StdGNU.mk
+    done
+    # fixup environment passing in some makefiles
+    sed -i 's#\(\w*\)=\(\$.\w*.\)#\1="\2"#' ${S}/tools/firmware/Makefile
+}
+
+do_install_append() {
+    # fixup default path to qemu-system-i386
+    sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
+}
Signature · 1 line
2.1.1
#8 lore raw

PATCH 8/14 xen-image-minimal: Install qemu instead of xen-qemu

In reply to a message not in the archive

* Install QEMU from the distro as opposed to a specific xen-qemu setup

---
 recipes-extended/images/xen-image-minimal.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/images/xen-image-minimal.bb +1 -1
index aed0526..26b6d06 100644
@@ -13,7 +13,7 @@ IMAGE_INSTALL += " \
     ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'kernel-module-xen-pciback', '', d)} \
     kernel-module-xen-wdt \
     xen-base \
-    xen-qemu \
+    qemu \
     "
 
 LICENSE = "MIT"
Signature · 1 line
2.1.1
#9 lore raw

PATCH 9/14 xen: Add support for systemd

In reply to a message not in the archive

* Refactor volatiles so that it generates sysvinit/populate-volatiles as well as tmpfiles.d configs
* Add systemd PACKAGECONFIG for enabling systemd support
* Setup SYSTEMD_SERVICE variables
* Add FILES values for systemd .service/.mount/etc files
* sed patterns to the 4.5.0 recipe to fix some issues with the source around qemu-system-i386 and libsystemd-daemon

---
 recipes-extended/xen/xen.inc      | 81 ++++++++++++++++++++++++++++++---------
 recipes-extended/xen/xen_4.5.0.bb |  8 ++++
 2 files changed, 70 insertions(+), 19 deletions(-)
recipes-extended/xen/xen.inc +62 -19
index 82bb3d2..3f703ce 100644
@@ -8,16 +8,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e0f0f3ac55608719a82394cc353928df"
 
 COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux'
 
-inherit autotools-brokensep gettext setuptools update-rc.d
+inherit autotools-brokensep gettext setuptools update-rc.d systemd
 
 require xen-arch.inc
 
 PACKAGECONFIG ??= " \
     sdl \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
     "
 
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl,"
 PACKAGECONFIG[xsm] = "--enable-xsmpolicy,--disable-xsmpolicy,checkpolicy-native,"
+PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd,"
 
 DEPENDS = " \
     bison-native \
@@ -111,6 +113,7 @@ RDEPENDS_${PN}-xencommons = "\
     ${PN}-console \
     ${PN}-xenstore \
     ${PN}-xenstored \
+    ${PN}-xl \
     ${PN}-scripts-common \
     "
 
@@ -499,6 +502,7 @@ FILES_${PN}-udev = "\
 
 FILES_${PN}-volatiles = "\
     ${sysconfdir}/default/volatiles/99_xen \
+    ${sysconfdir}/tmpfiles.d/xen.conf \
     "
 
 FILES_${PN}-xcutils = "\
@@ -555,6 +559,7 @@ FILES_${PN}-xentrace = "\
 FILES_${PN}-xen-watchdog = "\
     ${sbindir}/xenwatchdogd \
     ${sysconfdir}/init.d/xen-watchdog \
+    ${systemd_unitdir}/system/xen-watchdog.service \
     "
 
 FILES_${PN}-xl = "\
@@ -596,6 +601,15 @@ FILES_${PN}-xm = "\
 FILES_${PN}-xencommons += "\
     ${sysconfdir}/default/xencommons \
     ${sysconfdir}/init.d/xencommons \
+    ${systemd_unitdir}/modules-load.d/xen.conf \
+    ${systemd_unitdir}/system/proc-xen.mount \
+    ${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
+    ${systemd_unitdir}/system/xenconsoled.service \
+    ${systemd_unitdir}/system/xen-init-dom0.service \
+    ${systemd_unitdir}/system/xenstored.service \
+    ${systemd_unitdir}/system/xenstored.socket \
+    ${systemd_unitdir}/system/xenstored_ro.socket \
+    ${systemd_unitdir}/system/var-lib-xenstored.mount \
     "
 
 FILES_${PN}-xend += " \
@@ -608,6 +622,7 @@ FILES_${PN}-xendomains += "\
     ${sysconfdir}/default/xendomains \
     ${sysconfdir}/init.d/xendomains \
     ${sysconfdir}/sysconfig/xendomains \
+    ${systemd_unitdir}/system/xendomains.service \
     "
 
 # configure init.d scripts
@@ -621,6 +636,21 @@ INITSCRIPT_PARAMS_${PN}-xend = "defaults 82"
 INITSCRIPT_NAME_${PN}-xendomains = "xendomains"
 INITSCRIPT_PARAMS_${PN}-xendomains = "defaults 83"
 
+# systemd packages
+SYSTEMD_PACKAGES = "${PN}-xen-watchdog ${PN}-xencommons ${PN}-xendomains"
+SYSTEMD_SERVICE_${PN}-watchdog = "xen-watchdog.service"
+SYSTEMD_SERVICE_${PN}-xencommons = " \
+    proc-xen.mount \
+    var-lib-xenstored.mount \
+    xen-qemu-dom0-disk-backend.service \
+    xenconsoled.service \
+    xen-init-dom0.service \
+    xenstored.service \
+    xenstored.socket \
+    xenstored_ro.socket \
+    "
+SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service"
+
 #### REQUIRED ENVIRONMENT VARIABLES ####
 export BUILD_SYS
 export HOST_SYS
@@ -650,6 +680,8 @@ EXTRA_OECONF += " \
     --exec-prefix=/usr \
     --prefix=/usr \
     --host=${HOST_SYS} \
+    --with-systemd=${systemd_unitdir}/system \
+    --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
     --disable-stubdom \
     --disable-ioemu-stubdom \
     --disable-pv-grub \
@@ -686,33 +718,44 @@ do_install() {
         ${D}${localstatedir}/volatile \
         ${D}${localstatedir}/lib/xen
 
+    VOLATILE_DIRS=" \
+        ${localstatedir}/run/xenstored \
+        ${localstatedir}/run/xend \
+        ${localstatedir}/run/xend/boot \
+        ${localstatedir}/run/xen \
+        ${localstatedir}/log/xen \
+        ${localstatedir}/lock/xen \
+        ${localstatedir}/lock/subsys \
+        ${localstatedir}/lib/xen \
+        "
+
     # install volatiles using populate_volatiles mechanism
     install -d ${D}${sysconfdir}/default/volatiles
-    echo "d root root 0755 ${localstatedir}/run/xenstored none" \
-         > ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/run/xend none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/run/xend/boot none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/run/xen none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/log/xen none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/lock/xen none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/lock/subsys none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
-    echo "d root root 0755 ${localstatedir}/lib/xen none" \
-         >> ${D}${sysconfdir}/default/volatiles/99_xen
+    for i in $VOLATILE_DIRS; do
+        echo "d root root 0755 $i none"  >> ${D}${sysconfdir}/default/volatiles/99_xen
+    done
 
     # workaround for xendomains script which searchs sysconfig if directory exists
     install -d ${D}${sysconfdir}/sysconfig
     ln -sf ${sysconfdir}/default/xendomains ${D}${sysconfdir}/sysconfig/xendomains
+
+    # systemd
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        # install volatiles using systemd tmpfiles.d
+        install -d ${D}${sysconfdir}/tmpfiles.d
+        for i in $VOLATILE_DIRS; do
+            echo "d $i 0755 root root - -"  >> ${D}${sysconfdir}/tmpfiles.d/xen.conf
+        done
+    fi
 }
 
 pkg_postinst_${PN}-volatiles() {
-    if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
-        ${sysconfdir}/init.d/populate-volatile.sh update
+    if [ -z "$D" ]; then
+        if command -v systemd-tmpfiles >/dev/null; then
+            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/xen.conf
+        elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+            ${sysconfdir}/init.d/populate-volatile.sh update
+        fi
     fi
 }
 
recipes-extended/xen/xen_4.5.0.bb +8 -0
index 62d1d87..5f8c087 100644
@@ -28,9 +28,17 @@ do_configure_prepend() {
     done
     # fixup environment passing in some makefiles
     sed -i 's#\(\w*\)=\(\$.\w*.\)#\1="\2"#' ${S}/tools/firmware/Makefile
+
+    # libsystemd-daemon -> libsystemd for newer systemd versions
+    sed -i 's#libsystemd-daemon#libsystemd#' ${S}/tools/configure
 }
 
 do_install_append() {
     # fixup default path to qemu-system-i386
     sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
+
+    if [ -e ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service ]; then
+        sed -i 's#ExecStart=.*qemu-system-i386\(.*\)$#ExecStart=/usr/bin/qemu-system-i386\1#' \
+            ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service
+    fi
 }
Signature · 1 line
2.1.1
#10 lore raw

PATCH 10/14 xen: Add patch to fix build failure on x86

In reply to a message not in the archive

* Add a patch which enables -mfpmath=387 which prevents the warning, which is treated as an error

---
 ...xen-x86-Fix-up-rules-when-forcing-mno-sse.patch | 28 ++++++++++++++++++++++
 recipes-extended/xen/xen_4.5.0.bb                  |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch
recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch new file +28 -0
new file mode 100644
index 0000000..4c3e297
@@ -0,0 +1,28 @@
+From: Nathan Rossi <[email protected]>
+Subject: [PATCH] xen/x86: Fix up rules when forcing -mno-sse
+
+* When forcing -mno-sse specify -mfpmath=387 to avoid the fallback
+  warning
+
+Signed-off-by: Nathan Rossi <[email protected]>
+Upstream-Status: Not-Submitted
+---
+ xen/arch/x86/Rules.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
+index 6775cb5..03848f7 100644
+--- a/xen/arch/x86/Rules.mk
++++ b/xen/arch/x86/Rules.mk
+@@ -42,7 +42,7 @@ x86 := y
+ x86_32 := n
+ x86_64 := y
+ 
+-CFLAGS += -mno-red-zone -mno-sse -fpic
++CFLAGS += -mno-red-zone -mno-sse -fpic -mfpmath=387
+ CFLAGS += -fno-asynchronous-unwind-tables
+ # -fvisibility=hidden reduces -fpic cost, if it's available
+ ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
+-- 
+2.1.1
+
recipes-extended/xen/xen_4.5.0.bb +1 -0
index 5f8c087..cef0665 100644
@@ -2,6 +2,7 @@ require xen.inc
 
 SRC_URI = " \
     http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \
+    file://xen-x86-Fix-up-rules-when-forcing-mno-sse.patch \
     "
 
 SRC_URI[md5sum] = "9bac43d2419d05a647064d9253bb03fa"
Signature · 1 line
2.1.1
#11 lore raw

PATCH 11/14 xen: break out firmware bits

In reply to a message not in the archive

From: Chris Patterson <[email protected]>

Added recipes for various xen firmware components:
- ipxe
- seabios
- vgabios

---
 recipes-extended/ipxe/ipxe_git.bb             |  31 ++++++++
 recipes-extended/seabios/seabios/defconfig    | 102 ++++++++++++++++++++++++++
 recipes-extended/seabios/seabios/hostcc.patch |  21 ++++++
 recipes-extended/seabios/seabios_1.7.5.bb     |  46 ++++++++++++
 recipes-extended/vgabios/vgabios_0.7a.bb      |  31 ++++++++
 5 files changed, 231 insertions(+)
 create mode 100644 recipes-extended/ipxe/ipxe_git.bb
 create mode 100644 recipes-extended/seabios/seabios/defconfig
 create mode 100644 recipes-extended/seabios/seabios/hostcc.patch
 create mode 100644 recipes-extended/seabios/seabios_1.7.5.bb
 create mode 100644 recipes-extended/vgabios/vgabios_0.7a.bb
recipes-extended/ipxe/ipxe_git.bb new file +31 -0
new file mode 100644
index 0000000..6dc492e
@@ -0,0 +1,31 @@
+DESCRIPTION = "Open source network boot firmware"
+HOMEPAGE = "http://ipxe.org"
+LICENSE = "GPLv2"
+DEPENDS = "binutils-native perl-native syslinux mtools-native"
+LIC_FILES_CHKSUM = "file://../COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRCREV = "8c43891db4eb131d019360ccfb619f235b17eb58"
+PV = "gitr${SRCPV}"
+PR = "r0"
+
+SRC_URI = "git://git.ipxe.org/ipxe.git;protocol=git"
+
+FILES_${PN} = "/usr/share/firmware/*.rom"
+
+EXTRA_OEMAKE = "NO_WERROR=1"
+#PARALLEL_MAKE=""
+
+S = "${WORKDIR}/git/src"
+
+do_configure() {
+   sed -i s#^ISOLINUX_BIN[\ \\t]*=.*#ISOLINUX_BIN\ =\ ${STAGING_DIR_TARGET}/usr/lib/syslinux/isolinux.bin# arch/i386/Makefile
+}
+
+do_compile() {
+   oe_runmake
+}
+
+do_install() {
+    install -d ${D}/usr/share/firmware
+    install ${S}/bin/*.rom ${D}/usr/share/firmware/
+}
recipes-extended/seabios/seabios/defconfig new file +102 -0

102 lines not on this page · raw message

recipes-extended/seabios/seabios/hostcc.patch new file +21 -0
new file mode 100644
index 0000000..f665e1a
@@ -0,0 +1,21 @@
+diff -ur a/Makefile b/Makefile
+--- a/Makefile	2015-02-02 22:02:58.651041951 -0500
++++ b/Makefile	2015-02-02 23:08:13.884514003 -0500
+@@ -8,7 +8,7 @@
+ OUT=out/
+ 
+ # Common command definitions
+-export HOSTCC             := $(CC)
++export HOSTCC             ?= $(CC)
+ export CONFIG_SHELL       := sh
+ export KCONFIG_AUTOHEADER := autoconf.h
+ export KCONFIG_CONFIG     := $(CURDIR)/.config
+@@ -22,7 +22,7 @@
+ OBJDUMP=$(CROSS_PREFIX)objdump
+ STRIP=$(CROSS_PREFIX)strip
+ PYTHON=python
+-CPP=cpp
++CPP=$(CROSS_PREFIX)cpp
+ IASL:=iasl
+ LD32BIT_FLAG:=-melf_i386
+ 
recipes-extended/seabios/seabios_1.7.5.bb new file +46 -0

46 lines not on this page · raw message

recipes-extended/vgabios/vgabios_0.7a.bb new file +31 -0
new file mode 100644
index 0000000..6addeff
@@ -0,0 +1,31 @@
+DESCRIPTION = "Plex86/Bochs LGPL VGABios"
+HOMEPAGE = "http://www.nongnu.org/vgabios/"
+LICENSE = "LGPLv2.1"
+SECTION = "firmware"
+DEPENDS = ""
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
+DEPENDS = ""
+
+SRC_URI =  "http://savannah.gnu.org/download/vgabios/${PN}-${PV}.tgz"
+
+SRC_URI[md5sum] = "2c0fe5c0ca08082a9293e3a7b23dc900"
+SRC_URI[sha256sum] = "9d24c33d4bfb7831e2069cf3644936a53ef3de21d467872b54ce2ea30881b865"
+
+PR = "r0"
+
+FILES_${PN} = "/usr/share/firmware/${PN}-${PV}*.bin"
+FILES_${PN}-dbg = "/usr/share/firmware/${PN}-${PV}*.debug.bin"
+
+S = "${WORKDIR}/${PN}-${PV}"
+
+do_configure() {
+    echo "Skip do_configure"
+}
+
+do_install() {
+    install -d ${D}/usr/share/firmware
+    install -m 0644 VGABIOS-lgpl-latest.bin ${D}/usr/share/firmware/${PN}-${PV}.bin
+    install -m 0644 VGABIOS-lgpl-latest.cirrus.bin ${D}/usr/share/firmware/${PN}-${PV}.cirrus.bin
+}
+
Signature · 1 line
2.1.1
#12 lore raw

PATCH 12/14 xen: Add 'hvm' PACKAGECONFIG for hvmloader building

In reply to a message not in the archive

* The 'hvm' PACKAGECONFIG (which is valid for x86 targets, and default enabled for x86-64 targets) enables building the hvmloader with in-built seabios, ipxe and vgabios firmware

---
 recipes-extended/xen/xen.inc      | 5 ++++-
 recipes-extended/xen/xen_4.5.0.bb | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
recipes-extended/xen/xen.inc +4 -1
index 3f703ce..0e4136a 100644
@@ -15,11 +15,13 @@ require xen-arch.inc
 PACKAGECONFIG ??= " \
     sdl \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.contains('XEN_TARGET_ARCH', 'x86_64', 'hvm', '', d)} \
     "
 
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl,"
 PACKAGECONFIG[xsm] = "--enable-xsmpolicy,--disable-xsmpolicy,checkpolicy-native,"
 PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd,"
+PACKAGECONFIG[hvm] = "--with-system-seabios="${STAGING_DIR_HOST}/usr/share/firmware/bios.bin",--disable-seabios,seabios ipxe vgabios,"
 
 DEPENDS = " \
     bison-native \
@@ -686,7 +688,8 @@ EXTRA_OECONF += " \
     --disable-ioemu-stubdom \
     --disable-pv-grub \
     --disable-xenstore-stubdom \
-"
+    --disable-rombios \
+    "
 
 do_configure() {
     # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu
recipes-extended/xen/xen_4.5.0.bb +6 -1
index cef0665..6c17b90 100644
@@ -19,9 +19,14 @@ EXTRA_OECONF_append += " \
     --with-sysconfig-leaf-dir=default \
     --with-system-qemu=/usr/bin/qemu-system-i386 \
     --disable-qemu-traditional \
-    --disable-seabios \
     "
 
+EXTRA_OEMAKE += "STDVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.bin"
+EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.cirrus.bin"
+EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin"
+EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom"
+#EXTRA_OEMAKE += "XENGFX_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios.bin"
+
 do_configure_prepend() {
     # fixup AS/CC/CCP/etc variable within StdGNU.mk
     for i in AS LD CC CPP AR RANLIB NM STRIP OBJCOPY OBJDUMP; do
Signature · 1 line
2.1.1
#13 lore raw

PATCH 13/14 vgabios: DEPENDS on dev86-native

In reply to a message not in the archive

From: Chris Patterson <[email protected]>

---
 recipes-extended/vgabios/vgabios_0.7a.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-extended/vgabios/vgabios_0.7a.bb +2 -2
index 6addeff..0ed8bb4 100644
@@ -2,10 +2,10 @@ DESCRIPTION = "Plex86/Bochs LGPL VGABios"
 HOMEPAGE = "http://www.nongnu.org/vgabios/"
 LICENSE = "LGPLv2.1"
 SECTION = "firmware"
-DEPENDS = ""
+
+DEPENDS = "dev86-native"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
-DEPENDS = ""
 
 SRC_URI =  "http://savannah.gnu.org/download/vgabios/${PN}-${PV}.tgz"
 
Signature · 1 line
2.1.1
#14 lore raw

PATCH 14/14 seabios: minor cleanup

In reply to a message not in the archive

From: Chris Patterson <[email protected]>

- use EXTRA_OEMAKE for passing along make flags
- drop PARALLEL_MAKE="" override which is not required.

---
 recipes-extended/seabios/seabios_1.7.5.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
recipes-extended/seabios/seabios_1.7.5.bb +2 -3
index 5ff0004..511578f 100644
@@ -23,9 +23,8 @@ FILES_${PN} = "/usr/share/firmware"
 DEPENDS = "util-linux-native file-native bison-native flex-native gettext-native iasl-native python-native"
 
 TUNE_CCARGS = ""
-PARALLEL_MAKE = ""
-export HOSTCC="${BUILD_CC}"
-export CROSS_PREFIX="${TARGET_PREFIX}"
+EXTRA_OEMAKE += "HOSTCC=${BUILD_CC}"
+EXTRA_OEMAKE += "CROSS_PREFIX=${TARGET_PREFIX}"
 
 do_configure() {
     install -m 0644 "${WORKDIR}/defconfig" .config
Signature · 1 line
2.1.1