All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal
@ 2013-08-30  3:37 Chris Patterson
  2013-08-30  3:37 ` [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support Chris Patterson
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Chris Patterson @ 2013-08-30  3:37 UTC (permalink / raw)
  To: meta-virtualization

This set of patches should provide a user with the ability to generate a xen 4.3.0 based dom0 image.

[NOTES]

With these patches, xen-image-minimal requires "xen" and "aufs" to be present in DISTRO_FEATURES to function correctly.  

[DISTRO TESTING]

This image has been tested using:

machine=sugarbay
DISTRO_FEATURES += " aufs xen"

[BUILDING IMAGE]

bitbake xen-image-minimal

[QEMU BUILD TESTING]

To start up and test core-image-xen using kvm on hardware supporting nested virtualization:

kvm -hda deploy/images/xen-image-minimal-sugarbay.hddimg -cpu host -no-kvm-irqchip -m 4096 -net nic,model=e1000 -net user -serial stdio

..or..

kvm -hdc deploy/images/xen-image-minimal-sugarbay.iso -cpu host -no-kvm-irqchip -m 4096 -net nic,model=e1000 -net user -serial stdio

[XEN TESTING]

To test the runtime core-image-xen and boot a debian PV virtual machine:

# bring up networking
ifconfig eth0 up
brctl addbr br0
brctl addif br0 eth0
udhcpc -i br0

# place test debian vm in /test/debian
mkdir -p /test/debian
cd /test/debian

# pull example kernel, initrd
wget http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/xen/initrd.gz
wget http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/xen/vmlinuz

# create 4G disk
truncate -s 4096M disk.img

cat > debian.cfg << EOF
kernel = "/test/debian/vmlinuz"
ramdisk = "/test/debian/initrd.gz"
extra = "debian-installer/exit/always_halt=true -- console=hvc0"
vif = ['bridge=br0']
memory = "256"
name = "debian"
disk = ['file:/test/debian/disk.img,xvda,w']
EOF

xl -v create -d debian.cfg

xl console debian

Chris Patterson (4):
  linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  linux-yocto: add optional support for aufs and xen using
    DISTRO_FEATURES.
  xen: add 4.3.0 recipe.
  xen-image-minimal: update image to support xen 4.3.0 base with xl
    toolstack.

 recipes-extended/images/xen-image-initramfs.bb     |   17 +
 recipes-extended/images/xen-image-minimal.bb       |   55 +-
 .../initrdscripts/files/init-boot-xen.sh           |  205 +++++++
 .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 +
 recipes-extended/xen/xen_4.3.0.bb                  |  623 ++++++++++++++++++++
 recipes-kernel/linux/linux-yocto/xen.cfg           |   53 ++
 recipes-kernel/linux/linux-yocto/xen.scc           |    4 +
 recipes-kernel/linux/linux-yocto_3.4.bbappend      |    6 +
 recipes-kernel/linux/linux-yocto_3.8.bbappend      |    6 +
 9 files changed, 978 insertions(+), 7 deletions(-)
 create mode 100644 recipes-extended/images/xen-image-initramfs.bb
 create mode 100644 recipes-extended/initrdscripts/files/init-boot-xen.sh
 create mode 100644 recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
 create mode 100644 recipes-extended/xen/xen_4.3.0.bb
 create mode 100644 recipes-kernel/linux/linux-yocto/xen.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/xen.scc

-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-08-30  3:37 [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Chris Patterson
@ 2013-08-30  3:37 ` Chris Patterson
  2013-08-30  5:32   ` Bruce Ashfield
  2013-08-30  3:37 ` [PATCH 2/4] linux-yocto: add optional support for aufs and xen using DISTRO_FEATURES Chris Patterson
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Chris Patterson @ 2013-08-30  3:37 UTC (permalink / raw)
  To: meta-virtualization

---
 recipes-kernel/linux/linux-yocto/xen.cfg |   53 ++++++++++++++++++++++++++++++
 recipes-kernel/linux/linux-yocto/xen.scc |    4 +++
 2 files changed, 57 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/xen.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/xen.scc

diff --git a/recipes-kernel/linux/linux-yocto/xen.cfg b/recipes-kernel/linux/linux-yocto/xen.cfg
new file mode 100644
index 0000000..f9cfb6a
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/xen.cfg
@@ -0,0 +1,53 @@
+..........................................................................
+.                                WARNING
+.
+. This file is a kernel configuration fragment, and not a full kernel
+. configuration file.  The final kernel configuration is made up of
+. an assembly of processed fragments, each of which is designed to
+. capture a specific part of the final configuration (e.g. platform
+. configuration, feature configuration, and board specific hardware
+. configuration).  For more information on kernel configuration, please
+. consult the product documentation.
+.
+..........................................................................
+
+CONFIG_PARAVIRT_GUEST=y
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+CONFIG_XEN_PRIVILEGED_GUEST=y
+CONFIG_XEN_PVHVM=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=500
+CONFIG_XEN_SAVE_RESTORE=y
+# CONFIG_XEN_DEBUG_FS is not set
+CONFIG_PARAVIRT=y
+# CONFIG_PARAVIRT_SPINLOCKS is not set
+CONFIG_PARAVIRT_CLOCK=y
+# CONFIG_PARAVIRT_DEBUG is not set
+CONFIG_PCI_XEN=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_XEN_WDT=m
+CONFIG_XEN_FBDEV_FRONTEND=y
+# Xen driver support
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=m
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=m
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=m
+CONFIG_XEN_GRANT_DEV_ALLOC=m
+CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PCIDEV_BACKEND=y
+CONFIG_XEN_PRIVCMD=m
+CONFIG_XEN_ACPI_PROCESSOR=m
+CONFIG_PCI_STUB=y
diff --git a/recipes-kernel/linux/linux-yocto/xen.scc b/recipes-kernel/linux/linux-yocto/xen.scc
new file mode 100644
index 0000000..6c68bda
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/xen.scc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Xen Dom0 Support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware xen.cfg
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/4] linux-yocto: add optional support for aufs and xen using DISTRO_FEATURES.
  2013-08-30  3:37 [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Chris Patterson
  2013-08-30  3:37 ` [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support Chris Patterson
@ 2013-08-30  3:37 ` Chris Patterson
  2013-08-30  5:34   ` Bruce Ashfield
  2013-08-30  3:37 ` [PATCH 3/4] xen: add 4.3.0 recipe Chris Patterson
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Chris Patterson @ 2013-08-30  3:37 UTC (permalink / raw)
  To: meta-virtualization

---
 recipes-kernel/linux/linux-yocto_3.4.bbappend |    6 ++++++
 recipes-kernel/linux/linux-yocto_3.8.bbappend |    6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/recipes-kernel/linux/linux-yocto_3.4.bbappend b/recipes-kernel/linux/linux-yocto_3.4.bbappend
index 2893a01..2ada931 100644
--- a/recipes-kernel/linux/linux-yocto_3.4.bbappend
+++ b/recipes-kernel/linux/linux-yocto_3.4.bbappend
@@ -11,3 +11,9 @@ KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
 module_autoload_kvm = "kvm"
 module_autoload_kvm-amd = "kvm-amd"
 module_autoload_kvm-intel = "kvm-intel"
+
+# aufs kernel support required for core-image-xen
+KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
+
+# xen dom0 kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
diff --git a/recipes-kernel/linux/linux-yocto_3.8.bbappend b/recipes-kernel/linux/linux-yocto_3.8.bbappend
index 2893a01..2ada931 100644
--- a/recipes-kernel/linux/linux-yocto_3.8.bbappend
+++ b/recipes-kernel/linux/linux-yocto_3.8.bbappend
@@ -11,3 +11,9 @@ KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
 module_autoload_kvm = "kvm"
 module_autoload_kvm-amd = "kvm-amd"
 module_autoload_kvm-intel = "kvm-intel"
+
+# aufs kernel support required for core-image-xen
+KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
+
+# xen dom0 kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/4] xen: add 4.3.0 recipe.
  2013-08-30  3:37 [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Chris Patterson
  2013-08-30  3:37 ` [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support Chris Patterson
  2013-08-30  3:37 ` [PATCH 2/4] linux-yocto: add optional support for aufs and xen using DISTRO_FEATURES Chris Patterson
@ 2013-08-30  3:37 ` Chris Patterson
  2013-08-30  3:37 ` [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack Chris Patterson
  2013-08-30  5:39 ` [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Bruce Ashfield
  4 siblings, 0 replies; 18+ messages in thread
From: Chris Patterson @ 2013-08-30  3:37 UTC (permalink / raw)
  To: meta-virtualization

---
 recipes-extended/xen/xen_4.3.0.bb |  623 +++++++++++++++++++++++++++++++++++++
 1 file changed, 623 insertions(+)
 create mode 100644 recipes-extended/xen/xen_4.3.0.bb

diff --git a/recipes-extended/xen/xen_4.3.0.bb b/recipes-extended/xen/xen_4.3.0.bb
new file mode 100644
index 0000000..baafbd8
--- /dev/null
+++ b/recipes-extended/xen/xen_4.3.0.bb
@@ -0,0 +1,623 @@
+DESCRIPTION = "Xen hypervisor"
+HOMEPAGE = "http://xen.org"
+LICENSE = "GPLv2"
+SECTION = "console/tools"
+PR = "r0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e0f0f3ac55608719a82394cc353928df"
+
+SRC_URI = "http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "7b18cfb58f1ac2ce39cf35a1867f0c0a"
+SRC_URI[sha256sum] = "e1e9faabe4886e2227aacdbde74410653b233d66642ca1972a860cbec6439961"
+
+S = "${WORKDIR}/xen-${PV}"
+
+COMPATIBLE_HOST = '(x86_64.*).*-linux'
+
+inherit autotools gettext setuptools update-rc.d
+
+DEPENDS = "util-linux util-linux-native file-native zlib ncurses openssl bison-native flex-native gettext dev86-native iasl-native pciutils virtual/libgl virtual/libsdl bridge-utils iproute2 procps yajl pixman python xz xz-native"
+
+RDEPENDS_xen-base = "\
+    libgcc pciutils bridge-utils iproute2 util-linux udev procps bash coreutils python python-core python-shell python-pprint perl xz \
+    ${PN}-blktap \
+    ${PN}-console \
+    ${PN}-libblktapctl \
+    ${PN}-libxenguest \
+    ${PN}-libxenlight \
+    ${PN}-libxenvchan \
+    ${PN}-libxenctrl \
+    ${PN}-libxlutil \
+    ${PN}-libvhd \
+    ${PN}-libxenstat \
+    ${PN}-libxenstore \
+    ${PN}-libblktap \
+    ${PN}-libfsimage \
+    ${PN}-flask \
+    ${PN}-fsimage \
+    ${PN}-hvmloader \
+    ${PN}-scripts-block \
+    ${PN}-scripts-network \
+    ${PN}-udev \
+    ${PN}-xenpaging \
+    ${PN}-xen-watchdog \
+    ${PN}-xencommons \
+    ${PN}-xendomains \
+    ${PN}-xenstore \
+    ${PN}-xenstored \
+    ${PN}-xl \
+    "
+
+RDEPENDS_${PN}-scripts-block = "\
+    ${PN}-scripts-common \
+    ${PN}-udev \
+    "
+
+RDEPENDS_${PN}-scripts-network = "\
+    bridge-utils \
+    ${PN}-scripts-common \
+    ${PN}-udev \
+    "
+
+PACKAGES = "\
+    ${PN}-base \
+    ${PN}-blktap \
+    ${PN}-console \
+    ${PN}-dbg \
+    ${PN}-dev \
+    ${PN}-doc \
+    ${PN}-flask \
+    ${PN}-fsimage \
+    ${PN}-gdbsx \
+    ${PN}-hvmloader \
+    ${PN}-hypervisor \
+    ${PN}-kdd \
+    ${PN}-libblktap \
+    ${PN}-libblktapctl \
+    ${PN}-libblktapctl-dev \
+    ${PN}-libblktap-dev \
+    ${PN}-libfsimage \
+    ${PN}-libfsimage-dev \
+    ${PN}-libvhd \
+    ${PN}-libvhd-dev \
+    ${PN}-libxenctrl \
+    ${PN}-libxenctrl-dev \
+    ${PN}-libxenguest \
+    ${PN}-libxenguest-dev \
+    ${PN}-libxenlight \
+    ${PN}-libxenlight-dev \
+    ${PN}-libxenstat \
+    ${PN}-libxenstat-dev \
+    ${PN}-libxenstore \
+    ${PN}-libxenstore-dev \
+    ${PN}-libxenvchan \
+    ${PN}-libxenvchan-dev \
+    ${PN}-libxlutil \
+    ${PN}-libxlutil-dev \
+    ${PN}-misc \
+    ${PN}-pygrub \
+    ${PN}-python \
+    ${PN}-qemu \
+    ${PN}-remus \
+    ${PN}-scripts-block \
+    ${PN}-scripts-common \
+    ${PN}-scripts-network \
+    ${PN}-staticdev \
+    ${PN}-udev \
+    ${PN}-xcutils \
+    ${PN}-xencommons \
+    ${PN}-xend \
+    ${PN}-xend-examples \
+    ${PN}-xendomains \
+    ${PN}-xenmon \
+    ${PN}-xenpaging \
+    ${PN}-xenpmd \
+    ${PN}-xenstat \
+    ${PN}-xenstore \
+    ${PN}-xenstored \
+    ${PN}-xentrace \
+    ${PN}-xen-watchdog \
+    ${PN}-xl \
+    ${PN}-xl-examples \
+    ${PN}-xm \
+    ${PN}-xm-examples \
+    "
+
+FILES_${PN}-dbg += "\
+    ${libdir}/.debug \
+    ${libdir}/xen/bin/.debug \
+    ${libdir}/python2.7/site-packages/.debug \
+    ${libdir}/python2.7/site-packages/xen/lowlevel/.debug \
+    ${libdir}/fs/xfs/.debug \
+    ${libdir}/fs/ufs/.debug \
+    ${libdir}/fs/ext2fs-lib/.debug \
+    ${libdir}/fs/fat/.debug \
+    ${libdir}/fs/zfs/.debug \
+    ${libdir}/fs/reiserfs/.debug \
+    ${libdir}/fs/iso9660/.debug \
+    ${sbindir}/.debug \
+    ${libdir}exec/.debug \
+    ${bindir}/.debug \
+    ${libdir}/python2.7/dist-packages/.debug \
+    ${libdir}/python2.7/dist-packages/xen/lowlevel/.debug \
+    "
+
+FILES_${PN}-dev = "\
+    ${includedir} \
+    "
+
+FILES_${PN}-doc = "\
+    ${sysconfdir}/xen/README \
+    ${sysconfdir}/xen/README.incompatibilities \
+    ${datadir}/doc \
+    ${datadir}/man \
+    "
+
+FILES_${PN}-staticdev += "\
+    ${libdir}/libblktapctl.a \
+    ${libdir}/libxenguest.a \
+    ${libdir}/libxenlight.a \
+    ${libdir}/libxenvchan.a \
+    ${libdir}/libxenctrl.a \
+    ${libdir}/libxlutil.a \
+    ${libdir}/libvhd.a \
+    ${libdir}/libxenstat.a \
+    ${libdir}/libxenstore.a \
+    ${libdir}/libblktap.a \
+    "
+
+FILES_${PN}-libblktapctl = "${libdir}/libblktapctl.so.*"
+FILES_${PN}-libblktapctl-dev = "${libdir}/libblktapctl.so"
+
+FILES_${PN}-libxenguest = "${libdir}/libxenguest.so.*"
+FILES_${PN}-libxenguest-dev = "${libdir}/libxenguest.so"
+
+FILES_${PN}-libxenlight = "${libdir}/libxenlight.so.*"
+FILES_${PN}-libxenlight-dev = "${libdir}/libxenlight.so"
+
+FILES_${PN}-libxenvchan = "${libdir}/libxenvchan.so.*"
+FILES_${PN}-libxenvchan-dev = "${libdir}/libxenvchan.so"
+
+FILES_${PN}-libxenctrl = "${libdir}/libxenctrl.so.*"
+FILES_${PN}-libxenctrl-dev = "${libdir}/libxenctrl.so"
+
+FILES_${PN}-libxlutil = "${libdir}/libxlutil.so.*"
+FILES_${PN}-libxlutil-dev = "${libdir}/libxlutil.so"
+
+FILES_${PN}-libvhd = "${libdir}/libvhd.so.*"
+FILES_${PN}-libvhd-dev = "${libdir}/libvhd.so"
+
+FILES_${PN}-libxenstat = "${libdir}/libxenstat.so.*"
+FILES_${PN}-libxenstat-dev = "${libdir}/libxenstat.so"
+
+FILES_${PN}-libxenstore = "${libdir}/libxenstore.so.*"
+FILES_${PN}-libxenstore-dev = "${libdir}/libxenstore.so"
+
+FILES_${PN}-libblktap = "${libdir}/libblktap.so.*"
+FILES_${PN}-libblktap-dev = "${libdir}/libblktap.so"
+
+FILES_${PN}-libfsimage = "${libdir}/libfsimage.so.*"
+FILES_${PN}-libfsimage-dev = "${libdir}/libfsimage.so"
+
+FILES_${PN}-fsimage = "${libdir}/fs/*/*fsimage.so"
+
+FILES_${PN}-hypervisor = "\
+    /boot/xen-4.3.0.gz \
+    /boot/xen-4.3.gz \
+    /boot/xen-4.gz \
+    /boot/xen.gz \
+    /boot/xen-syms-4.3.0 \
+    "
+
+FILES_${PN}-base = "\
+    ${sysconfdir}/default/volatiles/99_xen \
+    ${sysconfdir}/default/xencommons \
+    ${sysconfdir}/default/xendomains \
+    ${sysconfdir}/xen/auto \
+    ${sysconfdir}/xen/cpupool \
+    ${sysconfdir}/sysconfig/xendomains \
+    ${localstatedir}/xen/dump \
+    "
+
+FILES_${PN}-blktap = "\
+    ${sbindir}/blktapctrl \
+    ${sbindir}/img2qcow \
+    ${sbindir}/lock-util \
+    ${sbindir}/qcow2raw \
+    ${sbindir}/qcow-create \
+    ${sbindir}/tap-ctl \
+    ${sbindir}/tapdisk \
+    ${sbindir}/tapdisk2 \
+    ${sbindir}/tapdisk-client \
+    ${sbindir}/tapdisk-diff \
+    ${sbindir}/tapdisk-stream \
+    ${sbindir}/td-util \
+    ${sbindir}/vhd-update \
+    ${sbindir}/vhd-util \
+    "
+
+FILES_${PN}-console = "\
+    ${libdir}/xen/bin/xenconsole \
+    ${sbindir}/xenconsoled \
+    "
+
+FILES_${PN}-flask = "\
+    ${sbindir}/flask-get-bool \
+    ${sbindir}/flask-getenforce \
+    ${sbindir}/flask-label-pci \
+    ${sbindir}/flask-loadpolicy \
+    ${sbindir}/flask-set-bool \
+    ${sbindir}/flask-setenforce \
+    "
+
+FILES_${PN}-gdbsx = "\
+    ${sbindir}/gdbsx \
+    "
+
+INSANE_SKIP_${PN}-hvmloader = "arch"
+FILES_${PN}-hvmloader = "\
+    ${libdir}/xen/boot/hvmloader \
+    "
+
+FILES_${PN}-kdd = "\
+    ${sbindir}/kdd \
+    "
+
+FILES_${PN}-misc = "\
+    ${bindir}/xencons \
+    ${bindir}/xencov_split \
+    ${bindir}/xen-detect \
+    ${libdir}/xen/bin/xenpvnetboot \
+    ${sbindir}/gtracestat \
+    ${sbindir}/gtraceview \
+    ${sbindir}/xen-bugtool \
+    ${sbindir}/xencov \
+    ${sbindir}/xend \
+    ${sbindir}/xenperf \
+    ${sbindir}/xenpm \
+    ${sbindir}/xsview \
+    ${sbindir}/xen-tmem-list-parse \
+    ${sbindir}/xen-python-path \
+    ${sbindir}/xen-ringwatch \
+    ${sbindir}/xen-hptool \
+    ${sbindir}/xen-hvmcrash \
+    ${sbindir}/xen-hvmctx \
+    ${sbindir}/xenlockprof \
+    ${sbindir}/xen-lowmemd \
+    "
+
+FILES_${PN}-pygrub = "\
+    ${bindir}/pygrub \
+    ${libdir}/xen/bin/pygrub \
+    "
+
+FILES_${PN}-python = "\
+    ${libdir}/python2.7 \
+    "
+
+INSANE_SKIP_${PN}-qemu = "arch"
+FILES_${PN}-qemu = " \
+    ${datadir}/xen/qemu \
+    ${libdir}/xen/bin/qemu-system-i386 \
+    ${libdir}/xen/bin/qemu-system-x86_64 \
+    ${libdir}/xen/bin/qemu-img \
+    ${libdir}/xen/bin/qemu-nbd \
+    ${libdir}/xen/bin/qemu-ga \
+    ${libdir}/xen/bin/qemu-io \
+    ${libdir}/xen/bin/qemu-dm \
+    ${libdir}/xen/bin/virtfs-proxy-helper \
+    /usr/libexec/qemu-bridge-helper \
+    /usr/etc/qemu \
+    /usr/etc/qemu/target-x86_64.conf \
+    ${datadir}/qemu-xen \
+    ${datadir}/qemu-xen/qemu \
+    ${datadir}/qemu-xen/qemu/bamboo.dtb \
+    ${datadir}/qemu-xen/qemu/pxe-pcnet.rom \
+    ${datadir}/qemu-xen/qemu/vgabios-vmware.bin \
+    ${datadir}/qemu-xen/qemu/pxe-eepro100.rom \
+    ${datadir}/qemu-xen/qemu/pxe-e1000.rom \
+    ${datadir}/qemu-xen/qemu/openbios-ppc \
+    ${datadir}/qemu-xen/qemu/multiboot.bin \
+    ${datadir}/qemu-xen/qemu/vgabios-cirrus.bin \
+    ${datadir}/qemu-xen/qemu/bios.bin \
+    ${datadir}/qemu-xen/qemu/vgabios-stdvga.bin \
+    ${datadir}/qemu-xen/qemu/palcode-clipper \
+    ${datadir}/qemu-xen/qemu/pxe-ne2k_pci.rom \
+    ${datadir}/qemu-xen/qemu/spapr-rtas.bin \
+    ${datadir}/qemu-xen/qemu/slof.bin \
+    ${datadir}/qemu-xen/qemu/vgabios-qxl.bin \
+    ${datadir}/qemu-xen/qemu/pxe-rtl8139.rom \
+    ${datadir}/qemu-xen/qemu/openbios-sparc64 \
+    ${datadir}/qemu-xen/qemu/pxe-virtio.rom \
+    ${datadir}/qemu-xen/qemu/kvmvapic.bin \
+    ${datadir}/qemu-xen/qemu/openbios-sparc32 \
+    ${datadir}/qemu-xen/qemu/petalogix-s3adsp1800.dtb \
+    ${datadir}/qemu-xen/qemu/sgabios.bin \
+    ${datadir}/qemu-xen/qemu/linuxboot.bin \
+    ${datadir}/qemu-xen/qemu/qemu-icon.bmp \
+    ${datadir}/qemu-xen/qemu/ppc_rom.bin \
+    ${datadir}/qemu-xen/qemu/vgabios.bin \
+    ${datadir}/qemu-xen/qemu/s390-zipl.rom \
+    ${datadir}/qemu-xen/qemu/petalogix-ml605.dtb \
+    ${datadir}/qemu-xen/qemu/keymaps \
+    ${datadir}/qemu-xen/qemu/keymaps/common \
+    ${datadir}/qemu-xen/qemu/keymaps/th \
+    ${datadir}/qemu-xen/qemu/keymaps/is \
+    ${datadir}/qemu-xen/qemu/keymaps/en-gb \
+    ${datadir}/qemu-xen/qemu/keymaps/ar \
+    ${datadir}/qemu-xen/qemu/keymaps/fr-be \
+    ${datadir}/qemu-xen/qemu/keymaps/ru \
+    ${datadir}/qemu-xen/qemu/keymaps/hu \
+    ${datadir}/qemu-xen/qemu/keymaps/de-ch \
+    ${datadir}/qemu-xen/qemu/keymaps/no \
+    ${datadir}/qemu-xen/qemu/keymaps/fr \
+    ${datadir}/qemu-xen/qemu/keymaps/pl \
+    ${datadir}/qemu-xen/qemu/keymaps/fr-ca \
+    ${datadir}/qemu-xen/qemu/keymaps/de \
+    ${datadir}/qemu-xen/qemu/keymaps/fr-ch \
+    ${datadir}/qemu-xen/qemu/keymaps/bepo \
+    ${datadir}/qemu-xen/qemu/keymaps/lv \
+    ${datadir}/qemu-xen/qemu/keymaps/ja \
+    ${datadir}/qemu-xen/qemu/keymaps/da \
+    ${datadir}/qemu-xen/qemu/keymaps/lt \
+    ${datadir}/qemu-xen/qemu/keymaps/hr \
+    ${datadir}/qemu-xen/qemu/keymaps/es \
+    ${datadir}/qemu-xen/qemu/keymaps/modifiers \
+    ${datadir}/qemu-xen/qemu/keymaps/sl \
+    ${datadir}/qemu-xen/qemu/keymaps/it \
+    ${datadir}/qemu-xen/qemu/keymaps/nl \
+    ${datadir}/qemu-xen/qemu/keymaps/fo \
+    ${datadir}/qemu-xen/qemu/keymaps/mk \
+    ${datadir}/qemu-xen/qemu/keymaps/pt-br \
+    ${datadir}/qemu-xen/qemu/keymaps/tr \
+    ${datadir}/qemu-xen/qemu/keymaps/sv \
+    ${datadir}/qemu-xen/qemu/keymaps/fi \
+    ${datadir}/qemu-xen/qemu/keymaps/en-us \
+    ${datadir}/qemu-xen/qemu/keymaps/et \
+    ${datadir}/qemu-xen/qemu/keymaps/nl-be \
+    ${datadir}/qemu-xen/qemu/keymaps/pt \
+    ${bindir}/qemu-nbd-xen \
+    ${bindir}/qemu-img-xen \
+    "
+
+FILES_${PN}-remus = "\
+    ${bindir}/remus \
+    "
+
+FILES_${PN}-scripts-network = " \
+    ${sysconfdir}/xen/scripts/network-bridge \
+    ${sysconfdir}/xen/scripts/network-nat \
+    ${sysconfdir}/xen/scripts/network-route \
+    ${sysconfdir}/xen/scripts/qemu-ifup \
+    ${sysconfdir}/xen/scripts/vif2 \
+    ${sysconfdir}/xen/scripts/vif-bridge \
+    ${sysconfdir}/xen/scripts/vif-common.sh \
+    ${sysconfdir}/xen/scripts/vif-nat \
+    ${sysconfdir}/xen/scripts/vif-openvswitch \
+    ${sysconfdir}/xen/scripts/vif-route \
+    ${sysconfdir}/xen/scripts/vif-setup \
+    "
+
+FILES_${PN}-scripts-block = " \
+    ${sysconfdir}/xen/scripts/blktap \
+    ${sysconfdir}/xen/scripts/block \
+    ${sysconfdir}/xen/scripts/block-common.sh \
+    ${sysconfdir}/xen/scripts/block-enbd \
+    ${sysconfdir}/xen/scripts/block-iscsi \
+    ${sysconfdir}/xen/scripts/block-nbd \
+    ${sysconfdir}/xen/scripts/vscsi \
+    "
+
+FILES_${PN}-scripts-common = " \
+    ${sysconfdir}/xen/scripts/external-device-migrate \
+    ${sysconfdir}/xen/scripts/hotplugpath.sh \
+    ${sysconfdir}/xen/scripts/locking.sh \
+    ${sysconfdir}/xen/scripts/logging.sh \
+    ${sysconfdir}/xen/scripts/xen-hotplug-cleanup \
+    ${sysconfdir}/xen/scripts/xen-hotplug-common.sh \
+    ${sysconfdir}/xen/scripts/xen-network-common.sh \
+    ${sysconfdir}/xen/scripts/xen-script-common.sh \
+    "
+
+FILES_${PN}-udev = "\
+    ${sysconfdir}/udev/rules.d/xen-backend.rules \
+    ${sysconfdir}/udev/rules.d/xend.rules \
+    "
+
+FILES_${PN}-xcutils = "\
+    ${libdir}/xen/bin/lsevtchn \
+    ${libdir}/xen/bin/readnotes \
+    ${libdir}/xen/bin/xc_restore \
+    ${libdir}/xen/bin/xc_save \
+    "
+
+FILES_${PN}-xend-examples = "\
+    ${sysconfdir}/xen/xend-config.sxp \
+    ${sysconfdir}/xen/xend-pci-permissive.sxp \
+    ${sysconfdir}/xen/xend-pci-quirks.sxp \
+    "
+
+FILES_${PN}-xenpaging = "\
+    ${libdir}/xen/bin/xenpaging \
+    ${localstatedir}/lib/xen/xenpaging \
+    "
+
+FILES_${PN}-xenpmd = "\
+    ${sbindir}/xenpmd \
+    "
+
+FILES_${PN}-xenstat = "\
+    ${sbindir}/xentop \
+    "
+
+FILES_${PN}-xenstore = "\
+    ${bindir}/xenstore \
+    ${bindir}/xenstore-chmod \
+    ${bindir}/xenstore-control \
+    ${bindir}/xenstore-exists \
+    ${bindir}/xenstore-list \
+    ${bindir}/xenstore-ls \
+    ${bindir}/xenstore-read \
+    ${bindir}/xenstore-rm \
+    ${bindir}/xenstore-watch \
+    ${bindir}/xenstore-write \
+    "
+
+FILES_${PN}-xenstored = "\
+    ${sbindir}/xenstored \
+    ${localstatedir}/lib/xenstored \
+    "
+
+FILES_${PN}-xentrace = "\
+    ${bindir}/xentrace \
+    ${bindir}/xentrace_format \
+    ${bindir}/xentrace_setsize \
+    ${libdir}/xen/bin/xenctx \
+    "
+
+FILES_${PN}-xen-watchdog = "\
+    ${sbindir}/xenwatchdogd \
+    "
+
+FILES_${PN}-xl = "\
+    ${sysconfdir}/bash_completion.d/xl.sh \
+    ${sysconfdir}/xen/xl.conf \
+    ${libdir}/xen/bin/libxl-save-helper \
+    ${sbindir}/xl \
+    "
+
+FILES_${PN}-xl-examples = "\
+    ${sysconfdir}/xen/xlexample.hvm \
+    ${sysconfdir}/xen/xlexample.pvlinux \
+    "
+
+FILES_${PN}-xm-examples = "\
+    ${sysconfdir}/xen/xmexample1 \
+    ${sysconfdir}/xen/xmexample2 \
+    ${sysconfdir}/xen/xmexample3 \
+    ${sysconfdir}/xen/xmexample.hvm \
+    ${sysconfdir}/xen/xmexample.hvm-stubdom \
+    ${sysconfdir}/xen/xmexample.nbd \
+    ${sysconfdir}/xen/xmexample.pv-grub \
+    ${sysconfdir}/xen/xmexample.vti \
+    "
+
+FILES_${PN}-xenmon = "\
+    ${sbindir}/xenbaked \
+    ${sbindir}/xentrace_setmask \
+    ${sbindir}/xenmon.py \
+    "
+
+FILES_${PN}-xm = "\
+    ${sysconfdir}/xen/xm-config.xml \
+    ${datadir}/xen/create.dtd \
+    ${sbindir}/xm \
+    "
+
+FILES_${PN}-xencommons += "${sysconfdir}/init.d/xencommons"
+FILES_${PN}-xend += "${sysconfdir}/init.d/xend"
+FILES_${PN}-xendomains += "${sysconfdir}/init.d/xendomains"
+FILES_${PN}-xen-watchdog += "${sysconfdir}/init.d/xen-watchdog"
+
+# configure init.d scripts
+INITSCRIPT_PACKAGES = "${PN}-xend ${PN}-xencommons ${PN}-xen-watchdog ${PN}-xendomains"
+INITSCRIPT_NAME_${PN}-xencommons = "xencommons"
+INITSCRIPT_PARAMS_${PN}-xencommons = "defaults 80"
+INITSCRIPT_NAME_${PN}-xen-watchdog = "xen-watchdog"
+INITSCRIPT_PARAMS_${PN}-xen-watchdog = "defaults 81"
+INITSCRIPT_NAME_${PN}-xend = "xend"
+INITSCRIPT_PARAMS_${PN}-xend = "defaults 82"
+INITSCRIPT_NAME_${PN}-xendomains = "xendomains"
+INITSCRIPT_PARAMS_${PN}-xendomains = "defaults 83"
+
+#### REQUIRED ENVIRONMENT VARIABLES ####
+export BUILD_SYS
+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"
+
+# this is used for the header (#!${bindir}/python) of the install python scripts
+export PYTHONPATH="${bindir}/python"
+
+# seabios forcefully sets HOSTCC to CC - fixup to allow it to build native conf executable
+export HOSTCC="${BUILD_CC}"
+
+# make xen requires CROSS_COMPILE set by hand as it does not abide by ./configure
+export CROSS_COMPILE="${TARGET_PREFIX}"
+
+# overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'"
+export LDFLAGS=""
+
+do_configure() {
+    # fixup qemu-xen-traditional pciutils check hardcoded to test ${includedir}/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
+
+    # 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
+    fi
+
+    # do configure
+    ./configure --exec-prefix=/usr --prefix=/usr --host=${HOST_SYS} --disable-stubdom --disable-ioemu-stubdom --disable-pv-grub --disable-xenstore-stubdom
+
+    # 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() {
+    oe_runmake
+}
+
+do_install() {
+    oe_runmake DESTDIR="${D}" install
+
+    # remove installed volatiles
+    rm -rf ${D}${localstatedir}/run ${D}${localstatedir}/lock ${D}${localstatedir}/log ${D}${localstatedir}/volatile
+
+    # 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
+
+    # workaround for xendomains script which searchs sysconfig if directory exists
+    install -d ${D}${sysconfdir}/sysconfig
+    ln -sf ${sysconfdir}/default/xendomains ${D}${sysconfdir}/sysconfig/xendomains
+}
+
+pkg_postinst_${PN}-base() {
+    if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
+        ${sysconfdir}/init.d/populate-volatile.sh update
+    fi
+}
+
+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
+}
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack.
  2013-08-30  3:37 [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Chris Patterson
                   ` (2 preceding siblings ...)
  2013-08-30  3:37 ` [PATCH 3/4] xen: add 4.3.0 recipe Chris Patterson
@ 2013-08-30  3:37 ` Chris Patterson
  2013-08-30  5:36   ` Bruce Ashfield
  2013-08-30  5:39 ` [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Bruce Ashfield
  4 siblings, 1 reply; 18+ messages in thread
From: Chris Patterson @ 2013-08-30  3:37 UTC (permalink / raw)
  To: meta-virtualization

xen-image-initramfs: newly added initrd to support testing xen-image-minimal and init script based on init-live.sh.
---
 recipes-extended/images/xen-image-initramfs.bb     |   17 ++
 recipes-extended/images/xen-image-minimal.bb       |   55 +++++-
 .../initrdscripts/files/init-boot-xen.sh           |  205 ++++++++++++++++++++
 .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 ++
 4 files changed, 286 insertions(+), 7 deletions(-)
 create mode 100644 recipes-extended/images/xen-image-initramfs.bb
 create mode 100644 recipes-extended/initrdscripts/files/init-boot-xen.sh
 create mode 100644 recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb

diff --git a/recipes-extended/images/xen-image-initramfs.bb b/recipes-extended/images/xen-image-initramfs.bb
new file mode 100644
index 0000000..d2f1301
--- /dev/null
+++ b/recipes-extended/images/xen-image-initramfs.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Xen image initramfs"
+
+IMAGE_INSTALL = "initramfs-boot-xen busybox udev udev-extraconf base-passwd coreutils"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "xen-image-initramfs"
+
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
index 0cf55d6..c941339 100644
--- a/recipes-extended/images/xen-image-minimal.bb
+++ b/recipes-extended/images/xen-image-minimal.bb
@@ -1,14 +1,55 @@
-DESCRIPTION = "A minimal xen image"
-IMAGE_INSTALL = "packagegroup-core-boot xen-minimal dropbear mdadm"
+DESCRIPTION = "Image with Xen."
+
+INITRD_IMAGE ?= "xen-image-initramfs"
+
+IMAGE_INSTALL += " \
+    ${CORE_IMAGE_BASE_INSTALL} \
+    packagegroup-core-basic \
+    packagegroup-core-ssh-openssh \
+    kernel-module-xen-acpi-processor \
+    kernel-module-xen-blkback \
+    kernel-module-xen-blkfront \
+    kernel-module-xen-evtchn \
+    kernel-module-xenfs \
+    kernel-module-xen-gntalloc \
+    kernel-module-xen-gntdev \
+    kernel-module-xen-netback \
+    kernel-module-xen-netfront \
+    kernel-module-xen-pcifront \
+    kernel-module-xen-privcmd \
+    kernel-module-xen-wdt \
+    xen-base \
+    xen-qemu \
+    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+    "
 
-IMAGE_LINGUAS = " "
 LICENSE = "MIT"
 
 inherit core-image
 
-IMAGE_ROOTFS_SIZE = "8192"
+syslinux_iso_populate_append() {
+	install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${ISODIR}${ISOLINUXDIR}
+}
+
+syslinux_hddimg_populate_append() {
+	install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR}
+}
+
+grubefi_populate_append() {
+	install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz
+}
+
+populate_append() {
+	install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz
+}
 
-# remove not needed ipkg informations
-ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
+build_syslinux_cfg () {
+	echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
+	echo "DEFAULT boot" >> ${SYSLINUXCFG}
+	echo "TIMEOUT 10" >> ${SYSLINUXCFG}
+	echo "PROMPT 1" >> ${SYSLINUXCFG}
+	echo "LABEL boot" >> ${SYSLINUXCFG}
+	echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
+	echo "  APPEND /xen.gz loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 --- /initrd" >> ${SYSLINUXCFG}
+}
 
-require xen-bootimg.inc
diff --git a/recipes-extended/initrdscripts/files/init-boot-xen.sh b/recipes-extended/initrdscripts/files/init-boot-xen.sh
new file mode 100644
index 0000000..741f201
--- /dev/null
+++ b/recipes-extended/initrdscripts/files/init-boot-xen.sh
@@ -0,0 +1,205 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+ROOT_MOUNT="/rootfs/"
+ROOT_IMAGE="rootfs.img"
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+ISOLINUX=""
+
+# Copied from initramfs-framework. The core of this script probably should be
+# turned into initramfs-framework modules to reduce duplication.
+udev_daemon() {
+	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
+
+	for o in $OPTIONS; do
+		if [ -x "$o" ]; then
+			echo $o
+			return 0
+		fi
+	done
+
+	return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+early_setup() {
+    mkdir -p /proc
+    mkdir -p /sys
+    mount -t proc proc /proc
+    mount -t sysfs sysfs /sys
+    mount -t devtmpfs none /dev
+
+    # support modular kernel
+    modprobe isofs 2> /dev/null
+
+    mkdir -p /run
+    mkdir -p /var/run
+    mkdir -p /media
+
+    $_UDEV_DAEMON --daemon
+    udevadm trigger --action=add
+}
+
+read_args() {
+    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
+    for arg in $CMDLINE; do
+        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+        case $arg in
+            root=*)
+                ROOT_DEVICE=$optarg ;;
+            rootfstype=*)
+                modprobe $optarg 2> /dev/null ;;
+            LABEL=*)
+                label=$optarg ;;
+            video=*)
+                video_mode=$arg ;;
+            vga=*)
+                vga_mode=$arg ;;
+            console=*)
+                if [ -z "${console_params}" ]; then
+                    console_params=$arg
+                else
+                    console_params="$console_params $arg"
+                fi ;;
+            debugshell*)
+                if [ -z "$optarg" ]; then
+                        shelltimeout=30
+                else
+                        shelltimeout=$optarg
+                fi
+        esac
+    done
+}
+
+boot_live_root() {
+    # Watches the udev event queue, and exits if all current events are handled
+    udevadm settle --timeout=3 --quiet
+    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
+
+    # Move the mount points of some filesystems over to
+    # the corresponding directories under the real root filesystem.
+    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
+        mkdir -p  ${ROOT_MOUNT}/$dir
+        mount -n --move $dir ${ROOT_MOUNT}/$dir
+    done
+    mount -n --move /proc ${ROOT_MOUNT}/proc
+    mount -n --move /sys ${ROOT_MOUNT}/sys
+    mount -n --move /dev ${ROOT_MOUNT}/dev
+
+    cd $ROOT_MOUNT
+    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
+}
+
+fatal() {
+    echo $1 >$CONSOLE
+    echo >$CONSOLE
+    exec sh
+}
+
+early_setup
+
+[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
+
+read_args
+
+echo "Waiting for removable media..."
+C=0
+shelltimeout=5
+while true
+do
+  udevadm trigger
+  udevadm settle
+  for i in `ls /media 2>/dev/null`; do
+      if [ -f /media/$i/$ROOT_IMAGE ] ; then
+		found="yes"
+		break
+	  elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
+		found="yes"
+		ISOLINUX="isolinux"
+		break
+      fi
+  done
+  if [ "$found" = "yes" ]; then
+      break;
+  fi
+  # don't wait for more than $shelltimeout seconds, if it's set
+  if [ -n "$shelltimeout" ]; then
+      echo -n " " $(( $shelltimeout - $C ))
+      if [ $C -ge $shelltimeout ]; then
+           echo "..."
+	   echo "Mounted filesystems"
+           mount | grep media
+           echo "Available block devices"
+           ls /dev/sd*
+           fatal "Cannot find rootfs.img file in /media/* , dropping to a shell "
+      fi
+      C=$(( C + 1 ))
+  fi
+  sleep 1
+done
+
+# Try to make a union mount of the root image.
+# If no unification filesystem is available, mount the image read-only.
+mount_and_boot() {
+    mkdir $ROOT_MOUNT
+
+    mknod /dev/loop0 b 7 0 2>/dev/null
+
+    # determine which unification filesystem to use
+    union_fs_type=""
+    if grep -q -w "overlayfs" /proc/filesystems; then
+	union_fs_type="overlayfs"
+    elif grep -q -w "aufs" /proc/filesystems; then
+	union_fs_type="aufs"
+    else
+	union_fs_type=""
+    fi
+    # make a union mount if possible
+    case $union_fs_type in
+	"overlayfs")
+	    mkdir -p /rootfs.ro /rootfs.rw
+	    if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
+		rm -rf /rootfs.ro /rootfs.rw
+		fatal "Could not mount rootfs image"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+		mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT
+		mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+		mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+		mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+	    fi
+	    ;;
+	"aufs")
+	    mkdir -p /rootfs.ro /rootfs.rw
+	    if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
+		rm -rf /rootfs.ro /rootfs.rw
+		fatal "Could not mount rootfs image"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+		mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT
+		mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+		mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+		mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+	    fi
+	    ;;
+	"")
+	    if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+		fatal "Could not mount rootfs image"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
+	    fi
+	    ;;
+    esac
+
+    # boot the image
+    boot_live_root
+}
+
+mount_and_boot
+
+# If we're getting here, we failed...
+fatal "Installation image failed"
+
diff --git a/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
new file mode 100644
index 0000000..9380e83
--- /dev/null
+++ b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "A live image init script with support for Xen"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-boot-xen.sh"
+PR = "r0"
+
+inherit allarch
+
+RDEPENDS_${PN} = "udev udev-extraconf"
+
+FILES_${PN} += " /init "
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-boot-xen.sh ${D}/init
+}
+
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-08-30  3:37 ` [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support Chris Patterson
@ 2013-08-30  5:32   ` Bruce Ashfield
  2013-09-01  2:12     ` Chris Patterson
  2013-09-09  2:23     ` Chris Patterson
  0 siblings, 2 replies; 18+ messages in thread
From: Bruce Ashfield @ 2013-08-30  5:32 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com> wrote:
> ---
>  recipes-kernel/linux/linux-yocto/xen.cfg |   53 ++++++++++++++++++++++++++++++
>  recipes-kernel/linux/linux-yocto/xen.scc |    4 +++
>  2 files changed, 57 insertions(+)
>  create mode 100644 recipes-kernel/linux/linux-yocto/xen.cfg
>  create mode 100644 recipes-kernel/linux/linux-yocto/xen.scc
>
> diff --git a/recipes-kernel/linux/linux-yocto/xen.cfg b/recipes-kernel/linux/linux-yocto/xen.cfg
> new file mode 100644
> index 0000000..f9cfb6a
> --- /dev/null
> +++ b/recipes-kernel/linux/linux-yocto/xen.cfg

Nice. The fragment looks good. I'd actually like to bump this up to the level of
in-tree support that we have for KVM.

And by that, I mean that I can merge this to the meta branch of the linux-yocto
kernel (and also found in the tracking yocto-kernel-cache repository).

Once there, it can be built and tested standalone, as well as shared by other
feature fragments. You'd then be able to just enable it via a KERNEL_FEATURES
entry, just like KVM.

Cheers,

Bruce

> @@ -0,0 +1,53 @@
> +..........................................................................
> +.                                WARNING
> +.
> +. This file is a kernel configuration fragment, and not a full kernel
> +. configuration file.  The final kernel configuration is made up of
> +. an assembly of processed fragments, each of which is designed to
> +. capture a specific part of the final configuration (e.g. platform
> +. configuration, feature configuration, and board specific hardware
> +. configuration).  For more information on kernel configuration, please
> +. consult the product documentation.
> +.
> +..........................................................................
> +
> +CONFIG_PARAVIRT_GUEST=y
> +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
> +CONFIG_XEN=y
> +CONFIG_XEN_DOM0=y
> +CONFIG_XEN_PRIVILEGED_GUEST=y
> +CONFIG_XEN_PVHVM=y
> +CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> +CONFIG_XEN_SAVE_RESTORE=y
> +# CONFIG_XEN_DEBUG_FS is not set
> +CONFIG_PARAVIRT=y
> +# CONFIG_PARAVIRT_SPINLOCKS is not set
> +CONFIG_PARAVIRT_CLOCK=y
> +# CONFIG_PARAVIRT_DEBUG is not set
> +CONFIG_PCI_XEN=y
> +CONFIG_XEN_PCIDEV_FRONTEND=m
> +CONFIG_XEN_BLKDEV_FRONTEND=m
> +CONFIG_XEN_BLKDEV_BACKEND=m
> +CONFIG_XEN_NETDEV_FRONTEND=m
> +CONFIG_XEN_NETDEV_BACKEND=m
> +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
> +CONFIG_HVC_XEN=y
> +CONFIG_HVC_XEN_FRONTEND=y
> +CONFIG_XEN_WDT=m
> +CONFIG_XEN_FBDEV_FRONTEND=y
> +# Xen driver support
> +CONFIG_XEN_BALLOON=y
> +CONFIG_XEN_SCRUB_PAGES=y
> +CONFIG_XEN_DEV_EVTCHN=m
> +CONFIG_XEN_BACKEND=y
> +CONFIG_XENFS=m
> +CONFIG_XEN_COMPAT_XENFS=y
> +CONFIG_XEN_SYS_HYPERVISOR=y
> +CONFIG_XEN_XENBUS_FRONTEND=y
> +CONFIG_XEN_GNTDEV=m
> +CONFIG_XEN_GRANT_DEV_ALLOC=m
> +CONFIG_SWIOTLB_XEN=y
> +CONFIG_XEN_PCIDEV_BACKEND=y
> +CONFIG_XEN_PRIVCMD=m
> +CONFIG_XEN_ACPI_PROCESSOR=m
> +CONFIG_PCI_STUB=y
> diff --git a/recipes-kernel/linux/linux-yocto/xen.scc b/recipes-kernel/linux/linux-yocto/xen.scc
> new file mode 100644
> index 0000000..6c68bda
> --- /dev/null
> +++ b/recipes-kernel/linux/linux-yocto/xen.scc
> @@ -0,0 +1,4 @@
> +define KFEATURE_DESCRIPTION "Xen Dom0 Support"
> +define KFEATURE_COMPATIBILITY board
> +
> +kconf non-hardware xen.cfg
> --
> 1.7.10.4
>
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/4] linux-yocto: add optional support for aufs and xen using DISTRO_FEATURES.
  2013-08-30  3:37 ` [PATCH 2/4] linux-yocto: add optional support for aufs and xen using DISTRO_FEATURES Chris Patterson
@ 2013-08-30  5:34   ` Bruce Ashfield
  0 siblings, 0 replies; 18+ messages in thread
From: Bruce Ashfield @ 2013-08-30  5:34 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com> wrote:
> ---
>  recipes-kernel/linux/linux-yocto_3.4.bbappend |    6 ++++++
>  recipes-kernel/linux/linux-yocto_3.8.bbappend |    6 ++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/recipes-kernel/linux/linux-yocto_3.4.bbappend b/recipes-kernel/linux/linux-yocto_3.4.bbappend
> index 2893a01..2ada931 100644
> --- a/recipes-kernel/linux/linux-yocto_3.4.bbappend
> +++ b/recipes-kernel/linux/linux-yocto_3.4.bbappend
> @@ -11,3 +11,9 @@ KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
>  module_autoload_kvm = "kvm"
>  module_autoload_kvm-amd = "kvm-amd"
>  module_autoload_kvm-intel = "kvm-intel"
> +
> +# aufs kernel support required for core-image-xen
> +KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
> +
> +# xen dom0 kernel support
> +SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"

Also nice. I like the change. With my previous comment about pulling
the xen fragment into
the kernel itself, you'd be able to make these two lines consistent.

Moving up the chain to new kernels is simple after that, since I'll
pull it forward as I uprev
support. (in fact, we can also add a new 3.10 fragment along with
these changes now :)

Cheers,

Bruce

> diff --git a/recipes-kernel/linux/linux-yocto_3.8.bbappend b/recipes-kernel/linux/linux-yocto_3.8.bbappend
> index 2893a01..2ada931 100644
> --- a/recipes-kernel/linux/linux-yocto_3.8.bbappend
> +++ b/recipes-kernel/linux/linux-yocto_3.8.bbappend
> @@ -11,3 +11,9 @@ KERNEL_FEATURES_append = " features/kvm/qemu-kvm-enable.scc"
>  module_autoload_kvm = "kvm"
>  module_autoload_kvm-amd = "kvm-amd"
>  module_autoload_kvm-intel = "kvm-intel"
> +
> +# aufs kernel support required for core-image-xen
> +KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' features/aufs/aufs-enable.scc', '', d)}"
> +
> +# xen dom0 kernel support
> +SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
> --
> 1.7.10.4
>
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack.
  2013-08-30  3:37 ` [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack Chris Patterson
@ 2013-08-30  5:36   ` Bruce Ashfield
  2013-09-01  4:41     ` Chris Patterson
  0 siblings, 1 reply; 18+ messages in thread
From: Bruce Ashfield @ 2013-08-30  5:36 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com> wrote:
> xen-image-initramfs: newly added initrd to support testing xen-image-minimal and init script based on init-live.sh.
> ---
>  recipes-extended/images/xen-image-initramfs.bb     |   17 ++
>  recipes-extended/images/xen-image-minimal.bb       |   55 +++++-
>  .../initrdscripts/files/init-boot-xen.sh           |  205 ++++++++++++++++++++
>  .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 ++
>  4 files changed, 286 insertions(+), 7 deletions(-)
>  create mode 100644 recipes-extended/images/xen-image-initramfs.bb
>  create mode 100644 recipes-extended/initrdscripts/files/init-boot-xen.sh
>  create mode 100644 recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>
> diff --git a/recipes-extended/images/xen-image-initramfs.bb b/recipes-extended/images/xen-image-initramfs.bb
> new file mode 100644
> index 0000000..d2f1301
> --- /dev/null
> +++ b/recipes-extended/images/xen-image-initramfs.bb
> @@ -0,0 +1,17 @@
> +DESCRIPTION = "Xen image initramfs"
> +
> +IMAGE_INSTALL = "initramfs-boot-xen busybox udev udev-extraconf base-passwd coreutils"
> +
> +# Do not pollute the initrd image with rootfs features
> +IMAGE_FEATURES = ""
> +
> +export IMAGE_BASENAME = "xen-image-initramfs"
> +
> +IMAGE_LINGUAS = ""
> +
> +LICENSE = "MIT"
> +
> +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
> +inherit core-image
> +
> +IMAGE_ROOTFS_SIZE = "8192"
> diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
> index 0cf55d6..c941339 100644
> --- a/recipes-extended/images/xen-image-minimal.bb
> +++ b/recipes-extended/images/xen-image-minimal.bb
> @@ -1,14 +1,55 @@
> -DESCRIPTION = "A minimal xen image"
> -IMAGE_INSTALL = "packagegroup-core-boot xen-minimal dropbear mdadm"
> +DESCRIPTION = "Image with Xen."
> +
> +INITRD_IMAGE ?= "xen-image-initramfs"
> +
> +IMAGE_INSTALL += " \
> +    ${CORE_IMAGE_BASE_INSTALL} \
> +    packagegroup-core-basic \
> +    packagegroup-core-ssh-openssh \
> +    kernel-module-xen-acpi-processor \
> +    kernel-module-xen-blkback \
> +    kernel-module-xen-blkfront \
> +    kernel-module-xen-evtchn \
> +    kernel-module-xenfs \
> +    kernel-module-xen-gntalloc \
> +    kernel-module-xen-gntdev \
> +    kernel-module-xen-netback \
> +    kernel-module-xen-netfront \
> +    kernel-module-xen-pcifront \
> +    kernel-module-xen-privcmd \
> +    kernel-module-xen-wdt \
> +    xen-base \
> +    xen-qemu \
> +    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
> +    "
>
> -IMAGE_LINGUAS = " "
>  LICENSE = "MIT"
>
>  inherit core-image
>
> -IMAGE_ROOTFS_SIZE = "8192"
> +syslinux_iso_populate_append() {
> +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${ISODIR}${ISOLINUXDIR}
> +}
> +
> +syslinux_hddimg_populate_append() {
> +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR}
> +}
> +
> +grubefi_populate_append() {
> +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz
> +}
> +
> +populate_append() {
> +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz
> +}
>
> -# remove not needed ipkg informations
> -ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
> +build_syslinux_cfg () {
> +       echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
> +       echo "DEFAULT boot" >> ${SYSLINUXCFG}
> +       echo "TIMEOUT 10" >> ${SYSLINUXCFG}
> +       echo "PROMPT 1" >> ${SYSLINUXCFG}
> +       echo "LABEL boot" >> ${SYSLINUXCFG}
> +       echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
> +       echo "  APPEND /xen.gz loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 --- /initrd" >> ${SYSLINUXCFG}
> +}
>
> -require xen-bootimg.inc
> diff --git a/recipes-extended/initrdscripts/files/init-boot-xen.sh b/recipes-extended/initrdscripts/files/init-boot-xen.sh
> new file mode 100644
> index 0000000..741f201
> --- /dev/null
> +++ b/recipes-extended/initrdscripts/files/init-boot-xen.sh
> @@ -0,0 +1,205 @@
> +#!/bin/sh
> +
> +PATH=/sbin:/bin:/usr/sbin:/usr/bin
> +
> +ROOT_MOUNT="/rootfs/"
> +ROOT_IMAGE="rootfs.img"
> +MOUNT="/bin/mount"
> +UMOUNT="/bin/umount"
> +ISOLINUX=""
> +
> +# Copied from initramfs-framework. The core of this script probably should be
> +# turned into initramfs-framework modules to reduce duplication.
> +udev_daemon() {
> +       OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
> +
> +       for o in $OPTIONS; do
> +               if [ -x "$o" ]; then
> +                       echo $o
> +                       return 0
> +               fi
> +       done
> +
> +       return 1
> +}
> +
> +_UDEV_DAEMON=`udev_daemon`
> +
> +early_setup() {
> +    mkdir -p /proc
> +    mkdir -p /sys
> +    mount -t proc proc /proc
> +    mount -t sysfs sysfs /sys
> +    mount -t devtmpfs none /dev
> +
> +    # support modular kernel
> +    modprobe isofs 2> /dev/null
> +
> +    mkdir -p /run
> +    mkdir -p /var/run
> +    mkdir -p /media
> +
> +    $_UDEV_DAEMON --daemon
> +    udevadm trigger --action=add
> +}
> +
> +read_args() {
> +    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
> +    for arg in $CMDLINE; do
> +        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
> +        case $arg in
> +            root=*)
> +                ROOT_DEVICE=$optarg ;;
> +            rootfstype=*)
> +                modprobe $optarg 2> /dev/null ;;
> +            LABEL=*)
> +                label=$optarg ;;
> +            video=*)
> +                video_mode=$arg ;;
> +            vga=*)
> +                vga_mode=$arg ;;
> +            console=*)
> +                if [ -z "${console_params}" ]; then
> +                    console_params=$arg
> +                else
> +                    console_params="$console_params $arg"
> +                fi ;;
> +            debugshell*)
> +                if [ -z "$optarg" ]; then
> +                        shelltimeout=30
> +                else
> +                        shelltimeout=$optarg
> +                fi
> +        esac
> +    done
> +}
> +
> +boot_live_root() {
> +    # Watches the udev event queue, and exits if all current events are handled
> +    udevadm settle --timeout=3 --quiet
> +    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
> +
> +    # Move the mount points of some filesystems over to
> +    # the corresponding directories under the real root filesystem.
> +    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
> +        mkdir -p  ${ROOT_MOUNT}/$dir
> +        mount -n --move $dir ${ROOT_MOUNT}/$dir
> +    done
> +    mount -n --move /proc ${ROOT_MOUNT}/proc
> +    mount -n --move /sys ${ROOT_MOUNT}/sys
> +    mount -n --move /dev ${ROOT_MOUNT}/dev
> +
> +    cd $ROOT_MOUNT
> +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
> +}
> +
> +fatal() {
> +    echo $1 >$CONSOLE
> +    echo >$CONSOLE
> +    exec sh
> +}
> +
> +early_setup
> +
> +[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
> +
> +read_args
> +
> +echo "Waiting for removable media..."
> +C=0
> +shelltimeout=5
> +while true
> +do
> +  udevadm trigger
> +  udevadm settle
> +  for i in `ls /media 2>/dev/null`; do
> +      if [ -f /media/$i/$ROOT_IMAGE ] ; then
> +               found="yes"
> +               break
> +         elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
> +               found="yes"
> +               ISOLINUX="isolinux"
> +               break
> +      fi
> +  done
> +  if [ "$found" = "yes" ]; then
> +      break;
> +  fi
> +  # don't wait for more than $shelltimeout seconds, if it's set
> +  if [ -n "$shelltimeout" ]; then
> +      echo -n " " $(( $shelltimeout - $C ))
> +      if [ $C -ge $shelltimeout ]; then
> +           echo "..."
> +          echo "Mounted filesystems"
> +           mount | grep media
> +           echo "Available block devices"
> +           ls /dev/sd*
> +           fatal "Cannot find rootfs.img file in /media/* , dropping to a shell "
> +      fi
> +      C=$(( C + 1 ))
> +  fi
> +  sleep 1
> +done
> +
> +# Try to make a union mount of the root image.
> +# If no unification filesystem is available, mount the image read-only.
> +mount_and_boot() {
> +    mkdir $ROOT_MOUNT
> +
> +    mknod /dev/loop0 b 7 0 2>/dev/null
> +
> +    # determine which unification filesystem to use
> +    union_fs_type=""
> +    if grep -q -w "overlayfs" /proc/filesystems; then
> +       union_fs_type="overlayfs"
> +    elif grep -q -w "aufs" /proc/filesystems; then
> +       union_fs_type="aufs"
> +    else
> +       union_fs_type=""
> +    fi
> +    # make a union mount if possible
> +    case $union_fs_type in
> +       "overlayfs")
> +           mkdir -p /rootfs.ro /rootfs.rw
> +           if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
> +               rm -rf /rootfs.ro /rootfs.rw
> +               fatal "Could not mount rootfs image"
> +           else
> +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
> +               mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT
> +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
> +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
> +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
> +           fi
> +           ;;
> +       "aufs")
> +           mkdir -p /rootfs.ro /rootfs.rw
> +           if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
> +               rm -rf /rootfs.ro /rootfs.rw
> +               fatal "Could not mount rootfs image"
> +           else
> +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
> +               mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT
> +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
> +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
> +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
> +           fi
> +           ;;
> +       "")
> +           if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
> +               fatal "Could not mount rootfs image"
> +           else
> +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
> +           fi
> +           ;;
> +    esac
> +
> +    # boot the image
> +    boot_live_root
> +}
> +
> +mount_and_boot
> +
> +# If we're getting here, we failed...
> +fatal "Installation image failed"
> +
> diff --git a/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
> new file mode 100644
> index 0000000..9380e83
> --- /dev/null
> +++ b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
> @@ -0,0 +1,16 @@
> +DESCRIPTION = "A live image init script with support for Xen"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> +SRC_URI = "file://init-boot-xen.sh"
> +PR = "r0"
> +
> +inherit allarch
> +
> +RDEPENDS_${PN} = "udev udev-extraconf"
> +
> +FILES_${PN} += " /init "

I was going to ask if you are seeing any QA warnings with this, since
in the past we've had
to use update alternatives and priority to ensure that the right init
was used in an image .. but
then I noticed this is only pulled into the minimal config and there
shouldn't be any conflicting
init providers!

Bruce

> +
> +do_install() {
> +        install -m 0755 ${WORKDIR}/init-boot-xen.sh ${D}/init
> +}
> +
> --
> 1.7.10.4
>
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal
  2013-08-30  3:37 [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Chris Patterson
                   ` (3 preceding siblings ...)
  2013-08-30  3:37 ` [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack Chris Patterson
@ 2013-08-30  5:39 ` Bruce Ashfield
  4 siblings, 0 replies; 18+ messages in thread
From: Bruce Ashfield @ 2013-08-30  5:39 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com> wrote:
> This set of patches should provide a user with the ability to generate a xen 4.3.0 based dom0 image.
>
> [NOTES]
>
> With these patches, xen-image-minimal requires "xen" and "aufs" to be present in DISTRO_FEATURES to function correctly.
>
> [DISTRO TESTING]
>
> This image has been tested using:
>
> machine=sugarbay
> DISTRO_FEATURES += " aufs xen"
>
> [BUILDING IMAGE]
>
> bitbake xen-image-minimal
>
> [QEMU BUILD TESTING]
>
> To start up and test core-image-xen using kvm on hardware supporting nested virtualization:
>
> kvm -hda deploy/images/xen-image-minimal-sugarbay.hddimg -cpu host -no-kvm-irqchip -m 4096 -net nic,model=e1000 -net user -serial stdio
>
> ..or..
>
> kvm -hdc deploy/images/xen-image-minimal-sugarbay.iso -cpu host -no-kvm-irqchip -m 4096 -net nic,model=e1000 -net user -serial stdio
>
> [XEN TESTING]
>
> To test the runtime core-image-xen and boot a debian PV virtual machine:
>
> # bring up networking
> ifconfig eth0 up
> brctl addbr br0
> brctl addif br0 eth0
> udhcpc -i br0
>
> # place test debian vm in /test/debian
> mkdir -p /test/debian
> cd /test/debian
>
> # pull example kernel, initrd
> wget http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/xen/initrd.gz
> wget http://ftp.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/xen/vmlinuz
>
> # create 4G disk
> truncate -s 4096M disk.img
>
> cat > debian.cfg << EOF
> kernel = "/test/debian/vmlinuz"
> ramdisk = "/test/debian/initrd.gz"
> extra = "debian-installer/exit/always_halt=true -- console=hvc0"
> vif = ['bridge=br0']
> memory = "256"
> name = "debian"
> disk = ['file:/test/debian/disk.img,xvda,w']
> EOF
>
> xl -v create -d debian.cfg
>

Great steps and documentation. I'll take them for a spin myself and
see if I can get
a working system :)

Bruce

> xl console debian
>
> Chris Patterson (4):
>   linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
>   linux-yocto: add optional support for aufs and xen using
>     DISTRO_FEATURES.
>   xen: add 4.3.0 recipe.
>   xen-image-minimal: update image to support xen 4.3.0 base with xl
>     toolstack.
>
>  recipes-extended/images/xen-image-initramfs.bb     |   17 +
>  recipes-extended/images/xen-image-minimal.bb       |   55 +-
>  .../initrdscripts/files/init-boot-xen.sh           |  205 +++++++
>  .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 +
>  recipes-extended/xen/xen_4.3.0.bb                  |  623 ++++++++++++++++++++
>  recipes-kernel/linux/linux-yocto/xen.cfg           |   53 ++
>  recipes-kernel/linux/linux-yocto/xen.scc           |    4 +
>  recipes-kernel/linux/linux-yocto_3.4.bbappend      |    6 +
>  recipes-kernel/linux/linux-yocto_3.8.bbappend      |    6 +
>  9 files changed, 978 insertions(+), 7 deletions(-)
>  create mode 100644 recipes-extended/images/xen-image-initramfs.bb
>  create mode 100644 recipes-extended/initrdscripts/files/init-boot-xen.sh
>  create mode 100644 recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>  create mode 100644 recipes-extended/xen/xen_4.3.0.bb
>  create mode 100644 recipes-kernel/linux/linux-yocto/xen.cfg
>  create mode 100644 recipes-kernel/linux/linux-yocto/xen.scc
>
> --
> 1.7.10.4
>
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-08-30  5:32   ` Bruce Ashfield
@ 2013-09-01  2:12     ` Chris Patterson
  2013-09-01  4:01       ` Bruce Ashfield
  2013-09-09  2:23     ` Chris Patterson
  1 sibling, 1 reply; 18+ messages in thread
From: Chris Patterson @ 2013-09-01  2:12 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 1935 bytes --]

That'd be great.  There are a couple areas that could perhaps use some
work, as the fragment is a little excessive in some of the options and/or
could be broken up a little better, if desired.  On this topic, I have a
couple questions that would help steer me in the right direction in the
future:

1) One thing that's not immediately clear for me is the question of how to
best handle a case where a CONFIG_XXX option may in one instance, be
desirable to be built in - vs being a module in another?  Doing a quick
test seems to imply the first defined instance is the one used, but I'm not
sure if there are any well defined rules for conflict resolution.  The
reason I'm asking is there are CONFIG_XXX=y instances in this config - some
of which need to be built in, some required, and some just *preferably*
built in for various use cases. Specifically CONFIG_XEN_PCIDEV_BACKEND=y
provides some useful functionality before a module could otherwise be
loaded (prevent a pci device from being owned by a linux driver).

2) The other thing I am curious about is how to negotiate the inclusion of
a KERNEL_FEATURES which has a number of built-in bits.  The approach used
by kvm is to effectively always enable the fragment if one is including
meta-virtualization.  This in and of itself isn't really polluting the
target image for those that don't want KVM, because they likely simply
don't include the built kvm modules (ignoring CONFIG_TUN=y).  However, when
you have the =y cases, the user of the layer doesn't have a choice without
going through and commenting out the KERNEL_FEATURES_append...?  This was
the reasoning I took for choosing the base_contains() functionality instead
of just including it like the other bits (ebtables, vswitch, etc.).  Is the
goal for the layer's linux-yocto bbappend to support a "generic" kernel (by
default) to support all of its packages/images?

Take care,
-Chris

[-- Attachment #2: Type: text/html, Size: 2020 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-09-01  2:12     ` Chris Patterson
@ 2013-09-01  4:01       ` Bruce Ashfield
  2013-09-01 14:42         ` Chris Patterson
  0 siblings, 1 reply; 18+ messages in thread
From: Bruce Ashfield @ 2013-09-01  4:01 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Sat, Aug 31, 2013 at 10:12 PM, Chris Patterson <cjp256@gmail.com> wrote:
> That'd be great.  There are a couple areas that could perhaps use some work,
> as the fragment is a little excessive in some of the options and/or could be
> broken up a little better, if desired.  On this topic, I have a couple
> questions that would help steer me in the right direction in the future:
>
> 1) One thing that's not immediately clear for me is the question of how to
> best handle a case where a CONFIG_XXX option may in one instance, be
> desirable to be built in - vs being a module in another?  Doing a quick test
> seems to imply the first defined instance is the one used, but I'm not sure
> if there are any well defined rules for conflict resolution.  The reason I'm
> asking is there are CONFIG_XXX=y instances in this config - some of which
> need to be built in, some required, and some just *preferably* built in for
> various use cases. Specifically CONFIG_XEN_PCIDEV_BACKEND=y provides some
> useful functionality before a module could otherwise be loaded (prevent a
> pci device from being owned by a linux driver).

It should be last through the gate that wins, which gives the fragment that
includes another one a chance to tweak and override what it doesn't like.

If you were really seeing first one being set, then something has broken and
I'll hunt it down, I never assume that something hasn't managed to break
itself, but it should still be behaving as it has before.

What you may have seen is that KERNEL_FEATURES and .scc files on a
SRC_URI are applied in a particular order. .scc files and then KERNEL_FEATURES,
so if you want to override a feature, you need to do it with another features.

So in your case, you can have that base fragment sets the requirements as
built in, that's a good start. You could then have a secondary fragment which
sets the preferable options, and more fragments that had completely optional
values. Leaving the recipes and higher level fragments to chose the mix they
want.

Alternatively, you can set them all in the single fragment like it is, and then
the including feature can always override, or from recipe space additional
features be triggered override the values.

>
> 2) The other thing I am curious about is how to negotiate the inclusion of a
> KERNEL_FEATURES which has a number of built-in bits.  The approach used by
> kvm is to effectively always enable the fragment if one is including
> meta-virtualization.  This in and of itself isn't really polluting the
> target image for those that don't want KVM, because they likely simply don't
> include the built kvm modules (ignoring CONFIG_TUN=y).  However, when you
> have the =y cases, the user of the layer doesn't have a choice without going
> through and commenting out the KERNEL_FEATURES_append...?  This was the
> reasoning I took for choosing the base_contains() functionality instead of
> just including it like the other bits (ebtables, vswitch, etc.).  Is the
> goal for the layer's linux-yocto bbappend to support a "generic" kernel (by
> default) to support all of its packages/images?

An excellent point .. and yes, a layer shouldn't really be setting
values like this
unless it was single purpose. If we have Xen and KVM both active and available
via meta-virt, then we really don't want that.

I'd convert KVM to trigger via a IMAGE or DISTRO feature as well, just as you've
done with your fragments.

Cheers,

Bruce

>
> Take care,
> -Chris



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack.
  2013-08-30  5:36   ` Bruce Ashfield
@ 2013-09-01  4:41     ` Chris Patterson
  2013-09-01 14:25       ` Chris Patterson
  2013-09-08 22:54       ` Philip Tricca
  0 siblings, 2 replies; 18+ messages in thread
From: Chris Patterson @ 2013-09-01  4:41 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 13758 bytes --]

The reasoning for xen-image-initramfs was that I had minor issues with
using stock core-image-minimal-initramfs and initramfs-live-boot.

However, I have since tracked down the issue I was having with
initramfs-live-boot, and determined we could drop initramfs-boot-xen in
favor of initramfs-live-boot simply by adding LABEL=boot to the kernel args.

Beyond that, vanilla core-image-minimal-initramfs would hang at "Waiting
for removeable media..." indefinitely.  After some testing, It appeared
that adding coreutils to core-image-minimal-initramfs would resolve the
issue (though not yet sure why, but looking into it).


On Fri, Aug 30, 2013 at 1:36 AM, Bruce Ashfield <bruce.ashfield@gmail.com>wrote:

> On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com>
> wrote:
> > xen-image-initramfs: newly added initrd to support testing
> xen-image-minimal and init script based on init-live.sh.
> > ---
> >  recipes-extended/images/xen-image-initramfs.bb     |   17 ++
> >  recipes-extended/images/xen-image-minimal.bb       |   55 +++++-
> >  .../initrdscripts/files/init-boot-xen.sh           |  205
> ++++++++++++++++++++
> >  .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 ++
> >  4 files changed, 286 insertions(+), 7 deletions(-)
> >  create mode 100644 recipes-extended/images/xen-image-initramfs.bb
> >  create mode 100644 recipes-extended/initrdscripts/files/init-boot-xen.sh
> >  create mode 100644 recipes-extended/initrdscripts/
> initramfs-boot-xen_1.0.bb
> >
> > diff --git a/recipes-extended/images/xen-image-initramfs.bbb/recipes-extended/images/
> xen-image-initramfs.bb
> > new file mode 100644
> > index 0000000..d2f1301
> > --- /dev/null
> > +++ b/recipes-extended/images/xen-image-initramfs.bb
> > @@ -0,0 +1,17 @@
> > +DESCRIPTION = "Xen image initramfs"
> > +
> > +IMAGE_INSTALL = "initramfs-boot-xen busybox udev udev-extraconf
> base-passwd coreutils"
> > +
> > +# Do not pollute the initrd image with rootfs features
> > +IMAGE_FEATURES = ""
> > +
> > +export IMAGE_BASENAME = "xen-image-initramfs"
> > +
> > +IMAGE_LINGUAS = ""
> > +
> > +LICENSE = "MIT"
> > +
> > +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
> > +inherit core-image
> > +
> > +IMAGE_ROOTFS_SIZE = "8192"
> > diff --git a/recipes-extended/images/xen-image-minimal.bbb/recipes-extended/images/
> xen-image-minimal.bb
> > index 0cf55d6..c941339 100644
> > --- a/recipes-extended/images/xen-image-minimal.bb
> > +++ b/recipes-extended/images/xen-image-minimal.bb
> > @@ -1,14 +1,55 @@
> > -DESCRIPTION = "A minimal xen image"
> > -IMAGE_INSTALL = "packagegroup-core-boot xen-minimal dropbear mdadm"
> > +DESCRIPTION = "Image with Xen."
> > +
> > +INITRD_IMAGE ?= "xen-image-initramfs"
> > +
> > +IMAGE_INSTALL += " \
> > +    ${CORE_IMAGE_BASE_INSTALL} \
> > +    packagegroup-core-basic \
> > +    packagegroup-core-ssh-openssh \
> > +    kernel-module-xen-acpi-processor \
> > +    kernel-module-xen-blkback \
> > +    kernel-module-xen-blkfront \
> > +    kernel-module-xen-evtchn \
> > +    kernel-module-xenfs \
> > +    kernel-module-xen-gntalloc \
> > +    kernel-module-xen-gntdev \
> > +    kernel-module-xen-netback \
> > +    kernel-module-xen-netfront \
> > +    kernel-module-xen-pcifront \
> > +    kernel-module-xen-privcmd \
> > +    kernel-module-xen-wdt \
> > +    xen-base \
> > +    xen-qemu \
> > +    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
> > +    "
> >
> > -IMAGE_LINGUAS = " "
> >  LICENSE = "MIT"
> >
> >  inherit core-image
> >
> > -IMAGE_ROOTFS_SIZE = "8192"
> > +syslinux_iso_populate_append() {
> > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
> ${ISODIR}${ISOLINUXDIR}
> > +}
> > +
> > +syslinux_hddimg_populate_append() {
> > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
> ${HDDDIR}${SYSLINUXDIR}
> > +}
> > +
> > +grubefi_populate_append() {
> > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
> ${DEST}${EFIDIR}/xen.gz
> > +}
> > +
> > +populate_append() {
> > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
> ${DEST}/xen.gz
> > +}
> >
> > -# remove not needed ipkg informations
> > -ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
> > +build_syslinux_cfg () {
> > +       echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
> > +       echo "DEFAULT boot" >> ${SYSLINUXCFG}
> > +       echo "TIMEOUT 10" >> ${SYSLINUXCFG}
> > +       echo "PROMPT 1" >> ${SYSLINUXCFG}
> > +       echo "LABEL boot" >> ${SYSLINUXCFG}
> > +       echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
> > +       echo "  APPEND /xen.gz loglvl=all guest_loglvl=all
> console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768
> root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 ---
> /initrd" >> ${SYSLINUXCFG}
> > +}
> >
> > -require xen-bootimg.inc
> > diff --git a/recipes-extended/initrdscripts/files/init-boot-xen.sh
> b/recipes-extended/initrdscripts/files/init-boot-xen.sh
> > new file mode 100644
> > index 0000000..741f201
> > --- /dev/null
> > +++ b/recipes-extended/initrdscripts/files/init-boot-xen.sh
> > @@ -0,0 +1,205 @@
> > +#!/bin/sh
> > +
> > +PATH=/sbin:/bin:/usr/sbin:/usr/bin
> > +
> > +ROOT_MOUNT="/rootfs/"
> > +ROOT_IMAGE="rootfs.img"
> > +MOUNT="/bin/mount"
> > +UMOUNT="/bin/umount"
> > +ISOLINUX=""
> > +
> > +# Copied from initramfs-framework. The core of this script probably
> should be
> > +# turned into initramfs-framework modules to reduce duplication.
> > +udev_daemon() {
> > +       OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd
> /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
> > +
> > +       for o in $OPTIONS; do
> > +               if [ -x "$o" ]; then
> > +                       echo $o
> > +                       return 0
> > +               fi
> > +       done
> > +
> > +       return 1
> > +}
> > +
> > +_UDEV_DAEMON=`udev_daemon`
> > +
> > +early_setup() {
> > +    mkdir -p /proc
> > +    mkdir -p /sys
> > +    mount -t proc proc /proc
> > +    mount -t sysfs sysfs /sys
> > +    mount -t devtmpfs none /dev
> > +
> > +    # support modular kernel
> > +    modprobe isofs 2> /dev/null
> > +
> > +    mkdir -p /run
> > +    mkdir -p /var/run
> > +    mkdir -p /media
> > +
> > +    $_UDEV_DAEMON --daemon
> > +    udevadm trigger --action=add
> > +}
> > +
> > +read_args() {
> > +    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
> > +    for arg in $CMDLINE; do
> > +        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
> > +        case $arg in
> > +            root=*)
> > +                ROOT_DEVICE=$optarg ;;
> > +            rootfstype=*)
> > +                modprobe $optarg 2> /dev/null ;;
> > +            LABEL=*)
> > +                label=$optarg ;;
> > +            video=*)
> > +                video_mode=$arg ;;
> > +            vga=*)
> > +                vga_mode=$arg ;;
> > +            console=*)
> > +                if [ -z "${console_params}" ]; then
> > +                    console_params=$arg
> > +                else
> > +                    console_params="$console_params $arg"
> > +                fi ;;
> > +            debugshell*)
> > +                if [ -z "$optarg" ]; then
> > +                        shelltimeout=30
> > +                else
> > +                        shelltimeout=$optarg
> > +                fi
> > +        esac
> > +    done
> > +}
> > +
> > +boot_live_root() {
> > +    # Watches the udev event queue, and exits if all current events are
> handled
> > +    udevadm settle --timeout=3 --quiet
> > +    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
> > +
> > +    # Move the mount points of some filesystems over to
> > +    # the corresponding directories under the real root filesystem.
> > +    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
> > +        mkdir -p  ${ROOT_MOUNT}/$dir
> > +        mount -n --move $dir ${ROOT_MOUNT}/$dir
> > +    done
> > +    mount -n --move /proc ${ROOT_MOUNT}/proc
> > +    mount -n --move /sys ${ROOT_MOUNT}/sys
> > +    mount -n --move /dev ${ROOT_MOUNT}/dev
> > +
> > +    cd $ROOT_MOUNT
> > +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
> > +}
> > +
> > +fatal() {
> > +    echo $1 >$CONSOLE
> > +    echo >$CONSOLE
> > +    exec sh
> > +}
> > +
> > +early_setup
> > +
> > +[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
> > +
> > +read_args
> > +
> > +echo "Waiting for removable media..."
> > +C=0
> > +shelltimeout=5
> > +while true
> > +do
> > +  udevadm trigger
> > +  udevadm settle
> > +  for i in `ls /media 2>/dev/null`; do
> > +      if [ -f /media/$i/$ROOT_IMAGE ] ; then
> > +               found="yes"
> > +               break
> > +         elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
> > +               found="yes"
> > +               ISOLINUX="isolinux"
> > +               break
> > +      fi
> > +  done
> > +  if [ "$found" = "yes" ]; then
> > +      break;
> > +  fi
> > +  # don't wait for more than $shelltimeout seconds, if it's set
> > +  if [ -n "$shelltimeout" ]; then
> > +      echo -n " " $(( $shelltimeout - $C ))
> > +      if [ $C -ge $shelltimeout ]; then
> > +           echo "..."
> > +          echo "Mounted filesystems"
> > +           mount | grep media
> > +           echo "Available block devices"
> > +           ls /dev/sd*
> > +           fatal "Cannot find rootfs.img file in /media/* , dropping to
> a shell "
> > +      fi
> > +      C=$(( C + 1 ))
> > +  fi
> > +  sleep 1
> > +done
> > +
> > +# Try to make a union mount of the root image.
> > +# If no unification filesystem is available, mount the image read-only.
> > +mount_and_boot() {
> > +    mkdir $ROOT_MOUNT
> > +
> > +    mknod /dev/loop0 b 7 0 2>/dev/null
> > +
> > +    # determine which unification filesystem to use
> > +    union_fs_type=""
> > +    if grep -q -w "overlayfs" /proc/filesystems; then
> > +       union_fs_type="overlayfs"
> > +    elif grep -q -w "aufs" /proc/filesystems; then
> > +       union_fs_type="aufs"
> > +    else
> > +       union_fs_type=""
> > +    fi
> > +    # make a union mount if possible
> > +    case $union_fs_type in
> > +       "overlayfs")
> > +           mkdir -p /rootfs.ro /rootfs.rw
> > +           if ! mount -o rw,loop,noatime,nodiratime
> /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
> > +               rm -rf /rootfs.ro /rootfs.rw
> > +               fatal "Could not mount rootfs image"
> > +           else
> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
> > +               mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/
> rootfs.rw" overlayfs $ROOT_MOUNT
> > +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
> > +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
> > +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
> > +           fi
> > +           ;;
> > +       "aufs")
> > +           mkdir -p /rootfs.ro /rootfs.rw
> > +           if ! mount -o rw,loop,noatime,nodiratime
> /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
> > +               rm -rf /rootfs.ro /rootfs.rw
> > +               fatal "Could not mount rootfs image"
> > +           else
> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
> > +               mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro"
> aufs $ROOT_MOUNT
> > +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
> > +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
> > +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
> > +           fi
> > +           ;;
> > +       "")
> > +           if ! mount -o rw,loop,noatime,nodiratime
> /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
> > +               fatal "Could not mount rootfs image"
> > +           else
> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs
> $ROOT_MOUNT/media
> > +           fi
> > +           ;;
> > +    esac
> > +
> > +    # boot the image
> > +    boot_live_root
> > +}
> > +
> > +mount_and_boot
> > +
> > +# If we're getting here, we failed...
> > +fatal "Installation image failed"
> > +
> > diff --git a/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bbb/recipes-extended/initrdscripts/
> initramfs-boot-xen_1.0.bb
> > new file mode 100644
> > index 0000000..9380e83
> > --- /dev/null
> > +++ b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
> > @@ -0,0 +1,16 @@
> > +DESCRIPTION = "A live image init script with support for Xen"
> > +LICENSE = "MIT"
> > +LIC_FILES_CHKSUM =
> "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> > +SRC_URI = "file://init-boot-xen.sh"
> > +PR = "r0"
> > +
> > +inherit allarch
> > +
> > +RDEPENDS_${PN} = "udev udev-extraconf"
> > +
> > +FILES_${PN} += " /init "
>
> I was going to ask if you are seeing any QA warnings with this, since
> in the past we've had
> to use update alternatives and priority to ensure that the right init
> was used in an image .. but
> then I noticed this is only pulled into the minimal config and there
> shouldn't be any conflicting
> init providers!
>
> Bruce
>
> > +
> > +do_install() {
> > +        install -m 0755 ${WORKDIR}/init-boot-xen.sh ${D}/init
> > +}
> > +
> > --
> > 1.7.10.4
> >
> > _______________________________________________
> > meta-virtualization mailing list
> > meta-virtualization@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/meta-virtualization
>
>
>
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end"
>

[-- Attachment #2: Type: text/html, Size: 19159 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack.
  2013-09-01  4:41     ` Chris Patterson
@ 2013-09-01 14:25       ` Chris Patterson
  2013-09-02  3:08         ` Bruce Ashfield
  2013-09-08 22:54       ` Philip Tricca
  1 sibling, 1 reply; 18+ messages in thread
From: Chris Patterson @ 2013-09-01 14:25 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 15027 bytes --]

Tracked down the issue to the busybox defconfig in the meta-virt layer.

There were patches upstreamed to udev's mount script to require 'stat' in
addition to a similar update to busybox's config to provide it.

commit ef7e1239b95dbef4e461007d6d0612c27a7919ec
Author: Andy Ross <andy.ross@windriver.com>
Date:   Tue Sep 18 14:38:44 2012 -0700
busybox: add /usr/bin/stat applet...

commit 3543d0db691e82098c1da7bf12f43e0c57551a3d
Author: Andy Ross <andy.ross@windriver.com>
Date:   Tue Sep 18 14:38:45 2012 -0700
udev-extraconf: Don't mount root filesystem under /media...

I suppose this could be resolved by updating the busybox defconfig to a
fragment turning on only the extra bits it wants?  Or should I be
prioritizing my layers differently?


On Sun, Sep 1, 2013 at 12:41 AM, Chris Patterson <cjp256@gmail.com> wrote:

> The reasoning for xen-image-initramfs was that I had minor issues with
> using stock core-image-minimal-initramfs and initramfs-live-boot.
>
> However, I have since tracked down the issue I was having with
> initramfs-live-boot, and determined we could drop initramfs-boot-xen in
> favor of initramfs-live-boot simply by adding LABEL=boot to the kernel args.
>
> Beyond that, vanilla core-image-minimal-initramfs would hang at "Waiting
> for removeable media..." indefinitely.  After some testing, It appeared
> that adding coreutils to core-image-minimal-initramfs would resolve the
> issue (though not yet sure why, but looking into it).
>
>
> On Fri, Aug 30, 2013 at 1:36 AM, Bruce Ashfield <bruce.ashfield@gmail.com>wrote:
>
>> On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com>
>> wrote:
>> > xen-image-initramfs: newly added initrd to support testing
>> xen-image-minimal and init script based on init-live.sh.
>> > ---
>> >  recipes-extended/images/xen-image-initramfs.bb     |   17 ++
>> >  recipes-extended/images/xen-image-minimal.bb       |   55 +++++-
>> >  .../initrdscripts/files/init-boot-xen.sh           |  205
>> ++++++++++++++++++++
>> >  .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 ++
>> >  4 files changed, 286 insertions(+), 7 deletions(-)
>> >  create mode 100644 recipes-extended/images/xen-image-initramfs.bb
>> >  create mode 100644
>> recipes-extended/initrdscripts/files/init-boot-xen.sh
>> >  create mode 100644 recipes-extended/initrdscripts/
>> initramfs-boot-xen_1.0.bb
>> >
>> > diff --git a/recipes-extended/images/xen-image-initramfs.bbb/recipes-extended/images/
>> xen-image-initramfs.bb
>> > new file mode 100644
>> > index 0000000..d2f1301
>> > --- /dev/null
>> > +++ b/recipes-extended/images/xen-image-initramfs.bb
>> > @@ -0,0 +1,17 @@
>> > +DESCRIPTION = "Xen image initramfs"
>> > +
>> > +IMAGE_INSTALL = "initramfs-boot-xen busybox udev udev-extraconf
>> base-passwd coreutils"
>> > +
>> > +# Do not pollute the initrd image with rootfs features
>> > +IMAGE_FEATURES = ""
>> > +
>> > +export IMAGE_BASENAME = "xen-image-initramfs"
>> > +
>> > +IMAGE_LINGUAS = ""
>> > +
>> > +LICENSE = "MIT"
>> > +
>> > +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
>> > +inherit core-image
>> > +
>> > +IMAGE_ROOTFS_SIZE = "8192"
>> > diff --git a/recipes-extended/images/xen-image-minimal.bbb/recipes-extended/images/
>> xen-image-minimal.bb
>> > index 0cf55d6..c941339 100644
>> > --- a/recipes-extended/images/xen-image-minimal.bb
>> > +++ b/recipes-extended/images/xen-image-minimal.bb
>> > @@ -1,14 +1,55 @@
>> > -DESCRIPTION = "A minimal xen image"
>> > -IMAGE_INSTALL = "packagegroup-core-boot xen-minimal dropbear mdadm"
>> > +DESCRIPTION = "Image with Xen."
>> > +
>> > +INITRD_IMAGE ?= "xen-image-initramfs"
>> > +
>> > +IMAGE_INSTALL += " \
>> > +    ${CORE_IMAGE_BASE_INSTALL} \
>> > +    packagegroup-core-basic \
>> > +    packagegroup-core-ssh-openssh \
>> > +    kernel-module-xen-acpi-processor \
>> > +    kernel-module-xen-blkback \
>> > +    kernel-module-xen-blkfront \
>> > +    kernel-module-xen-evtchn \
>> > +    kernel-module-xenfs \
>> > +    kernel-module-xen-gntalloc \
>> > +    kernel-module-xen-gntdev \
>> > +    kernel-module-xen-netback \
>> > +    kernel-module-xen-netfront \
>> > +    kernel-module-xen-pcifront \
>> > +    kernel-module-xen-privcmd \
>> > +    kernel-module-xen-wdt \
>> > +    xen-base \
>> > +    xen-qemu \
>> > +    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
>> > +    "
>> >
>> > -IMAGE_LINGUAS = " "
>> >  LICENSE = "MIT"
>> >
>> >  inherit core-image
>> >
>> > -IMAGE_ROOTFS_SIZE = "8192"
>> > +syslinux_iso_populate_append() {
>> > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
>> ${ISODIR}${ISOLINUXDIR}
>> > +}
>> > +
>> > +syslinux_hddimg_populate_append() {
>> > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
>> ${HDDDIR}${SYSLINUXDIR}
>> > +}
>> > +
>> > +grubefi_populate_append() {
>> > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
>> ${DEST}${EFIDIR}/xen.gz
>> > +}
>> > +
>> > +populate_append() {
>> > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
>> ${DEST}/xen.gz
>> > +}
>> >
>> > -# remove not needed ipkg informations
>> > -ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
>> > +build_syslinux_cfg () {
>> > +       echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
>> > +       echo "DEFAULT boot" >> ${SYSLINUXCFG}
>> > +       echo "TIMEOUT 10" >> ${SYSLINUXCFG}
>> > +       echo "PROMPT 1" >> ${SYSLINUXCFG}
>> > +       echo "LABEL boot" >> ${SYSLINUXCFG}
>> > +       echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
>> > +       echo "  APPEND /xen.gz loglvl=all guest_loglvl=all
>> console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768
>> root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 ---
>> /initrd" >> ${SYSLINUXCFG}
>> > +}
>> >
>> > -require xen-bootimg.inc
>> > diff --git a/recipes-extended/initrdscripts/files/init-boot-xen.sh
>> b/recipes-extended/initrdscripts/files/init-boot-xen.sh
>> > new file mode 100644
>> > index 0000000..741f201
>> > --- /dev/null
>> > +++ b/recipes-extended/initrdscripts/files/init-boot-xen.sh
>> > @@ -0,0 +1,205 @@
>> > +#!/bin/sh
>> > +
>> > +PATH=/sbin:/bin:/usr/sbin:/usr/bin
>> > +
>> > +ROOT_MOUNT="/rootfs/"
>> > +ROOT_IMAGE="rootfs.img"
>> > +MOUNT="/bin/mount"
>> > +UMOUNT="/bin/umount"
>> > +ISOLINUX=""
>> > +
>> > +# Copied from initramfs-framework. The core of this script probably
>> should be
>> > +# turned into initramfs-framework modules to reduce duplication.
>> > +udev_daemon() {
>> > +       OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd
>> /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
>> > +
>> > +       for o in $OPTIONS; do
>> > +               if [ -x "$o" ]; then
>> > +                       echo $o
>> > +                       return 0
>> > +               fi
>> > +       done
>> > +
>> > +       return 1
>> > +}
>> > +
>> > +_UDEV_DAEMON=`udev_daemon`
>> > +
>> > +early_setup() {
>> > +    mkdir -p /proc
>> > +    mkdir -p /sys
>> > +    mount -t proc proc /proc
>> > +    mount -t sysfs sysfs /sys
>> > +    mount -t devtmpfs none /dev
>> > +
>> > +    # support modular kernel
>> > +    modprobe isofs 2> /dev/null
>> > +
>> > +    mkdir -p /run
>> > +    mkdir -p /var/run
>> > +    mkdir -p /media
>> > +
>> > +    $_UDEV_DAEMON --daemon
>> > +    udevadm trigger --action=add
>> > +}
>> > +
>> > +read_args() {
>> > +    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
>> > +    for arg in $CMDLINE; do
>> > +        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
>> > +        case $arg in
>> > +            root=*)
>> > +                ROOT_DEVICE=$optarg ;;
>> > +            rootfstype=*)
>> > +                modprobe $optarg 2> /dev/null ;;
>> > +            LABEL=*)
>> > +                label=$optarg ;;
>> > +            video=*)
>> > +                video_mode=$arg ;;
>> > +            vga=*)
>> > +                vga_mode=$arg ;;
>> > +            console=*)
>> > +                if [ -z "${console_params}" ]; then
>> > +                    console_params=$arg
>> > +                else
>> > +                    console_params="$console_params $arg"
>> > +                fi ;;
>> > +            debugshell*)
>> > +                if [ -z "$optarg" ]; then
>> > +                        shelltimeout=30
>> > +                else
>> > +                        shelltimeout=$optarg
>> > +                fi
>> > +        esac
>> > +    done
>> > +}
>> > +
>> > +boot_live_root() {
>> > +    # Watches the udev event queue, and exits if all current events
>> are handled
>> > +    udevadm settle --timeout=3 --quiet
>> > +    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
>> > +
>> > +    # Move the mount points of some filesystems over to
>> > +    # the corresponding directories under the real root filesystem.
>> > +    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
>> > +        mkdir -p  ${ROOT_MOUNT}/$dir
>> > +        mount -n --move $dir ${ROOT_MOUNT}/$dir
>> > +    done
>> > +    mount -n --move /proc ${ROOT_MOUNT}/proc
>> > +    mount -n --move /sys ${ROOT_MOUNT}/sys
>> > +    mount -n --move /dev ${ROOT_MOUNT}/dev
>> > +
>> > +    cd $ROOT_MOUNT
>> > +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
>> > +}
>> > +
>> > +fatal() {
>> > +    echo $1 >$CONSOLE
>> > +    echo >$CONSOLE
>> > +    exec sh
>> > +}
>> > +
>> > +early_setup
>> > +
>> > +[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
>> > +
>> > +read_args
>> > +
>> > +echo "Waiting for removable media..."
>> > +C=0
>> > +shelltimeout=5
>> > +while true
>> > +do
>> > +  udevadm trigger
>> > +  udevadm settle
>> > +  for i in `ls /media 2>/dev/null`; do
>> > +      if [ -f /media/$i/$ROOT_IMAGE ] ; then
>> > +               found="yes"
>> > +               break
>> > +         elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
>> > +               found="yes"
>> > +               ISOLINUX="isolinux"
>> > +               break
>> > +      fi
>> > +  done
>> > +  if [ "$found" = "yes" ]; then
>> > +      break;
>> > +  fi
>> > +  # don't wait for more than $shelltimeout seconds, if it's set
>> > +  if [ -n "$shelltimeout" ]; then
>> > +      echo -n " " $(( $shelltimeout - $C ))
>> > +      if [ $C -ge $shelltimeout ]; then
>> > +           echo "..."
>> > +          echo "Mounted filesystems"
>> > +           mount | grep media
>> > +           echo "Available block devices"
>> > +           ls /dev/sd*
>> > +           fatal "Cannot find rootfs.img file in /media/* , dropping
>> to a shell "
>> > +      fi
>> > +      C=$(( C + 1 ))
>> > +  fi
>> > +  sleep 1
>> > +done
>> > +
>> > +# Try to make a union mount of the root image.
>> > +# If no unification filesystem is available, mount the image read-only.
>> > +mount_and_boot() {
>> > +    mkdir $ROOT_MOUNT
>> > +
>> > +    mknod /dev/loop0 b 7 0 2>/dev/null
>> > +
>> > +    # determine which unification filesystem to use
>> > +    union_fs_type=""
>> > +    if grep -q -w "overlayfs" /proc/filesystems; then
>> > +       union_fs_type="overlayfs"
>> > +    elif grep -q -w "aufs" /proc/filesystems; then
>> > +       union_fs_type="aufs"
>> > +    else
>> > +       union_fs_type=""
>> > +    fi
>> > +    # make a union mount if possible
>> > +    case $union_fs_type in
>> > +       "overlayfs")
>> > +           mkdir -p /rootfs.ro /rootfs.rw
>> > +           if ! mount -o rw,loop,noatime,nodiratime
>> /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
>> > +               rm -rf /rootfs.ro /rootfs.rw
>> > +               fatal "Could not mount rootfs image"
>> > +           else
>> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
>> > +               mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/
>> rootfs.rw" overlayfs $ROOT_MOUNT
>> > +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
>> > +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
>> > +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
>> > +           fi
>> > +           ;;
>> > +       "aufs")
>> > +           mkdir -p /rootfs.ro /rootfs.rw
>> > +           if ! mount -o rw,loop,noatime,nodiratime
>> /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
>> > +               rm -rf /rootfs.ro /rootfs.rw
>> > +               fatal "Could not mount rootfs image"
>> > +           else
>> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
>> > +               mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro"
>> aufs $ROOT_MOUNT
>> > +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
>> > +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
>> > +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
>> > +           fi
>> > +           ;;
>> > +       "")
>> > +           if ! mount -o rw,loop,noatime,nodiratime
>> /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
>> > +               fatal "Could not mount rootfs image"
>> > +           else
>> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs
>> $ROOT_MOUNT/media
>> > +           fi
>> > +           ;;
>> > +    esac
>> > +
>> > +    # boot the image
>> > +    boot_live_root
>> > +}
>> > +
>> > +mount_and_boot
>> > +
>> > +# If we're getting here, we failed...
>> > +fatal "Installation image failed"
>> > +
>> > diff --git a/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bbb/recipes-extended/initrdscripts/
>> initramfs-boot-xen_1.0.bb
>> > new file mode 100644
>> > index 0000000..9380e83
>> > --- /dev/null
>> > +++ b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>> > @@ -0,0 +1,16 @@
>> > +DESCRIPTION = "A live image init script with support for Xen"
>> > +LICENSE = "MIT"
>> > +LIC_FILES_CHKSUM =
>> "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>> > +SRC_URI = "file://init-boot-xen.sh"
>> > +PR = "r0"
>> > +
>> > +inherit allarch
>> > +
>> > +RDEPENDS_${PN} = "udev udev-extraconf"
>> > +
>> > +FILES_${PN} += " /init "
>>
>> I was going to ask if you are seeing any QA warnings with this, since
>> in the past we've had
>> to use update alternatives and priority to ensure that the right init
>> was used in an image .. but
>> then I noticed this is only pulled into the minimal config and there
>> shouldn't be any conflicting
>> init providers!
>>
>> Bruce
>>
>> > +
>> > +do_install() {
>> > +        install -m 0755 ${WORKDIR}/init-boot-xen.sh ${D}/init
>> > +}
>> > +
>> > --
>> > 1.7.10.4
>> >
>> > _______________________________________________
>> > meta-virtualization mailing list
>> > meta-virtualization@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/meta-virtualization
>>
>>
>>
>> --
>> "Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end"
>>
>
>

[-- Attachment #2: Type: text/html, Size: 20522 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-09-01  4:01       ` Bruce Ashfield
@ 2013-09-01 14:42         ` Chris Patterson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Patterson @ 2013-09-01 14:42 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 4116 bytes --]

I went back and double checked - you are right - last fragment wins as you
expected. I typo'd something in my test :)  Thanks for the clarification,
that makes more sense to me now.


On Sun, Sep 1, 2013 at 12:01 AM, Bruce Ashfield <bruce.ashfield@gmail.com>wrote:

> On Sat, Aug 31, 2013 at 10:12 PM, Chris Patterson <cjp256@gmail.com>
> wrote:
> > That'd be great.  There are a couple areas that could perhaps use some
> work,
> > as the fragment is a little excessive in some of the options and/or
> could be
> > broken up a little better, if desired.  On this topic, I have a couple
> > questions that would help steer me in the right direction in the future:
> >
> > 1) One thing that's not immediately clear for me is the question of how
> to
> > best handle a case where a CONFIG_XXX option may in one instance, be
> > desirable to be built in - vs being a module in another?  Doing a quick
> test
> > seems to imply the first defined instance is the one used, but I'm not
> sure
> > if there are any well defined rules for conflict resolution.  The reason
> I'm
> > asking is there are CONFIG_XXX=y instances in this config - some of which
> > need to be built in, some required, and some just *preferably* built in
> for
> > various use cases. Specifically CONFIG_XEN_PCIDEV_BACKEND=y provides some
> > useful functionality before a module could otherwise be loaded (prevent a
> > pci device from being owned by a linux driver).
>
> It should be last through the gate that wins, which gives the fragment that
> includes another one a chance to tweak and override what it doesn't like.
>
> If you were really seeing first one being set, then something has broken
> and
> I'll hunt it down, I never assume that something hasn't managed to break
> itself, but it should still be behaving as it has before.
>
> What you may have seen is that KERNEL_FEATURES and .scc files on a
> SRC_URI are applied in a particular order. .scc files and then
> KERNEL_FEATURES,
> so if you want to override a feature, you need to do it with another
> features.
>
> So in your case, you can have that base fragment sets the requirements as
> built in, that's a good start. You could then have a secondary fragment
> which
> sets the preferable options, and more fragments that had completely
> optional
> values. Leaving the recipes and higher level fragments to chose the mix
> they
> want.
>
> Alternatively, you can set them all in the single fragment like it is, and
> then
> the including feature can always override, or from recipe space additional
> features be triggered override the values.
>
> >
> > 2) The other thing I am curious about is how to negotiate the inclusion
> of a
> > KERNEL_FEATURES which has a number of built-in bits.  The approach used
> by
> > kvm is to effectively always enable the fragment if one is including
> > meta-virtualization.  This in and of itself isn't really polluting the
> > target image for those that don't want KVM, because they likely simply
> don't
> > include the built kvm modules (ignoring CONFIG_TUN=y).  However, when you
> > have the =y cases, the user of the layer doesn't have a choice without
> going
> > through and commenting out the KERNEL_FEATURES_append...?  This was the
> > reasoning I took for choosing the base_contains() functionality instead
> of
> > just including it like the other bits (ebtables, vswitch, etc.).  Is the
> > goal for the layer's linux-yocto bbappend to support a "generic" kernel
> (by
> > default) to support all of its packages/images?
>
> An excellent point .. and yes, a layer shouldn't really be setting
> values like this
> unless it was single purpose. If we have Xen and KVM both active and
> available
> via meta-virt, then we really don't want that.
>
> I'd convert KVM to trigger via a IMAGE or DISTRO feature as well, just as
> you've
> done with your fragments.
>
> Cheers,
>
> Bruce
>
> >
> > Take care,
> > -Chris
>
>
>
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end"
>

[-- Attachment #2: Type: text/html, Size: 4829 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack.
  2013-09-01 14:25       ` Chris Patterson
@ 2013-09-02  3:08         ` Bruce Ashfield
  0 siblings, 0 replies; 18+ messages in thread
From: Bruce Ashfield @ 2013-09-02  3:08 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Sun, Sep 1, 2013 at 10:25 AM, Chris Patterson <cjp256@gmail.com> wrote:
> Tracked down the issue to the busybox defconfig in the meta-virt layer.
>
> There were patches upstreamed to udev's mount script to require 'stat' in
> addition to a similar update to busybox's config to provide it.
>
> commit ef7e1239b95dbef4e461007d6d0612c27a7919ec
> Author: Andy Ross <andy.ross@windriver.com>
> Date:   Tue Sep 18 14:38:44 2012 -0700
> busybox: add /usr/bin/stat applet...
>
> commit 3543d0db691e82098c1da7bf12f43e0c57551a3d
> Author: Andy Ross <andy.ross@windriver.com>
> Date:   Tue Sep 18 14:38:45 2012 -0700
> udev-extraconf: Don't mount root filesystem under /media...
>
> I suppose this could be resolved by updating the busybox defconfig to a
> fragment turning on only the extra bits it wants?  Or should I be
> prioritizing my layers differently?

Converting to a fragment would be the best thing. The defconfig in
meta-virt predates
the fragment support for busybox, and no one has converted it yet.

Cheers,

Bruce

>
>
> On Sun, Sep 1, 2013 at 12:41 AM, Chris Patterson <cjp256@gmail.com> wrote:
>>
>> The reasoning for xen-image-initramfs was that I had minor issues with
>> using stock core-image-minimal-initramfs and initramfs-live-boot.
>>
>> However, I have since tracked down the issue I was having with
>> initramfs-live-boot, and determined we could drop initramfs-boot-xen in
>> favor of initramfs-live-boot simply by adding LABEL=boot to the kernel args.
>>
>> Beyond that, vanilla core-image-minimal-initramfs would hang at "Waiting
>> for removeable media..." indefinitely.  After some testing, It appeared that
>> adding coreutils to core-image-minimal-initramfs would resolve the issue
>> (though not yet sure why, but looking into it).
>>
>>
>> On Fri, Aug 30, 2013 at 1:36 AM, Bruce Ashfield <bruce.ashfield@gmail.com>
>> wrote:
>>>
>>> On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com>
>>> wrote:
>>> > xen-image-initramfs: newly added initrd to support testing
>>> > xen-image-minimal and init script based on init-live.sh.
>>> > ---
>>> >  recipes-extended/images/xen-image-initramfs.bb     |   17 ++
>>> >  recipes-extended/images/xen-image-minimal.bb       |   55 +++++-
>>> >  .../initrdscripts/files/init-boot-xen.sh           |  205
>>> > ++++++++++++++++++++
>>> >  .../initrdscripts/initramfs-boot-xen_1.0.bb        |   16 ++
>>> >  4 files changed, 286 insertions(+), 7 deletions(-)
>>> >  create mode 100644 recipes-extended/images/xen-image-initramfs.bb
>>> >  create mode 100644
>>> > recipes-extended/initrdscripts/files/init-boot-xen.sh
>>> >  create mode 100644
>>> > recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>>> >
>>> > diff --git a/recipes-extended/images/xen-image-initramfs.bb
>>> > b/recipes-extended/images/xen-image-initramfs.bb
>>> > new file mode 100644
>>> > index 0000000..d2f1301
>>> > --- /dev/null
>>> > +++ b/recipes-extended/images/xen-image-initramfs.bb
>>> > @@ -0,0 +1,17 @@
>>> > +DESCRIPTION = "Xen image initramfs"
>>> > +
>>> > +IMAGE_INSTALL = "initramfs-boot-xen busybox udev udev-extraconf
>>> > base-passwd coreutils"
>>> > +
>>> > +# Do not pollute the initrd image with rootfs features
>>> > +IMAGE_FEATURES = ""
>>> > +
>>> > +export IMAGE_BASENAME = "xen-image-initramfs"
>>> > +
>>> > +IMAGE_LINGUAS = ""
>>> > +
>>> > +LICENSE = "MIT"
>>> > +
>>> > +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
>>> > +inherit core-image
>>> > +
>>> > +IMAGE_ROOTFS_SIZE = "8192"
>>> > diff --git a/recipes-extended/images/xen-image-minimal.bb
>>> > b/recipes-extended/images/xen-image-minimal.bb
>>> > index 0cf55d6..c941339 100644
>>> > --- a/recipes-extended/images/xen-image-minimal.bb
>>> > +++ b/recipes-extended/images/xen-image-minimal.bb
>>> > @@ -1,14 +1,55 @@
>>> > -DESCRIPTION = "A minimal xen image"
>>> > -IMAGE_INSTALL = "packagegroup-core-boot xen-minimal dropbear mdadm"
>>> > +DESCRIPTION = "Image with Xen."
>>> > +
>>> > +INITRD_IMAGE ?= "xen-image-initramfs"
>>> > +
>>> > +IMAGE_INSTALL += " \
>>> > +    ${CORE_IMAGE_BASE_INSTALL} \
>>> > +    packagegroup-core-basic \
>>> > +    packagegroup-core-ssh-openssh \
>>> > +    kernel-module-xen-acpi-processor \
>>> > +    kernel-module-xen-blkback \
>>> > +    kernel-module-xen-blkfront \
>>> > +    kernel-module-xen-evtchn \
>>> > +    kernel-module-xenfs \
>>> > +    kernel-module-xen-gntalloc \
>>> > +    kernel-module-xen-gntdev \
>>> > +    kernel-module-xen-netback \
>>> > +    kernel-module-xen-netfront \
>>> > +    kernel-module-xen-pcifront \
>>> > +    kernel-module-xen-privcmd \
>>> > +    kernel-module-xen-wdt \
>>> > +    xen-base \
>>> > +    xen-qemu \
>>> > +    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
>>> > +    "
>>> >
>>> > -IMAGE_LINGUAS = " "
>>> >  LICENSE = "MIT"
>>> >
>>> >  inherit core-image
>>> >
>>> > -IMAGE_ROOTFS_SIZE = "8192"
>>> > +syslinux_iso_populate_append() {
>>> > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
>>> > ${ISODIR}${ISOLINUXDIR}
>>> > +}
>>> > +
>>> > +syslinux_hddimg_populate_append() {
>>> > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
>>> > ${HDDDIR}${SYSLINUXDIR}
>>> > +}
>>> > +
>>> > +grubefi_populate_append() {
>>> > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
>>> > ${DEST}${EFIDIR}/xen.gz
>>> > +}
>>> > +
>>> > +populate_append() {
>>> > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
>>> > ${DEST}/xen.gz
>>> > +}
>>> >
>>> > -# remove not needed ipkg informations
>>> > -ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
>>> > +build_syslinux_cfg () {
>>> > +       echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
>>> > +       echo "DEFAULT boot" >> ${SYSLINUXCFG}
>>> > +       echo "TIMEOUT 10" >> ${SYSLINUXCFG}
>>> > +       echo "PROMPT 1" >> ${SYSLINUXCFG}
>>> > +       echo "LABEL boot" >> ${SYSLINUXCFG}
>>> > +       echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
>>> > +       echo "  APPEND /xen.gz loglvl=all guest_loglvl=all
>>> > console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768
>>> > root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 ---
>>> > /initrd" >> ${SYSLINUXCFG}
>>> > +}
>>> >
>>> > -require xen-bootimg.inc
>>> > diff --git a/recipes-extended/initrdscripts/files/init-boot-xen.sh
>>> > b/recipes-extended/initrdscripts/files/init-boot-xen.sh
>>> > new file mode 100644
>>> > index 0000000..741f201
>>> > --- /dev/null
>>> > +++ b/recipes-extended/initrdscripts/files/init-boot-xen.sh
>>> > @@ -0,0 +1,205 @@
>>> > +#!/bin/sh
>>> > +
>>> > +PATH=/sbin:/bin:/usr/sbin:/usr/bin
>>> > +
>>> > +ROOT_MOUNT="/rootfs/"
>>> > +ROOT_IMAGE="rootfs.img"
>>> > +MOUNT="/bin/mount"
>>> > +UMOUNT="/bin/umount"
>>> > +ISOLINUX=""
>>> > +
>>> > +# Copied from initramfs-framework. The core of this script probably
>>> > should be
>>> > +# turned into initramfs-framework modules to reduce duplication.
>>> > +udev_daemon() {
>>> > +       OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd
>>> > /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
>>> > +
>>> > +       for o in $OPTIONS; do
>>> > +               if [ -x "$o" ]; then
>>> > +                       echo $o
>>> > +                       return 0
>>> > +               fi
>>> > +       done
>>> > +
>>> > +       return 1
>>> > +}
>>> > +
>>> > +_UDEV_DAEMON=`udev_daemon`
>>> > +
>>> > +early_setup() {
>>> > +    mkdir -p /proc
>>> > +    mkdir -p /sys
>>> > +    mount -t proc proc /proc
>>> > +    mount -t sysfs sysfs /sys
>>> > +    mount -t devtmpfs none /dev
>>> > +
>>> > +    # support modular kernel
>>> > +    modprobe isofs 2> /dev/null
>>> > +
>>> > +    mkdir -p /run
>>> > +    mkdir -p /var/run
>>> > +    mkdir -p /media
>>> > +
>>> > +    $_UDEV_DAEMON --daemon
>>> > +    udevadm trigger --action=add
>>> > +}
>>> > +
>>> > +read_args() {
>>> > +    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
>>> > +    for arg in $CMDLINE; do
>>> > +        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
>>> > +        case $arg in
>>> > +            root=*)
>>> > +                ROOT_DEVICE=$optarg ;;
>>> > +            rootfstype=*)
>>> > +                modprobe $optarg 2> /dev/null ;;
>>> > +            LABEL=*)
>>> > +                label=$optarg ;;
>>> > +            video=*)
>>> > +                video_mode=$arg ;;
>>> > +            vga=*)
>>> > +                vga_mode=$arg ;;
>>> > +            console=*)
>>> > +                if [ -z "${console_params}" ]; then
>>> > +                    console_params=$arg
>>> > +                else
>>> > +                    console_params="$console_params $arg"
>>> > +                fi ;;
>>> > +            debugshell*)
>>> > +                if [ -z "$optarg" ]; then
>>> > +                        shelltimeout=30
>>> > +                else
>>> > +                        shelltimeout=$optarg
>>> > +                fi
>>> > +        esac
>>> > +    done
>>> > +}
>>> > +
>>> > +boot_live_root() {
>>> > +    # Watches the udev event queue, and exits if all current events
>>> > are handled
>>> > +    udevadm settle --timeout=3 --quiet
>>> > +    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
>>> > +
>>> > +    # Move the mount points of some filesystems over to
>>> > +    # the corresponding directories under the real root filesystem.
>>> > +    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
>>> > +        mkdir -p  ${ROOT_MOUNT}/$dir
>>> > +        mount -n --move $dir ${ROOT_MOUNT}/$dir
>>> > +    done
>>> > +    mount -n --move /proc ${ROOT_MOUNT}/proc
>>> > +    mount -n --move /sys ${ROOT_MOUNT}/sys
>>> > +    mount -n --move /dev ${ROOT_MOUNT}/dev
>>> > +
>>> > +    cd $ROOT_MOUNT
>>> > +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
>>> > +}
>>> > +
>>> > +fatal() {
>>> > +    echo $1 >$CONSOLE
>>> > +    echo >$CONSOLE
>>> > +    exec sh
>>> > +}
>>> > +
>>> > +early_setup
>>> > +
>>> > +[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
>>> > +
>>> > +read_args
>>> > +
>>> > +echo "Waiting for removable media..."
>>> > +C=0
>>> > +shelltimeout=5
>>> > +while true
>>> > +do
>>> > +  udevadm trigger
>>> > +  udevadm settle
>>> > +  for i in `ls /media 2>/dev/null`; do
>>> > +      if [ -f /media/$i/$ROOT_IMAGE ] ; then
>>> > +               found="yes"
>>> > +               break
>>> > +         elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
>>> > +               found="yes"
>>> > +               ISOLINUX="isolinux"
>>> > +               break
>>> > +      fi
>>> > +  done
>>> > +  if [ "$found" = "yes" ]; then
>>> > +      break;
>>> > +  fi
>>> > +  # don't wait for more than $shelltimeout seconds, if it's set
>>> > +  if [ -n "$shelltimeout" ]; then
>>> > +      echo -n " " $(( $shelltimeout - $C ))
>>> > +      if [ $C -ge $shelltimeout ]; then
>>> > +           echo "..."
>>> > +          echo "Mounted filesystems"
>>> > +           mount | grep media
>>> > +           echo "Available block devices"
>>> > +           ls /dev/sd*
>>> > +           fatal "Cannot find rootfs.img file in /media/* , dropping
>>> > to a shell "
>>> > +      fi
>>> > +      C=$(( C + 1 ))
>>> > +  fi
>>> > +  sleep 1
>>> > +done
>>> > +
>>> > +# Try to make a union mount of the root image.
>>> > +# If no unification filesystem is available, mount the image
>>> > read-only.
>>> > +mount_and_boot() {
>>> > +    mkdir $ROOT_MOUNT
>>> > +
>>> > +    mknod /dev/loop0 b 7 0 2>/dev/null
>>> > +
>>> > +    # determine which unification filesystem to use
>>> > +    union_fs_type=""
>>> > +    if grep -q -w "overlayfs" /proc/filesystems; then
>>> > +       union_fs_type="overlayfs"
>>> > +    elif grep -q -w "aufs" /proc/filesystems; then
>>> > +       union_fs_type="aufs"
>>> > +    else
>>> > +       union_fs_type=""
>>> > +    fi
>>> > +    # make a union mount if possible
>>> > +    case $union_fs_type in
>>> > +       "overlayfs")
>>> > +           mkdir -p /rootfs.ro /rootfs.rw
>>> > +           if ! mount -o rw,loop,noatime,nodiratime
>>> > /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
>>> > +               rm -rf /rootfs.ro /rootfs.rw
>>> > +               fatal "Could not mount rootfs image"
>>> > +           else
>>> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
>>> > +               mount -t overlayfs -o
>>> > "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT
>>> > +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
>>> > +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
>>> > +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
>>> > +           fi
>>> > +           ;;
>>> > +       "aufs")
>>> > +           mkdir -p /rootfs.ro /rootfs.rw
>>> > +           if ! mount -o rw,loop,noatime,nodiratime
>>> > /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro; then
>>> > +               rm -rf /rootfs.ro /rootfs.rw
>>> > +               fatal "Could not mount rootfs image"
>>> > +           else
>>> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
>>> > +               mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro"
>>> > aufs $ROOT_MOUNT
>>> > +               mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
>>> > +               mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
>>> > +               mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
>>> > +           fi
>>> > +           ;;
>>> > +       "")
>>> > +           if ! mount -o rw,loop,noatime,nodiratime
>>> > /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
>>> > +               fatal "Could not mount rootfs image"
>>> > +           else
>>> > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs
>>> > $ROOT_MOUNT/media
>>> > +           fi
>>> > +           ;;
>>> > +    esac
>>> > +
>>> > +    # boot the image
>>> > +    boot_live_root
>>> > +}
>>> > +
>>> > +mount_and_boot
>>> > +
>>> > +# If we're getting here, we failed...
>>> > +fatal "Installation image failed"
>>> > +
>>> > diff --git a/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>>> > b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>>> > new file mode 100644
>>> > index 0000000..9380e83
>>> > --- /dev/null
>>> > +++ b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>>> > @@ -0,0 +1,16 @@
>>> > +DESCRIPTION = "A live image init script with support for Xen"
>>> > +LICENSE = "MIT"
>>> > +LIC_FILES_CHKSUM =
>>> > "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>>> > +SRC_URI = "file://init-boot-xen.sh"
>>> > +PR = "r0"
>>> > +
>>> > +inherit allarch
>>> > +
>>> > +RDEPENDS_${PN} = "udev udev-extraconf"
>>> > +
>>> > +FILES_${PN} += " /init "
>>>
>>> I was going to ask if you are seeing any QA warnings with this, since
>>> in the past we've had
>>> to use update alternatives and priority to ensure that the right init
>>> was used in an image .. but
>>> then I noticed this is only pulled into the minimal config and there
>>> shouldn't be any conflicting
>>> init providers!
>>>
>>> Bruce
>>>
>>> > +
>>> > +do_install() {
>>> > +        install -m 0755 ${WORKDIR}/init-boot-xen.sh ${D}/init
>>> > +}
>>> > +
>>> > --
>>> > 1.7.10.4
>>> >
>>> > _______________________________________________
>>> > meta-virtualization mailing list
>>> > meta-virtualization@yoctoproject.org
>>> > https://lists.yoctoproject.org/listinfo/meta-virtualization
>>>
>>>
>>>
>>> --
>>> "Thou shalt not follow the NULL pointer, for chaos and madness await
>>> thee at its end"
>>
>>
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack.
  2013-09-01  4:41     ` Chris Patterson
  2013-09-01 14:25       ` Chris Patterson
@ 2013-09-08 22:54       ` Philip Tricca
  1 sibling, 0 replies; 18+ messages in thread
From: Philip Tricca @ 2013-09-08 22:54 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

Chris,

Do you have a meta-virt mirror where you're staging all of this? I went
through to test and build this against the master branches of oe-core
etc and had to make a few tweaks. Figured sending changes back to you
might speed this along.

Thanks,
- Philip

On 09/01/2013 12:41 AM, Chris Patterson wrote:
> The reasoning for xen-image-initramfs was that I had minor issues with
> using stock core-image-minimal-initramfs and initramfs-live-boot.
> 
> However, I have since tracked down the issue I was having with
> initramfs-live-boot, and determined we could drop initramfs-boot-xen in
> favor of initramfs-live-boot simply by adding LABEL=boot to the kernel args.
> 
> Beyond that, vanilla core-image-minimal-initramfs would hang at "Waiting
> for removeable media..." indefinitely.  After some testing, It appeared
> that adding coreutils to core-image-minimal-initramfs would resolve the
> issue (though not yet sure why, but looking into it).
> 
> 
> On Fri, Aug 30, 2013 at 1:36 AM, Bruce Ashfield
> <bruce.ashfield@gmail.com <mailto:bruce.ashfield@gmail.com>> wrote:
> 
>     On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com
>     <mailto:cjp256@gmail.com>> wrote:
>     > xen-image-initramfs: newly added initrd to support testing
>     xen-image-minimal and init script based on init-live.sh.
>     > ---
>     >  recipes-extended/images/xen-image-initramfs.bb
>     <http://xen-image-initramfs.bb>     |   17 ++
>     >  recipes-extended/images/xen-image-minimal.bb
>     <http://xen-image-minimal.bb>       |   55 +++++-
>     >  .../initrdscripts/files/init-boot-xen.sh           |  205
>     ++++++++++++++++++++
>     >  .../initrdscripts/initramfs-boot-xen_1.0.bb
>     <http://initramfs-boot-xen_1.0.bb>        |   16 ++
>     >  4 files changed, 286 insertions(+), 7 deletions(-)
>     >  create mode 100644 recipes-extended/images/xen-image-initramfs.bb
>     <http://xen-image-initramfs.bb>
>     >  create mode 100644
>     recipes-extended/initrdscripts/files/init-boot-xen.sh
>     >  create mode 100644
>     recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>     <http://initramfs-boot-xen_1.0.bb>
>     >
>     > diff --git a/recipes-extended/images/xen-image-initramfs.bb
>     <http://xen-image-initramfs.bb>
>     b/recipes-extended/images/xen-image-initramfs.bb
>     <http://xen-image-initramfs.bb>
>     > new file mode 100644
>     > index 0000000..d2f1301
>     > --- /dev/null
>     > +++ b/recipes-extended/images/xen-image-initramfs.bb
>     <http://xen-image-initramfs.bb>
>     > @@ -0,0 +1,17 @@
>     > +DESCRIPTION = "Xen image initramfs"
>     > +
>     > +IMAGE_INSTALL = "initramfs-boot-xen busybox udev udev-extraconf
>     base-passwd coreutils"
>     > +
>     > +# Do not pollute the initrd image with rootfs features
>     > +IMAGE_FEATURES = ""
>     > +
>     > +export IMAGE_BASENAME = "xen-image-initramfs"
>     > +
>     > +IMAGE_LINGUAS = ""
>     > +
>     > +LICENSE = "MIT"
>     > +
>     > +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
>     > +inherit core-image
>     > +
>     > +IMAGE_ROOTFS_SIZE = "8192"
>     > diff --git a/recipes-extended/images/xen-image-minimal.bb
>     <http://xen-image-minimal.bb>
>     b/recipes-extended/images/xen-image-minimal.bb
>     <http://xen-image-minimal.bb>
>     > index 0cf55d6..c941339 100644
>     > --- a/recipes-extended/images/xen-image-minimal.bb
>     <http://xen-image-minimal.bb>
>     > +++ b/recipes-extended/images/xen-image-minimal.bb
>     <http://xen-image-minimal.bb>
>     > @@ -1,14 +1,55 @@
>     > -DESCRIPTION = "A minimal xen image"
>     > -IMAGE_INSTALL = "packagegroup-core-boot xen-minimal dropbear mdadm"
>     > +DESCRIPTION = "Image with Xen."
>     > +
>     > +INITRD_IMAGE ?= "xen-image-initramfs"
>     > +
>     > +IMAGE_INSTALL += " \
>     > +    ${CORE_IMAGE_BASE_INSTALL} \
>     > +    packagegroup-core-basic \
>     > +    packagegroup-core-ssh-openssh \
>     > +    kernel-module-xen-acpi-processor \
>     > +    kernel-module-xen-blkback \
>     > +    kernel-module-xen-blkfront \
>     > +    kernel-module-xen-evtchn \
>     > +    kernel-module-xenfs \
>     > +    kernel-module-xen-gntalloc \
>     > +    kernel-module-xen-gntdev \
>     > +    kernel-module-xen-netback \
>     > +    kernel-module-xen-netfront \
>     > +    kernel-module-xen-pcifront \
>     > +    kernel-module-xen-privcmd \
>     > +    kernel-module-xen-wdt \
>     > +    xen-base \
>     > +    xen-qemu \
>     > +    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
>     > +    "
>     >
>     > -IMAGE_LINGUAS = " "
>     >  LICENSE = "MIT"
>     >
>     >  inherit core-image
>     >
>     > -IMAGE_ROOTFS_SIZE = "8192"
>     > +syslinux_iso_populate_append() {
>     > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
>     ${ISODIR}${ISOLINUXDIR}
>     > +}
>     > +
>     > +syslinux_hddimg_populate_append() {
>     > +       install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32
>     ${HDDDIR}${SYSLINUXDIR}
>     > +}
>     > +
>     > +grubefi_populate_append() {
>     > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
>     ${DEST}${EFIDIR}/xen.gz
>     > +}
>     > +
>     > +populate_append() {
>     > +       install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz
>     ${DEST}/xen.gz
>     > +}
>     >
>     > -# remove not needed ipkg informations
>     > -ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "
>     > +build_syslinux_cfg () {
>     > +       echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
>     > +       echo "DEFAULT boot" >> ${SYSLINUXCFG}
>     > +       echo "TIMEOUT 10" >> ${SYSLINUXCFG}
>     > +       echo "PROMPT 1" >> ${SYSLINUXCFG}
>     > +       echo "LABEL boot" >> ${SYSLINUXCFG}
>     > +       echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
>     > +       echo "  APPEND /xen.gz loglvl=all guest_loglvl=all
>     console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768
>     root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10
>     --- /initrd" >> ${SYSLINUXCFG}
>     > +}
>     >
>     > -require xen-bootimg.inc
>     > diff --git a/recipes-extended/initrdscripts/files/init-boot-xen.sh
>     b/recipes-extended/initrdscripts/files/init-boot-xen.sh
>     > new file mode 100644
>     > index 0000000..741f201
>     > --- /dev/null
>     > +++ b/recipes-extended/initrdscripts/files/init-boot-xen.sh
>     > @@ -0,0 +1,205 @@
>     > +#!/bin/sh
>     > +
>     > +PATH=/sbin:/bin:/usr/sbin:/usr/bin
>     > +
>     > +ROOT_MOUNT="/rootfs/"
>     > +ROOT_IMAGE="rootfs.img"
>     > +MOUNT="/bin/mount"
>     > +UMOUNT="/bin/umount"
>     > +ISOLINUX=""
>     > +
>     > +# Copied from initramfs-framework. The core of this script
>     probably should be
>     > +# turned into initramfs-framework modules to reduce duplication.
>     > +udev_daemon() {
>     > +       OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd
>     /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
>     > +
>     > +       for o in $OPTIONS; do
>     > +               if [ -x "$o" ]; then
>     > +                       echo $o
>     > +                       return 0
>     > +               fi
>     > +       done
>     > +
>     > +       return 1
>     > +}
>     > +
>     > +_UDEV_DAEMON=`udev_daemon`
>     > +
>     > +early_setup() {
>     > +    mkdir -p /proc
>     > +    mkdir -p /sys
>     > +    mount -t proc proc /proc
>     > +    mount -t sysfs sysfs /sys
>     > +    mount -t devtmpfs none /dev
>     > +
>     > +    # support modular kernel
>     > +    modprobe isofs 2> /dev/null
>     > +
>     > +    mkdir -p /run
>     > +    mkdir -p /var/run
>     > +    mkdir -p /media
>     > +
>     > +    $_UDEV_DAEMON --daemon
>     > +    udevadm trigger --action=add
>     > +}
>     > +
>     > +read_args() {
>     > +    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
>     > +    for arg in $CMDLINE; do
>     > +        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
>     > +        case $arg in
>     > +            root=*)
>     > +                ROOT_DEVICE=$optarg ;;
>     > +            rootfstype=*)
>     > +                modprobe $optarg 2> /dev/null ;;
>     > +            LABEL=*)
>     > +                label=$optarg ;;
>     > +            video=*)
>     > +                video_mode=$arg ;;
>     > +            vga=*)
>     > +                vga_mode=$arg ;;
>     > +            console=*)
>     > +                if [ -z "${console_params}" ]; then
>     > +                    console_params=$arg
>     > +                else
>     > +                    console_params="$console_params $arg"
>     > +                fi ;;
>     > +            debugshell*)
>     > +                if [ -z "$optarg" ]; then
>     > +                        shelltimeout=30
>     > +                else
>     > +                        shelltimeout=$optarg
>     > +                fi
>     > +        esac
>     > +    done
>     > +}
>     > +
>     > +boot_live_root() {
>     > +    # Watches the udev event queue, and exits if all current
>     events are handled
>     > +    udevadm settle --timeout=3 --quiet
>     > +    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
>     > +
>     > +    # Move the mount points of some filesystems over to
>     > +    # the corresponding directories under the real root filesystem.
>     > +    for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
>     > +        mkdir -p  ${ROOT_MOUNT}/$dir
>     > +        mount -n --move $dir ${ROOT_MOUNT}/$dir
>     > +    done
>     > +    mount -n --move /proc ${ROOT_MOUNT}/proc
>     > +    mount -n --move /sys ${ROOT_MOUNT}/sys
>     > +    mount -n --move /dev ${ROOT_MOUNT}/dev
>     > +
>     > +    cd $ROOT_MOUNT
>     > +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init
>     > +}
>     > +
>     > +fatal() {
>     > +    echo $1 >$CONSOLE
>     > +    echo >$CONSOLE
>     > +    exec sh
>     > +}
>     > +
>     > +early_setup
>     > +
>     > +[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
>     > +
>     > +read_args
>     > +
>     > +echo "Waiting for removable media..."
>     > +C=0
>     > +shelltimeout=5
>     > +while true
>     > +do
>     > +  udevadm trigger
>     > +  udevadm settle
>     > +  for i in `ls /media 2>/dev/null`; do
>     > +      if [ -f /media/$i/$ROOT_IMAGE ] ; then
>     > +               found="yes"
>     > +               break
>     > +         elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
>     > +               found="yes"
>     > +               ISOLINUX="isolinux"
>     > +               break
>     > +      fi
>     > +  done
>     > +  if [ "$found" = "yes" ]; then
>     > +      break;
>     > +  fi
>     > +  # don't wait for more than $shelltimeout seconds, if it's set
>     > +  if [ -n "$shelltimeout" ]; then
>     > +      echo -n " " $(( $shelltimeout - $C ))
>     > +      if [ $C -ge $shelltimeout ]; then
>     > +           echo "..."
>     > +          echo "Mounted filesystems"
>     > +           mount | grep media
>     > +           echo "Available block devices"
>     > +           ls /dev/sd*
>     > +           fatal "Cannot find rootfs.img file in /media/* ,
>     dropping to a shell "
>     > +      fi
>     > +      C=$(( C + 1 ))
>     > +  fi
>     > +  sleep 1
>     > +done
>     > +
>     > +# Try to make a union mount of the root image.
>     > +# If no unification filesystem is available, mount the image
>     read-only.
>     > +mount_and_boot() {
>     > +    mkdir $ROOT_MOUNT
>     > +
>     > +    mknod /dev/loop0 b 7 0 2>/dev/null
>     > +
>     > +    # determine which unification filesystem to use
>     > +    union_fs_type=""
>     > +    if grep -q -w "overlayfs" /proc/filesystems; then
>     > +       union_fs_type="overlayfs"
>     > +    elif grep -q -w "aufs" /proc/filesystems; then
>     > +       union_fs_type="aufs"
>     > +    else
>     > +       union_fs_type=""
>     > +    fi
>     > +    # make a union mount if possible
>     > +    case $union_fs_type in
>     > +       "overlayfs")
>     > +           mkdir -p /rootfs.ro <http://rootfs.ro> /rootfs.rw
>     <http://rootfs.rw>
>     > +           if ! mount -o rw,loop,noatime,nodiratime
>     /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro <http://rootfs.ro>; then
>     > +               rm -rf /rootfs.ro <http://rootfs.ro> /rootfs.rw
>     <http://rootfs.rw>
>     > +               fatal "Could not mount rootfs image"
>     > +           else
>     > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs
>     /rootfs.rw <http://rootfs.rw>
>     > +               mount -t overlayfs -o "lowerdir=/rootfs.ro
>     <http://rootfs.ro>,upperdir=/rootfs.rw <http://rootfs.rw>" overlayfs
>     $ROOT_MOUNT
>     > +               mkdir -p $ROOT_MOUNT/rootfs.ro <http://rootfs.ro>
>     $ROOT_MOUNT/rootfs.rw <http://rootfs.rw>
>     > +               mount --move /rootfs.ro <http://rootfs.ro>
>     $ROOT_MOUNT/rootfs.ro <http://rootfs.ro>
>     > +               mount --move /rootfs.rw <http://rootfs.rw>
>     $ROOT_MOUNT/rootfs.rw <http://rootfs.rw>
>     > +           fi
>     > +           ;;
>     > +       "aufs")
>     > +           mkdir -p /rootfs.ro <http://rootfs.ro> /rootfs.rw
>     <http://rootfs.rw>
>     > +           if ! mount -o rw,loop,noatime,nodiratime
>     /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs.ro <http://rootfs.ro>; then
>     > +               rm -rf /rootfs.ro <http://rootfs.ro> /rootfs.rw
>     <http://rootfs.rw>
>     > +               fatal "Could not mount rootfs image"
>     > +           else
>     > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs
>     /rootfs.rw <http://rootfs.rw>
>     > +               mount -t aufs -o "dirs=/rootfs.rw
>     <http://rootfs.rw>=rw:/rootfs.ro <http://rootfs.ro>=ro" aufs $ROOT_MOUNT
>     > +               mkdir -p $ROOT_MOUNT/rootfs.ro <http://rootfs.ro>
>     $ROOT_MOUNT/rootfs.rw <http://rootfs.rw>
>     > +               mount --move /rootfs.ro <http://rootfs.ro>
>     $ROOT_MOUNT/rootfs.ro <http://rootfs.ro>
>     > +               mount --move /rootfs.rw <http://rootfs.rw>
>     $ROOT_MOUNT/rootfs.rw <http://rootfs.rw>
>     > +           fi
>     > +           ;;
>     > +       "")
>     > +           if ! mount -o rw,loop,noatime,nodiratime
>     /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
>     > +               fatal "Could not mount rootfs image"
>     > +           else
>     > +               mount -t tmpfs -o rw,noatime,mode=755 tmpfs
>     $ROOT_MOUNT/media
>     > +           fi
>     > +           ;;
>     > +    esac
>     > +
>     > +    # boot the image
>     > +    boot_live_root
>     > +}
>     > +
>     > +mount_and_boot
>     > +
>     > +# If we're getting here, we failed...
>     > +fatal "Installation image failed"
>     > +
>     > diff --git
>     a/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>     <http://initramfs-boot-xen_1.0.bb>
>     b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>     <http://initramfs-boot-xen_1.0.bb>
>     > new file mode 100644
>     > index 0000000..9380e83
>     > --- /dev/null
>     > +++ b/recipes-extended/initrdscripts/initramfs-boot-xen_1.0.bb
>     <http://initramfs-boot-xen_1.0.bb>
>     > @@ -0,0 +1,16 @@
>     > +DESCRIPTION = "A live image init script with support for Xen"
>     > +LICENSE = "MIT"
>     > +LIC_FILES_CHKSUM =
>     "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>     > +SRC_URI = "file://init-boot-xen.sh"
>     > +PR = "r0"
>     > +
>     > +inherit allarch
>     > +
>     > +RDEPENDS_${PN} = "udev udev-extraconf"
>     > +
>     > +FILES_${PN} += " /init "
> 
>     I was going to ask if you are seeing any QA warnings with this, since
>     in the past we've had
>     to use update alternatives and priority to ensure that the right init
>     was used in an image .. but
>     then I noticed this is only pulled into the minimal config and there
>     shouldn't be any conflicting
>     init providers!
> 
>     Bruce
> 
>     > +
>     > +do_install() {
>     > +        install -m 0755 ${WORKDIR}/init-boot-xen.sh ${D}/init
>     > +}
>     > +
>     > --
>     > 1.7.10.4
>     >
>     > _______________________________________________
>     > meta-virtualization mailing list
>     > meta-virtualization@yoctoproject.org
>     <mailto:meta-virtualization@yoctoproject.org>
>     > https://lists.yoctoproject.org/listinfo/meta-virtualization
> 
> 
> 
>     --
>     "Thou shalt not follow the NULL pointer, for chaos and madness await
>     thee at its end"
> 
> 
> 
> 
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-08-30  5:32   ` Bruce Ashfield
  2013-09-01  2:12     ` Chris Patterson
@ 2013-09-09  2:23     ` Chris Patterson
  2013-09-09  3:14       ` Bruce Ashfield
  1 sibling, 1 reply; 18+ messages in thread
From: Chris Patterson @ 2013-09-09  2:23 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 4282 bytes --]

Bruce,

I'm working on a v2 of my patches and I was curious how would you like to
handle the xen kernel fragment.

Should I go back and make a patch suitable for linux-yocto and submit
there?  Or stage for meta-virtualization and submit again (with signoff and
3.10 support)?

Thanks,
-Chris


On Fri, Aug 30, 2013 at 1:32 AM, Bruce Ashfield <bruce.ashfield@gmail.com>wrote:

> On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com>
> wrote:
> > ---
> >  recipes-kernel/linux/linux-yocto/xen.cfg |   53
> ++++++++++++++++++++++++++++++
> >  recipes-kernel/linux/linux-yocto/xen.scc |    4 +++
> >  2 files changed, 57 insertions(+)
> >  create mode 100644 recipes-kernel/linux/linux-yocto/xen.cfg
> >  create mode 100644 recipes-kernel/linux/linux-yocto/xen.scc
> >
> > diff --git a/recipes-kernel/linux/linux-yocto/xen.cfg
> b/recipes-kernel/linux/linux-yocto/xen.cfg
> > new file mode 100644
> > index 0000000..f9cfb6a
> > --- /dev/null
> > +++ b/recipes-kernel/linux/linux-yocto/xen.cfg
>
> Nice. The fragment looks good. I'd actually like to bump this up to the
> level of
> in-tree support that we have for KVM.
>
> And by that, I mean that I can merge this to the meta branch of the
> linux-yocto
> kernel (and also found in the tracking yocto-kernel-cache repository).
>
> Once there, it can be built and tested standalone, as well as shared by
> other
> feature fragments. You'd then be able to just enable it via a
> KERNEL_FEATURES
> entry, just like KVM.
>
> Cheers,
>
> Bruce
>
> > @@ -0,0 +1,53 @@
> >
> +..........................................................................
> > +.                                WARNING
> > +.
> > +. This file is a kernel configuration fragment, and not a full kernel
> > +. configuration file.  The final kernel configuration is made up of
> > +. an assembly of processed fragments, each of which is designed to
> > +. capture a specific part of the final configuration (e.g. platform
> > +. configuration, feature configuration, and board specific hardware
> > +. configuration).  For more information on kernel configuration, please
> > +. consult the product documentation.
> > +.
> >
> +..........................................................................
> > +
> > +CONFIG_PARAVIRT_GUEST=y
> > +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
> > +CONFIG_XEN=y
> > +CONFIG_XEN_DOM0=y
> > +CONFIG_XEN_PRIVILEGED_GUEST=y
> > +CONFIG_XEN_PVHVM=y
> > +CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> > +CONFIG_XEN_SAVE_RESTORE=y
> > +# CONFIG_XEN_DEBUG_FS is not set
> > +CONFIG_PARAVIRT=y
> > +# CONFIG_PARAVIRT_SPINLOCKS is not set
> > +CONFIG_PARAVIRT_CLOCK=y
> > +# CONFIG_PARAVIRT_DEBUG is not set
> > +CONFIG_PCI_XEN=y
> > +CONFIG_XEN_PCIDEV_FRONTEND=m
> > +CONFIG_XEN_BLKDEV_FRONTEND=m
> > +CONFIG_XEN_BLKDEV_BACKEND=m
> > +CONFIG_XEN_NETDEV_FRONTEND=m
> > +CONFIG_XEN_NETDEV_BACKEND=m
> > +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
> > +CONFIG_HVC_XEN=y
> > +CONFIG_HVC_XEN_FRONTEND=y
> > +CONFIG_XEN_WDT=m
> > +CONFIG_XEN_FBDEV_FRONTEND=y
> > +# Xen driver support
> > +CONFIG_XEN_BALLOON=y
> > +CONFIG_XEN_SCRUB_PAGES=y
> > +CONFIG_XEN_DEV_EVTCHN=m
> > +CONFIG_XEN_BACKEND=y
> > +CONFIG_XENFS=m
> > +CONFIG_XEN_COMPAT_XENFS=y
> > +CONFIG_XEN_SYS_HYPERVISOR=y
> > +CONFIG_XEN_XENBUS_FRONTEND=y
> > +CONFIG_XEN_GNTDEV=m
> > +CONFIG_XEN_GRANT_DEV_ALLOC=m
> > +CONFIG_SWIOTLB_XEN=y
> > +CONFIG_XEN_PCIDEV_BACKEND=y
> > +CONFIG_XEN_PRIVCMD=m
> > +CONFIG_XEN_ACPI_PROCESSOR=m
> > +CONFIG_PCI_STUB=y
> > diff --git a/recipes-kernel/linux/linux-yocto/xen.scc
> b/recipes-kernel/linux/linux-yocto/xen.scc
> > new file mode 100644
> > index 0000000..6c68bda
> > --- /dev/null
> > +++ b/recipes-kernel/linux/linux-yocto/xen.scc
> > @@ -0,0 +1,4 @@
> > +define KFEATURE_DESCRIPTION "Xen Dom0 Support"
> > +define KFEATURE_COMPATIBILITY board
> > +
> > +kconf non-hardware xen.cfg
> > --
> > 1.7.10.4
> >
> > _______________________________________________
> > meta-virtualization mailing list
> > meta-virtualization@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/meta-virtualization
>
>
>
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end"
>

[-- Attachment #2: Type: text/html, Size: 5394 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support.
  2013-09-09  2:23     ` Chris Patterson
@ 2013-09-09  3:14       ` Bruce Ashfield
  0 siblings, 0 replies; 18+ messages in thread
From: Bruce Ashfield @ 2013-09-09  3:14 UTC (permalink / raw)
  To: Chris Patterson; +Cc: meta-virtualization

On Sun, Sep 8, 2013 at 10:23 PM, Chris Patterson <cjp256@gmail.com> wrote:
> Bruce,
>
> I'm working on a v2 of my patches and I was curious how would you like to
> handle the xen kernel fragment.
>
> Should I go back and make a patch suitable for linux-yocto and submit there?
> Or stage for meta-virtualization and submit again (with signoff and 3.10
> support)?

Let's keep it simple, submit everything here, and I can do the leg work to pull
it into linux-yocto as appropriate. It'll give me a goo chance to test
things as a
side effect!

Bruce

>
> Thanks,
> -Chris
>
>
> On Fri, Aug 30, 2013 at 1:32 AM, Bruce Ashfield <bruce.ashfield@gmail.com>
> wrote:
>>
>> On Thu, Aug 29, 2013 at 11:37 PM, Chris Patterson <cjp256@gmail.com>
>> wrote:
>> > ---
>> >  recipes-kernel/linux/linux-yocto/xen.cfg |   53
>> > ++++++++++++++++++++++++++++++
>> >  recipes-kernel/linux/linux-yocto/xen.scc |    4 +++
>> >  2 files changed, 57 insertions(+)
>> >  create mode 100644 recipes-kernel/linux/linux-yocto/xen.cfg
>> >  create mode 100644 recipes-kernel/linux/linux-yocto/xen.scc
>> >
>> > diff --git a/recipes-kernel/linux/linux-yocto/xen.cfg
>> > b/recipes-kernel/linux/linux-yocto/xen.cfg
>> > new file mode 100644
>> > index 0000000..f9cfb6a
>> > --- /dev/null
>> > +++ b/recipes-kernel/linux/linux-yocto/xen.cfg
>>
>> Nice. The fragment looks good. I'd actually like to bump this up to the
>> level of
>> in-tree support that we have for KVM.
>>
>> And by that, I mean that I can merge this to the meta branch of the
>> linux-yocto
>> kernel (and also found in the tracking yocto-kernel-cache repository).
>>
>> Once there, it can be built and tested standalone, as well as shared by
>> other
>> feature fragments. You'd then be able to just enable it via a
>> KERNEL_FEATURES
>> entry, just like KVM.
>>
>> Cheers,
>>
>> Bruce
>>
>> > @@ -0,0 +1,53 @@
>> >
>> > +..........................................................................
>> > +.                                WARNING
>> > +.
>> > +. This file is a kernel configuration fragment, and not a full kernel
>> > +. configuration file.  The final kernel configuration is made up of
>> > +. an assembly of processed fragments, each of which is designed to
>> > +. capture a specific part of the final configuration (e.g. platform
>> > +. configuration, feature configuration, and board specific hardware
>> > +. configuration).  For more information on kernel configuration, please
>> > +. consult the product documentation.
>> > +.
>> >
>> > +..........................................................................
>> > +
>> > +CONFIG_PARAVIRT_GUEST=y
>> > +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
>> > +CONFIG_XEN=y
>> > +CONFIG_XEN_DOM0=y
>> > +CONFIG_XEN_PRIVILEGED_GUEST=y
>> > +CONFIG_XEN_PVHVM=y
>> > +CONFIG_XEN_MAX_DOMAIN_MEMORY=500
>> > +CONFIG_XEN_SAVE_RESTORE=y
>> > +# CONFIG_XEN_DEBUG_FS is not set
>> > +CONFIG_PARAVIRT=y
>> > +# CONFIG_PARAVIRT_SPINLOCKS is not set
>> > +CONFIG_PARAVIRT_CLOCK=y
>> > +# CONFIG_PARAVIRT_DEBUG is not set
>> > +CONFIG_PCI_XEN=y
>> > +CONFIG_XEN_PCIDEV_FRONTEND=m
>> > +CONFIG_XEN_BLKDEV_FRONTEND=m
>> > +CONFIG_XEN_BLKDEV_BACKEND=m
>> > +CONFIG_XEN_NETDEV_FRONTEND=m
>> > +CONFIG_XEN_NETDEV_BACKEND=m
>> > +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
>> > +CONFIG_HVC_XEN=y
>> > +CONFIG_HVC_XEN_FRONTEND=y
>> > +CONFIG_XEN_WDT=m
>> > +CONFIG_XEN_FBDEV_FRONTEND=y
>> > +# Xen driver support
>> > +CONFIG_XEN_BALLOON=y
>> > +CONFIG_XEN_SCRUB_PAGES=y
>> > +CONFIG_XEN_DEV_EVTCHN=m
>> > +CONFIG_XEN_BACKEND=y
>> > +CONFIG_XENFS=m
>> > +CONFIG_XEN_COMPAT_XENFS=y
>> > +CONFIG_XEN_SYS_HYPERVISOR=y
>> > +CONFIG_XEN_XENBUS_FRONTEND=y
>> > +CONFIG_XEN_GNTDEV=m
>> > +CONFIG_XEN_GRANT_DEV_ALLOC=m
>> > +CONFIG_SWIOTLB_XEN=y
>> > +CONFIG_XEN_PCIDEV_BACKEND=y
>> > +CONFIG_XEN_PRIVCMD=m
>> > +CONFIG_XEN_ACPI_PROCESSOR=m
>> > +CONFIG_PCI_STUB=y
>> > diff --git a/recipes-kernel/linux/linux-yocto/xen.scc
>> > b/recipes-kernel/linux/linux-yocto/xen.scc
>> > new file mode 100644
>> > index 0000000..6c68bda
>> > --- /dev/null
>> > +++ b/recipes-kernel/linux/linux-yocto/xen.scc
>> > @@ -0,0 +1,4 @@
>> > +define KFEATURE_DESCRIPTION "Xen Dom0 Support"
>> > +define KFEATURE_COMPATIBILITY board
>> > +
>> > +kconf non-hardware xen.cfg
>> > --
>> > 1.7.10.4
>> >
>> > _______________________________________________
>> > meta-virtualization mailing list
>> > meta-virtualization@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/meta-virtualization
>>
>>
>>
>> --
>> "Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end"
>
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-09-09  3:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30  3:37 [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Chris Patterson
2013-08-30  3:37 ` [PATCH 1/4] linux-yocto: add kernel fragment and scc for xen dom0 kernel support Chris Patterson
2013-08-30  5:32   ` Bruce Ashfield
2013-09-01  2:12     ` Chris Patterson
2013-09-01  4:01       ` Bruce Ashfield
2013-09-01 14:42         ` Chris Patterson
2013-09-09  2:23     ` Chris Patterson
2013-09-09  3:14       ` Bruce Ashfield
2013-08-30  3:37 ` [PATCH 2/4] linux-yocto: add optional support for aufs and xen using DISTRO_FEATURES Chris Patterson
2013-08-30  5:34   ` Bruce Ashfield
2013-08-30  3:37 ` [PATCH 3/4] xen: add 4.3.0 recipe Chris Patterson
2013-08-30  3:37 ` [PATCH 4/4] xen-image-minimal: update image to support xen 4.3.0 base with xl toolstack Chris Patterson
2013-08-30  5:36   ` Bruce Ashfield
2013-09-01  4:41     ` Chris Patterson
2013-09-01 14:25       ` Chris Patterson
2013-09-02  3:08         ` Bruce Ashfield
2013-09-08 22:54       ` Philip Tricca
2013-08-30  5:39 ` [PATCH 0/4] xen 4.3.0 recipe and updated xen-image-minimal Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.