Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: linux-yocto: provide OpenXT Linux kernels using kernel-yocto and config fragments #1383

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions conf/distro/openxt-tip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#
# This is how bitbake will establish its configuration:
#
# require conf/abi_version.conf
# include conf/site.conf
# include conf/auto.conf
# include conf/local.conf
# include conf/build/${BUILD_SYS}.conf
# include conf/target/${TARGET_SYS}.conf
# include conf/machine/${MACHINE}.conf
# include conf/machine-sdk/${SDKMACHINE}.conf
# include conf/distro/${DISTRO}.conf
# include conf/distro/defaultsetup.conf
# include conf/documentation.conf
# include conf/licenses.conf
# require conf/sanity.conf
#

# openembedded-core sets a default list of DISTRO_FEATURES that do not match
# OpenXT's machine needs.
# See: openembedded-core/meta/conf/distro/include/default-distrovars.inc
# Another way would be hard setting DISTRO_FEATURES.
# Another way would be to redefine DISTRO_FEATURES_DEFAULT.
# Down the road this should probably be a machine config thing so it is possible
# to have images that do not include selinux
DISTRO_FEATURES_remove = "zeroconf nfs"
DISTRO_FEATURES_append += "pam selinux multiarch virtualization polkit opengl"

# Dojosdk preferred version.
PREFERRED_VERSION_dojosdk-native ?= "1.7.12"
# ${MACHINE}.conf is overriden by ${DISTRO}.conf
# xenmgr_data and sync-wui (uivm and syncui machines) apparently depends on
# different versions, so preserve that.
PREFERRED_VERSION_dojosdk-native_xenclient-syncui ?= "1.8.1"

# Prefer openssl to libressl.
PREFERRED_PROVIDER_openssl = "openssl"
PREFERRED_PROVIDER_openssl-native = "openssl-native"
PREFERRED_PROVIDER_openssl-conf = "openssl-conf"
PREFERRED_PROVIDER_nativesdk-openssl = "nativesdk-openssl"
PREFERRED_PROVIDER_nativesdk-openssl-conf = "nativesdk-openssl-conf"
# Prefer libcrypto and libssl to alternatives.
PREFERRED_PROVIDER_libcrypto = "libcrypto"
PREFERRED_PROVIDER_libssl = "libssl"

# Prefer libx11 to libx11-diet.
PREFERRED_PROVIDER_virtual/libx11 = "libx11"

# Force specific package versions
PREFERRED_VERSION_networkmanager = "1.18.4"
PREFERRED_VERSION_network-manager-applet = "1.8.22"

PREFERRED_PROVIDER_iasl = "acpica"
PREFERRED_PROVIDER_iasl-native = "${PREFERRED_PROVIDER_iasl}-native"

PREFERRED_VERSION_refpolicy-mcs = "2.20190201"

# Select our preferred providers
PREFERRED_PROVIDER_sysvinit-inittab = "sysvinit"
PREFERRED_PROVIDER_virtual/java-initial = "cacao-initial"
PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
PREFERRED_PROVIDER_jpeg-native = "jpeg-native"

# Set the preferred version to C xenstored from xen-tools
PREFERRED_PROVIDER_virtual/xenstored = "xen-tools"
PREFERRED_RPROVIDER_virtual/xenstored = "xen-tools-xenstored"
# Force exclusion of the OCaml xenstored since the above preferences
# are not sufficient to override that as the default selection:
PACKAGE_EXCLUDE += " xen-ocaml-libs-xenstored"

# The C and OCaml xenstored packages can be installed together
# and this whitelisting is necessary to allow both to be built
MULTI_PROVIDER_WHITELIST += " virtual/xenstored"

# Default to rsyslog recipe which RPROVIDES rsyslog-conf
# Dom0 and Installer install rsyslog-conf-dom0 instead.
PREFERRED_RPROVIDER_rsyslog-conf = "rsyslog"

# Default to lvm2 recipe which RPROVIDES lvm2-conf
# Initramfs and installer install lvm2-conf-initramfs and lvm2-conf-installer.
PREFERRED_RPROVIDER_lvm2-conf = "lvm2"

# Enable tui for GDB by default. This makes it easier to debug small things
# using the gdb ipk.
PACKAGECONFIG_append_pn-gdb = " tui"

# rpcgen staging and install paths.
require xc-rpcgen.inc

FILESYSTEM_PERMS_TABLES = "files/openxt-fs-perms.txt"

# Declare the MACHINE type and KERNEL image name for stubdomains
STUBDOMAIN_MACHINE ?= "openxt-stubdom"
STUBDOMAIN_KERNEL ?= "bzImage"

# Set our root home
ROOT_HOME = "/root"

# multilib is required for building Xen's hvmloader, which needs
# materials from a 32-bit libc
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

# multilib directory settings : 64-bit in /lib, 32-bit in /lib32
# as required by the OpenXT haskell toolchain
BASE_LIB_tune-core2-32 = "lib32"
BASE_LIB_tune-core2-32 = "lib32"
BASE_LIB_tune-i586 = "lib32"
BASE_LIB_tune-i686 = "lib32"
BASE_LIB_tune-x86 = "lib32"

BASE_LIB_tune-x86-64 = "lib"
BASE_LIB_tune-x86-64 = "lib"
BASE_LIB_tune-core2-64 = "lib"

BASE_LIB_tune-core2-64-x32 = "libx32"
BASE_LIB_tune-x86-64-x32 = "libx32"
1 change: 1 addition & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BBMASK = " \
meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb \
meta-virtualization/recipes-devtools/go/go-build_git.bb \
meta-virtualization/recipes-core/runx/runx_git.bb \
meta-virtualization/recipes-kernel/linux/linux-%.bbappend \
"

# We have a recipes directory, add to BBFILES
Expand Down
7 changes: 7 additions & 0 deletions conf/machine/openxt-common.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require conf/machine/include/tune-core2.inc

DEFAULTTUNE = "core2-64"

KERNEL_IMAGETYPE = "bzImage"

MACHINE_FEATURES_BACKFILL_CONSIDERED += "rtc"
31 changes: 31 additions & 0 deletions conf/machine/openxt-dom0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#@TYPE: Machine
#@NAME: xenclient-dom0
#@DESCRIPTION: Machine configuration for OpenXT dom0.

require openxt-common.conf

MACHINE_FEATURES = " \
acpi \
ethernet \
ext2 \
keyboard \
pci \
rtc \
screen \
usbhost \
x86 \
"

KERNEL_MODULE_AUTOLOAD += " \
xen-acpi-processor \
xen-gntalloc \
xen-gntdev \
xen-pciback \
xen-netfront \
"

# Use OpenXT Linux patched kernel.
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-openxt-dom0"

# Use ivc2/ivcdaemon
PREFERRED_PROVIDER_virtual/libivc = "libivc2"
23 changes: 23 additions & 0 deletions conf/machine/openxt-live-installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2010 Citrix Systems
# Copyright (C) 2018 AIS
# Released under the MIT license (see packages/COPYING)
#@TYPE: Machine
#@NAME: openxt-installer
#@DESCRIPTION: Machine configuration for OpenXT installer

require xenclient-common.conf

MACHINE_FEATURES = " \
acpi \
ethernet \
ext2 \
keyboard \
pci \
rtc \
screen \
usbhost \
x86 \
"

# Use OpenXT Linux patched kernel.
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-openxt-installer"
26 changes: 26 additions & 0 deletions conf/machine/openxt-ndvm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#@TYPE: Machine
#@NAME: openxt-ndvm
#@DESCRIPTION: Machine configuration for OpenXT NDVM.

require openxt-common.conf

MACHINE_FEATURES = " \
ethernet \
ext2 \
pci \
serial \
x86 \
"

APPEND = "root=/dev/xvda2 ro console=hvc0 iommu=soft"

USE_VT = "0"

KERNEL_MODULE_AUTOLOAD += " \
xen-gntalloc \
xen-gntdev \
xen-netback \
"

# Use OpenXT Linux patched kernel.
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-openxt-ndvm"
26 changes: 26 additions & 0 deletions conf/machine/openxt-stubdom.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#@TYPE: Machine
#@NAME: openxt-stubdom
#@DESCRIPTION: Machine configuration for OpenXT stub-domain.

require openxt-common.conf

MACHINE_FEATURES = " \
ethernet \
ext2 \
pci \
serial \
x86 \
"

USE_VT = "0"

KERNEL_MODULE_AUTOLOAD += " \
xen-gntalloc \
xen-gntdev \
"

# Use OpenXT Linux patched kernel.
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-openxt-stubdom"

# Use /dev/ivc.
PREFERRED_PROVIDER_virtual/libivc = "libivc"
24 changes: 24 additions & 0 deletions conf/machine/openxt-uivm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#@TYPE: Machine
#@NAME: openxt-uivm
#@DESCRIPTION: Machine configuration for OpenXT UIVM.

require openxt-common.conf

MACHINE_FEATURES = " \
ethernet \
ext2 \
screen \
serial \
x86 \
"

USE_VT = "0"

KERNEL_MODULE_AUTOLOAD += " \
xen-gntalloc \
xen-gntdev \
openxtfb \
"

# Use OpenXT Linux patched kernel.
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-openxt-uivm"
10 changes: 10 additions & 0 deletions recipes-core/base-files/base-files_3.%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@ dirs755_append_xenclient-dom0 = " \
/storage \
${localstatedir}/cores \
"
dirs755_append_openxt-dom0 = " \
/storage \
${localstatedir}/cores \
"
# OpenXT: UIVM has only root as user, pre-create local conf directories.
dirs755_append_xenclient-uivm = " \
/root/.gconf \
/root/.gnome2 \
/root/.cache \
/root/.ssh \
"
dirs755_append_openxt-uivm = " \
/root/.gconf \
/root/.gnome2 \
/root/.cache \
/root/.ssh \
"

volatiles = ""
conffiles = " \
Expand Down
45 changes: 45 additions & 0 deletions recipes-core/base-files/files/openxt-dom0/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# proc is presumably mounted by /etc/init.d/rcS script.
# /etc/init.d/rcS might use this file, so match this entry with
# /etc/fstab.early.
proc /proc proc nosuid,noexec,nodev 0 0

# OpenXT read-only root tmpfs:
# These have to be either absent from this file or match /etc/fstab.early
# exactly for mountearly.sh and mountall.sh to work correctly.
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
tmpfs /run tmpfs defaults,rootcontext=system_u:object_r:var_run_t:s0,size=5M 0 0
tmpfs /tmp tmpfs defaults,rootcontext=system_u:object_r:tmp_t:s0,size=100M 0 0

tmpfs /var/volatile tmpfs defaults,rootcontext=system_u:object_r:var_t:s0,size=2M 0 0
tmpfs /var/cache tmpfs defaults,rootcontext=system_u:object_r:var_t:s0,size=100M 0 0

# OpenXT read-only root:
# mountall.sh should take care of these.
rootfs / auto defaults,ro,noatime 1 1

securityfs /sys/kernel/security securityfs defaults 0 0

devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /dev/shm tmpfs mode=0777,size=1M 0 0

xenfs /proc/xen xenfs defaults 0 0

tmpfs /var/lib/ovf tmpfs defaults,rootcontext=system_u:object_r:xc_ovf_var_lib_t:s0,size=100M 0 0
tmpfs /var/lib/dbus tmpfs defaults,rootcontext=system_u:object_r:system_dbusd_var_lib_t:s0,size=1M 0 0
tmpfs /var/lib/xen tmpfs defaults,rootcontext=system_u:object_r:xend_var_lib_t:s0,size=1M 0 0

tmpfs /root/.ssh tmpfs defaults,rootcontext=system_u:object_r:ssh_home_t:s0,size=1M 0 0
tmpfs /mnt/upgrade tmpfs defaults,size=1M 0 0
ramfs /mnt/secure ramfs context=system_u:object_r:xc_secure_t:s0,size=1M 0 0

/dev/mapper/log /var/log ext4 errors=remount-ro,noatime 1 2
/dev/mapper/cores /var/cores ext4 errors=remount-ro,noatime,rootcontext=system_u:object_r:var_core_t:s0 1 3
/dev/mapper/xenclient-boot /boot/system ext4 errors=remount-ro,noatime 1 4
/dev/mapper/xenclient-storage /storage ext4 errors=remount-ro,user_xattr,noatime 1 5
/dev/mapper/swap none swap sw 0 0

# OpenXT: The following mount will fail on non-UEFI installs.
# For some reason, at boot time, that usually results in the rest of this file getting ignored.
# Having it be the last one makes it a non-issue.
efivarfs /sys/firmware/efi/efivars efivarfs ro,nosuid,nodev,noexec,noatime 0 0
12 changes: 12 additions & 0 deletions recipes-core/base-files/files/openxt-live-installer/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
proc /proc proc nosuid,noexec,nodev 0 0

sysfs /sys sysfs nosuid,noexec,nodev 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

rootfs / auto rw,defaults,noatime 1 1

securityfs /sys/kernel/security securityfs defaults 0 0
xenfs /proc/xen xenfs defaults 0 0

efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,noatime,nofail 0 0
37 changes: 37 additions & 0 deletions recipes-core/base-files/files/openxt-ndvm/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# proc is presumably mounted by /etc/init.d/rcS script.
# /etc/init.d/rcS might use this file, so match this entry with
# /etc/fstab.early.
proc /proc proc nosuid,noexec,nodev 0 0

# OpenXT read-only root tmpfs:
# These have to be either absent from this file or match /etc/fstab.early
# exactly for mountearly.sh and mountall.sh to work correctly.
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
tmpfs /run tmpfs defaults,rootcontext=system_u:object_r:var_run_t:s0,size=5M 0 0
tmpfs /tmp tmpfs defaults,rootcontext=system_u:object_r:tmp_t:s0,size=100M 0 0

tmpfs /var/volatile tmpfs defaults,rootcontext=system_u:object_r:var_t:s0,size=2M 0 0
tmpfs /var/cache tmpfs defaults,rootcontext=system_u:object_r:var_t:s0,size=100M 0 0

# OpenXT read-only root:
# mountall.sh should take care of these.
rootfs / auto defaults,ro,noatime 1 1

devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /dev/shm tmpfs mode=0777,size=1M 0 0

xenfs /proc/xen xenfs defaults 0 0

tmpfs /var/log tmpfs defaults,rootcontext=system_u:object_r:var_log_t:s0,size=10M 0 0
tmpfs /var/lib/dbus tmpfs defaults,rootcontext=system_u:object_r:system_dbusd_var_lib_t:s0,size=1M 0 0
tmpfs /var/lib/dhcp tmpfs defaults,rootcontext=system_u:object_r:dhcp_state_t:s0,size=1M 0 0
tmpfs /var/lib/NetworkManager tmpfs defaults,rootcontext=system_u:object_r:NetworkManager_var_lib_t:s0,size=1M 0 0

tmpfs /media/ram tmpfs defaults,size=1M 0 0

tmpfs /etc/NetworkManager tmpfs defaults,rootcontext=system_u:object_r:NetworkManager_etc_t:s0,size=2M 0 0
tmpfs /etc/dnsmasq-config tmpfs defaults,rootcontext=system_u:object_r:dnsmasq_etc_t:s0,size=1M 0 0
tmpfs /etc/iproute2 tmpfs defaults,rootcontext=system_u:object_r:net_conf_t:s0,size=1M 0 0

/dev/xvdb none swap sw 0 0
Loading