diff options
Diffstat (limited to 'recipes-core')
29 files changed, 570 insertions, 32 deletions
diff --git a/recipes-core/bind/bind_virtualization.inc b/recipes-core/bind/bind_virtualization.inc index b8f0b3ff..a6e39049 100644 --- a/recipes-core/bind/bind_virtualization.inc +++ b/recipes-core/bind/bind_virtualization.inc @@ -1,4 +1,4 @@ -# Tell named not to bother listening on the IP address that lxc handles itself. -do_install_append() { - sed -i -e 's,^\( *options *{\)$,\1\n\t// lxc would take care of this address itself\n\tlisten-on { ! 10.0.3.1; any;};\n,' ${D}${sysconfdir}/bind/named.conf.options +# Tell named not to bother listening on the IP address that lxc and libvirtd handles itself. +do_install:append() { + sed -i -e 's,^\( *options *{\)$,\1\n\t// lxc and libvirtd would take care of this address itself\n\tlisten-on { ! 10.0.3.1; ! 192.168.122.1; any;};\n,' ${D}${sysconfdir}/bind/named.conf.options } diff --git a/recipes-core/busybox/busybox-initrd.bb b/recipes-core/busybox/busybox-initrd.bb new file mode 100644 index 00000000..513ed135 --- /dev/null +++ b/recipes-core/busybox/busybox-initrd.bb @@ -0,0 +1,35 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/busybox-initrd:${COREBASE}/meta/recipes-core/busybox/busybox:${COREBASE}/meta/recipes-core/busybox/files:" + +def get_busybox_pv(d): + import re + corebase = d.getVar('COREBASE') + bb_dir = os.path.join(corebase, 'meta', 'recipes-core', 'busybox') + if os.path.isdir(bb_dir): + re_bb_name = re.compile(r"busybox_([0-9.]*)\.bb") + for bb_file in os.listdir(bb_dir): + result = re_bb_name.match(bb_file) + if result: + return result.group(1) + bb.fatal("Cannot find busybox recipe in %s" % bb_dir) + +PV := "${@get_busybox_pv(d)}" + +require recipes-core/busybox/busybox_${PV}.bb + +SRC_URI += "file://init.cfg \ + file://mdev.cfg \ + file://runx.cfg \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vmsep', 'file://static.cfg', '', d)} \ + file://initrd.cfg" + +S = "${WORKDIR}/busybox-${PV}" + +# override security-flags settings, we have some warnings to ignore +SECURITY_STRINGFORMAT = "" + +# we do this to get the target binary available to recipes that +# depend on busybox +SYSROOT_DIRS += "/bin" +BUSYBOX_SPLIT_SUID = "0" + +FILES:${PN} += "${sysconfdir}/init.d/*" diff --git a/recipes-core/busybox/busybox-initrd/initrd.cfg b/recipes-core/busybox/busybox-initrd/initrd.cfg new file mode 100644 index 00000000..04896713 --- /dev/null +++ b/recipes-core/busybox/busybox-initrd/initrd.cfg @@ -0,0 +1,12 @@ +CONFIG_INIT=y +CNOFIG_FEATURE_UTMP=y +CONFIG_RUNLEVEL=y +CONFIG_FEATURE_USE_INITTAB=y +CONFIG_HALT=y +CONFIG_POWEROFF=y +CONFIG_FEATURE_KILL_DELAY=0 +CONFIG_TELINIT_PATH="" +CONFIG_INIT_TERMINAL_TYPE="" + +# CONFIG_FEATURE_SHADOWPASSWDS is not set +CONFIG_USE_BB_PWD_GRP=y diff --git a/recipes-core/busybox/busybox-initrd/runx.cfg b/recipes-core/busybox/busybox-initrd/runx.cfg new file mode 100644 index 00000000..1f1ac6af --- /dev/null +++ b/recipes-core/busybox/busybox-initrd/runx.cfg @@ -0,0 +1 @@ +CONFIG_FEATURE_INSTALLER=y diff --git a/recipes-core/busybox/busybox-initrd/static.cfg b/recipes-core/busybox/busybox-initrd/static.cfg new file mode 100644 index 00000000..25902bb7 --- /dev/null +++ b/recipes-core/busybox/busybox-initrd/static.cfg @@ -0,0 +1 @@ +CONFIG_STATIC=y diff --git a/recipes-core/busybox/busybox/nsenter.cfg b/recipes-core/busybox/busybox/nsenter.cfg new file mode 100644 index 00000000..0a58df5b --- /dev/null +++ b/recipes-core/busybox/busybox/nsenter.cfg @@ -0,0 +1 @@ +CONFIG_NSENTER=y diff --git a/recipes-core/busybox/busybox/static.cfg b/recipes-core/busybox/busybox/static.cfg new file mode 100644 index 00000000..72079a1c --- /dev/null +++ b/recipes-core/busybox/busybox/static.cfg @@ -0,0 +1,4 @@ +CONFIG_STATIC=y +CONFIG_INSTALL=y +CONFIG_FEATURE_INSTALLER=y + diff --git a/recipes-core/busybox/busybox_%.bbappend b/recipes-core/busybox/busybox_%.bbappend index 617caccb..3d39bba3 100644 --- a/recipes-core/busybox/busybox_%.bbappend +++ b/recipes-core/busybox/busybox_%.bbappend @@ -1 +1,3 @@ require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${BPN}_virtualization.inc', '', d)} +require ${@bb.utils.contains('DISTRO_FEATURES', 'vmsep', '${BPN}_vmsep.inc', '', d)} + diff --git a/recipes-core/busybox/busybox_virtualization.inc b/recipes-core/busybox/busybox_virtualization.inc index d9c4e677..652f389d 100644 --- a/recipes-core/busybox/busybox_virtualization.inc +++ b/recipes-core/busybox/busybox_virtualization.inc @@ -1,4 +1,4 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/busybox:" +FILESEXTRAPATHS:prepend := "${THISDIR}/busybox:" SRC_URI += " \ file://lspci.cfg \ @@ -7,4 +7,5 @@ SRC_URI += " \ file://mount-cifs.cfg \ file://ps-extras.cfg \ file://getopt.cfg \ + file://nsenter.cfg \ " diff --git a/recipes-core/busybox/busybox_vmsep.inc b/recipes-core/busybox/busybox_vmsep.inc new file mode 100644 index 00000000..566cd6d5 --- /dev/null +++ b/recipes-core/busybox/busybox_vmsep.inc @@ -0,0 +1,9 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/busybox:" +SRC_URI += " \ + file://static.cfg \ + " + +# we do this to get the target binary available to recipes that +# depend on busybox +SYSROOT_DIRS += "/bin" +BUSYBOX_SPLIT_SUID = "0" diff --git a/recipes-core/initscripts/initscripts_virtualization.inc b/recipes-core/initscripts/initscripts_virtualization.inc index 0600ab2a..db9c5535 100644 --- a/recipes-core/initscripts/initscripts_virtualization.inc +++ b/recipes-core/initscripts/initscripts_virtualization.inc @@ -1,4 +1,4 @@ -do_install_append() { +do_install:append() { echo >> ${D}${sysconfdir}/init.d/functions echo success \(\) \{ >> ${D}${sysconfdir}/init.d/functions diff --git a/recipes-core/kata-containers/kata-agent_git.bb b/recipes-core/kata-containers/kata-agent_git.bb index 3632ee52..de28235c 100644 --- a/recipes-core/kata-containers/kata-agent_git.bb +++ b/recipes-core/kata-containers/kata-agent_git.bb @@ -5,10 +5,12 @@ LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/agent/LICENSE;md5=86d3 GO_IMPORT = "github.com/kata-containers/agent" SRCREV = "e03f7d7453fabffb17e1540f28666c26178d3cbf" -SRC_URI = "git://${GO_IMPORT}.git \ +SRC_URI = "git://${GO_IMPORT}.git;branch=master;protocol=https \ " -RDEPENDS_${PN}-dev_append = "bash" +RDEPENDS:${PN}-dev:append = "bash" + +SKIP_RECIPE[kata-agent] ?= "kata containers are currently broken, patches accepted" S = "${WORKDIR}/git" @@ -36,4 +38,4 @@ do_install() { deltask compile_ptest_base -FILES_${PN} += "${systemd_unitdir}/*"
\ No newline at end of file +FILES:${PN} += "${systemd_unitdir}/*" diff --git a/recipes-core/kata-containers/kata-proxy_git.bb b/recipes-core/kata-containers/kata-proxy_git.bb index 8de0bfcf..d835e4d2 100644 --- a/recipes-core/kata-containers/kata-proxy_git.bb +++ b/recipes-core/kata-containers/kata-proxy_git.bb @@ -5,10 +5,13 @@ LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/proxy/LICENSE;md5=86d3 GO_IMPORT = "github.com/kata-containers/proxy" SRCREV = "1148847739f9a9f47b92e34e4f309dc109d4dba9" -SRC_URI = "git://${GO_IMPORT}.git \ +SRC_URI = "git://${GO_IMPORT}.git;branch=master;protocol=https \ " -RDEPENDS_${PN}-dev_append = "bash" + +SKIP_RECIPE[kata-proxy] ?= "kata containers are currently broken, patches accepted" + +RDEPENDS:${PN}-dev:append = "bash" S = "${WORKDIR}/git" diff --git a/recipes-core/kata-containers/kata-runtime/0001-makefile-allow-SKIP_GO_VERSION_CHECK-to-be-overriden.patch b/recipes-core/kata-containers/kata-runtime/0001-makefile-allow-SKIP_GO_VERSION_CHECK-to-be-overriden.patch new file mode 100644 index 00000000..dde63478 --- /dev/null +++ b/recipes-core/kata-containers/kata-runtime/0001-makefile-allow-SKIP_GO_VERSION_CHECK-to-be-overriden.patch @@ -0,0 +1,28 @@ +From 224fedda76bb1b741d09a129a5b43a85cb9ce182 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Wed, 7 Oct 2020 23:29:52 -0400 +Subject: [PATCH] makefile: allow SKIP_GO_VERSION_CHECK to be overriden + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 669c1bd1..4c40278a 100644 +--- a/src/github.com/kata-containers/runtime/Makefile ++++ b/src/github.com/kata-containers/runtime/Makefile +@@ -12,7 +12,7 @@ for file in /etc/os-release /usr/lib/os-release; do \ + fi \ + done) + +-SKIP_GO_VERSION_CHECK= ++#SKIP_GO_VERSION_CHECK= + include golang.mk + + #Get ARCH. +-- +2.19.1 + diff --git a/recipes-core/kata-containers/kata-runtime_git.bb b/recipes-core/kata-containers/kata-runtime_git.bb index 4f250f19..c0d7c4cb 100644 --- a/recipes-core/kata-containers/kata-runtime_git.bb +++ b/recipes-core/kata-containers/kata-runtime_git.bb @@ -4,16 +4,22 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/runtime/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" GO_IMPORT = "github.com/kata-containers/runtime" -SRCREV = "f4cf2137be58c3778d87a8ee8e258e68d1ede888" -SRC_URI = "git://${GO_IMPORT}.git \ +SRCREV = "04c77eb20e9bd603cab5c711bcbe7c69db58b040" +SRC_URI = "git://${GO_IMPORT}.git;branch=master;protocol=https \ + file://0001-makefile-allow-SKIP_GO_VERSION_CHECK-to-be-overriden.patch \ " -RDEPENDS_${PN}-dev_append = "bash" -RDEPENDS_${PN} = " \ +RDEPENDS:${PN}-dev:append = "bash" + +CONTAINER_KERNEL ?= "" +CONTAINER_INITRD ?= "" +RDEPENDS:${PN} = " \ qemu \ - hyperstart \ + ${CONTAINER_KERNEL} \ + ${CONTAINER_INITRD} \ " +DEPENDS += "yq-native" -# grpc +SKIP_RECIPE[kata-runtime] ?= "kata containers are currently broken, patches accepted" S = "${WORKDIR}/git" @@ -28,6 +34,8 @@ do_compile() { export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" cd ${S}/src/${GO_IMPORT} + + export SKIP_GO_VERSION_CHECK="1" oe_runmake runtime } @@ -36,7 +44,7 @@ do_install() { cp ${WORKDIR}/git/src/${GO_IMPORT}/kata-runtime ${D}/${bindir} mkdir -p ${D}/${datadir}/defaults/kata-containers/ - cp ${WORKDIR}/git/src/${GO_IMPORT}/cli/config/configuration.toml ${D}/${datadir}/defaults/kata-containers/ + cp ${WORKDIR}/git/src/${GO_IMPORT}/cli/config/configuration-qemu.toml ${D}/${datadir}/defaults/kata-containers/configuration.toml sed -e 's|/usr/bin/qemu-lite-system-x86_64|/usr/bin/qemu-system-x86_64|' -i ${D}/${datadir}/defaults/kata-containers/configuration.toml sed -e 's|/usr/share/kata-containers/vmlinuz.container|/var/lib/hyper/kernel|' -i ${D}/${datadir}/defaults/kata-containers/configuration.toml @@ -47,13 +55,8 @@ do_install() { # /usr/share/defaults/kata-containers/configuration.toml: file /usr/libexec/kata-containers/kata-shim does not exist # fork/exec /usr/libexec/kata-containers/kata-proxy: no such file or directory - - #64 mknod /dev/kvm c 10 232 - #68 kata-runtime --log=/dev/stdout run --bundle /opt/container/cube-server foo - - } -FILES_${PN} += "${datadir}/defaults/kata-containers/*" +FILES:${PN} += "${datadir}/defaults/kata-containers/*" deltask compile_ptest_base diff --git a/recipes-core/kata-containers/kata-shim_git.bb b/recipes-core/kata-containers/kata-shim_git.bb index fb55a8e7..8a7cb78a 100644 --- a/recipes-core/kata-containers/kata-shim_git.bb +++ b/recipes-core/kata-containers/kata-shim_git.bb @@ -5,10 +5,12 @@ LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/shim/LICENSE;md5=86d3f GO_IMPORT = "github.com/kata-containers/shim" SRCREV = "bcc35aeca3ef6fa0976005c9e93525906aefed2f" -SRC_URI = "git://${GO_IMPORT}.git \ +SRC_URI = "git://${GO_IMPORT}.git;branch=master;protocol=https \ " -RDEPENDS_${PN}-dev_append = "bash" +SKIP_RECIPE[kata-shim] ?= "kata containers are currently broken, patches accepted" + +RDEPENDS:${PN}-dev:append = "bash" S = "${WORKDIR}/git" diff --git a/recipes-core/libxcrypt/libxcrypt_%.bbappend b/recipes-core/libxcrypt/libxcrypt_%.bbappend new file mode 100644 index 00000000..55e453d9 --- /dev/null +++ b/recipes-core/libxcrypt/libxcrypt_%.bbappend @@ -0,0 +1,4 @@ +# if vmsep is in distro features, we need a static libxycryp, so we can build +# a static busybox. The end result of this is: +# EXTRA_OECONF:remove = "--disable-static" +EXTRA_OECONF:remove = "${@bb.utils.contains('DISTRO_FEATURES', 'vmsep', '--disable-static', '', d)}" diff --git a/recipes-core/meta/container-dummy-provides.bb b/recipes-core/meta/container-dummy-provides.bb new file mode 100644 index 00000000..2ab42be3 --- /dev/null +++ b/recipes-core/meta/container-dummy-provides.bb @@ -0,0 +1,6 @@ +DUMMYARCH = "container-dummy-provides" +DUMMYPROVIDES = "\ + /bin/sh \ + /usr/bin/env \ +" +require recipes-core/meta/dummy-sdk-package.inc diff --git a/recipes-core/packagegroups/packagegroup-container.bb b/recipes-core/packagegroups/packagegroup-container.bb new file mode 100644 index 00000000..4b1ad009 --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-container.bb @@ -0,0 +1,49 @@ +SUMMARY = "All packages for container host" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit packagegroup + +COMPATIBLE_HOST = "^(?!(mips|riscv)).*" + +PACKAGES = "\ + packagegroup-container \ + packagegroup-lxc \ + packagegroup-docker \ + packagegroup-oci \ + ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp ipv6', \ + 'packagegroup-podman', '', d)} \ + packagegroup-containerd \ + " + +# everything and the kitchen sink, used for building/installing +# many things at once. +RDEPENDS:${PN} = " \ + packagegroup-lxc \ + packagegroup-docker \ + packagegroup-oci \ +" + +RDEPENDS:packagegroup-lxc = " \ + lxc \ +" + +RDEPENDS:packagegroup-docker = " \ + docker \ +" + +RDEPENDS:packagegroup-podman = " \ + podman \ +" + +RDEPENDS:packagegroup-oci = " \ + virtual-runc \ + oci-systemd-hook \ + oci-runtime-tools \ + oci-image-tools \ +" + +RDEPENDS:packagegroup-containerd = " \ + virtual-containerd \ +" + diff --git a/recipes-core/packagegroups/packagegroup-kubernetes.bb b/recipes-core/packagegroups/packagegroup-kubernetes.bb new file mode 100644 index 00000000..d518fc15 --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-kubernetes.bb @@ -0,0 +1,49 @@ +SUMMARY = "packagegroups for various kubernets (and variants) roles" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit packagegroup + +COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" + +# k3s has this restriction +inherit features_check +REQUIRED_DISTRO_FEATURES ?= "seccomp" + +PACKAGES = "\ + packagegroup-kubernetes-base \ + packagegroup-k8s-host \ + packagegroup-k8s-node \ + packagegroup-k3s-host \ + packagegroup-k3s-node \ + " + +KUBERNETES_CRI ?= "containerd" + +RDEPENDS:packagegroup-kubernetes-base = " \ + packagegroup-${KUBERNETES_CRI} \ + packagegroup-oci \ +" + +RDEPENDS:packagegroup-k8s-host = " \ + packagegroup-kubernetes-base \ + kubernetes \ +" + +RDEPENDS:packagegroup-k8s-node = " \ + packagegroup-kubernetes-base \ + kubeadm \ + kubernetes-misc \ +" + +RDEPENDS:packagegroup-k3s-host = " \ + packagegroup-kubernetes-base \ + k3s-server \ + k3s-cni \ +" + +RDEPENDS:packagegroup-k3s-node = " \ + packagegroup-kubernetes-base \ + k3s-agent \ + k3s-cni \ +" diff --git a/recipes-core/runv/runv_git.bb b/recipes-core/runv/runv_git.bb index ef94f096..73cd81a6 100644 --- a/recipes-core/runv/runv_git.bb +++ b/recipes-core/runv/runv_git.bb @@ -4,7 +4,7 @@ DESCRIPTION = "Hypervisor-based Runtime for OCI" SRCREV_runv = "b360a686abc6c6e896382990ef1b93ef07c7a677" SRC_URI = "\ - git://github.com/hyperhq/runv.git;nobranch=1;name=runv \ + git://github.com/hyperhq/runv.git;nobranch=1;name=runv;protocol=https \ " LICENSE = "Apache-2.0" @@ -19,10 +19,16 @@ inherit goarch inherit pkgconfig inherit autotools-brokensep +# accord with qemu +COMPATIBLE_HOST:mipsarchn32 = "null" +COMPATIBLE_HOST:mipsarchn64 = "null" +COMPATIBLE_HOST:riscv32 = "null" +COMPATIBLE_HOST:powerpc = "null" + PACKAGECONFIG[xen] = "--with-xen,--without-xen," AUTOTOOLS_SCRIPT_PATH = "${S}/src/import/" -RDEPENDS_${PN} += " qemu hyperstart" +RDEPENDS:${PN} += " qemu hyperstart" do_compile() { export GOARCH="${TARGET_GOARCH}" @@ -76,6 +82,6 @@ do_install() { deltask compile_ptest_base -FILES_${PN} += "/usr/local/bin/*" +FILES:${PN} += "/usr/local/bin/*" -INSANE_SKIP_${PN} += "ldflags already-stripped" +INSANE_SKIP:${PN} += "ldflags already-stripped" diff --git a/recipes-core/runx/runx/0001-make-initrd-allow-externally-provided-busybox.patch b/recipes-core/runx/runx/0001-make-initrd-allow-externally-provided-busybox.patch new file mode 100644 index 00000000..3eaa4bf4 --- /dev/null +++ b/recipes-core/runx/runx/0001-make-initrd-allow-externally-provided-busybox.patch @@ -0,0 +1,57 @@ +From 4a128a3d1bc3b069ac12d3d61f79bc001340a8b7 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Fri, 26 Mar 2021 10:55:49 -0400 +Subject: [PATCH] make-initrd: allow externally provided busybox + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + initrd/make-initrd | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +diff --git a/initrd/make-initrd b/initrd/make-initrd +index 21170e8..939f71d 100755 +--- a/initrd/make-initrd ++++ b/initrd/make-initrd +@@ -35,6 +35,8 @@ then + cp $busybox_src_config .config + make -j "$(getconf _NPROCESSORS_ONLN)" + export busybox="$busybox_image" ++else ++ echo "busybox: using externally provided binary" + fi + + +@@ -48,10 +50,24 @@ mkdir -p $tmpdir/lib + mkdir -p $tmpdir/var + mkdir -p $tmpdir/mnt + cp "$busybox" $tmpdir/bin/busybox +-for i in `cat "$base"/applet-list` +-do +- ln -s /bin/busybox $tmpdir/bin/$i +-done ++ ++if [ -n "$CROSS_COMPILE" ]; then ++ echo "cross compiling, busybox --install emulation" ++ if [ -n "$QEMU_USER" ]; then ++ $QEMU_USER $tmpdir/bin/busybox --install $tmpdir/bin ++ else ++ echo "QEMU_USER is not defined, default binary symlinks will be available" ++ for i in `cat "$base"/applet-list` ++ do ++ ln -s /bin/busybox $tmpdir/bin/$i ++ done ++ fi ++else ++ for i in `cat "$base"/applet-list` ++ do ++ ln -s /bin/busybox $tmpdir/bin/$i ++ done ++fi + + mkdir -p $tmpdir/etc/init.d + cp $init $tmpdir/etc/init.d/rcS +-- +2.19.1 + diff --git a/recipes-core/runx/runx/0001-make-kernel-bump-to-v5.4.104-for-gcc10-fixes.patch b/recipes-core/runx/runx/0001-make-kernel-bump-to-v5.4.104-for-gcc10-fixes.patch new file mode 100644 index 00000000..c6f4443e --- /dev/null +++ b/recipes-core/runx/runx/0001-make-kernel-bump-to-v5.4.104-for-gcc10-fixes.patch @@ -0,0 +1,28 @@ +From 9d9bb1883e3be291df737e159c93ffcab9e55b3a Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Fri, 26 Mar 2021 10:15:24 -0400 +Subject: [PATCH] make-kernel: bump to v5.4.104 for gcc10+ fixes + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + kernel/make-kernel | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/make-kernel b/kernel/make-kernel +index 4e80b3c..a679096 100755 +--- a/kernel/make-kernel ++++ b/kernel/make-kernel +@@ -17,7 +17,7 @@ kernel_srcdir=$kernel_stuffdir/src + kernel_builddir=$kernel_stuffdir/build + kernel_out=$kernel_outpath/kernel + +-kernel_version=5.4 ++kernel_version=5.4.104 + kernel_name=linux-$kernel_version + kernel_tarball="$kernel_name".tar.xz + kernel_url=https://www.kernel.org/pub/linux/kernel/v5.x/"$kernel_tarball" +-- +2.19.1 + diff --git a/recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch b/recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch new file mode 100644 index 00000000..798f616a --- /dev/null +++ b/recipes-core/runx/runx/0001-make-kernel-cross-compilation-tweaks.patch @@ -0,0 +1,85 @@ +From 7e3498ab7c375bd545de501920acffa77eb24120 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@xilinx.com> +Date: Mon, 16 Dec 2019 20:42:04 -0800 +Subject: [PATCH] make-kernel: cross-compilation tweaks + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com> +--- + kernel/make-kernel | 41 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 33 insertions(+), 8 deletions(-) + +Index: git/kernel/make-kernel +=================================================================== +--- git.orig/kernel/make-kernel ++++ git/kernel/make-kernel +@@ -13,6 +13,7 @@ + + kernel_stuffdir=`readlink -f kernel` + kernel_outpath=$kernel_stuffdir/out ++kernel_srcdir=$kernel_stuffdir/src + kernel_builddir=$kernel_stuffdir/build + kernel_out=$kernel_outpath/kernel + +@@ -22,28 +23,52 @@ + kernel_url=https://www.kernel.org/pub/linux/kernel/v5.x/"$kernel_tarball" + kernel_src_config="$kernel_stuffdir"/cutdown-config."$ARCH" + kernel_patchesdir="$kernel_stuffdir"/patches +-kernel_image="$kernel_builddir"/"$kernel_name"/arch/"$ARCH"/boot/"$image" ++kernel_image="$kernel_builddir"/arch/"$ARCH"/boot/"$image" + ++echo "#########################" ++echo "kernel build summary:" ++echo " version: $kernel_version" ++echo " url: $kernel_url" ++echo " src dir: $kernel_srcdir" ++echo " out dir: $kernel_builddir" ++echo " artifacts: $kernel_out" ++echo " image: $image" ++echo " build vars: $build_vars" ++echo "#########################" + +-rm -rf $kernel_outpath ++if [ ! -e "$kernel_builddir/.config" ]; ++then ++ rm -rf $kernel_buildir ++fi + mkdir -p $kernel_outpath + mkdir -p $kernel_builddir ++mkdir -p $kernel_srcdir + + if [[ ! -f $kernel_builddir/$kernel_tarball ]] + then ++ echo "fetching the kernel .." + wget -O $kernel_builddir/$kernel_tarball --tries=20 $kernel_url + fi +-if [[ ! -d $kernel_builddir/$kernel_name ]] ++ ++if [[ ! -d $kernel_srcdir/$kernel_name ]] + then +- tar --extract --xz --touch --file="$kernel_builddir/$kernel_tarball" --directory="$kernel_builddir" +- cd $kernel_builddir/$kernel_name ++ echo "extracting the kernel ..." ++ echo " tar --extract --xz --touch --file=\"$kernel_builddir/$kernel_tarball\" --directory=\"$kernel_srcdir\"" ++ tar --extract --xz --touch --file="$kernel_builddir/$kernel_tarball" --directory="$kernel_srcdir" ++ cd $kernel_srcdir/$kernel_name + for i in $kernel_patchesdir/* + do + patch -p1 < $i + done + fi +-cd $kernel_builddir/$kernel_name +-cp $kernel_src_config .config +-make -j "$(getconf _NPROCESSORS_ONLN)" $image ++if [[ ! -f $kernel_builddir/.config ]] ++then ++ cp $kernel_src_config $kernel_builddir/.config ++fi ++cd $kernel_srcdir/$kernel_name ++ ++echo "building the kernel ..." ++eval make O=$kernel_builddir $build_vars oldconfig ++eval make -j "$(getconf _NPROCESSORS_ONLN)" O=$kernel_builddir $build_vars $image + + cp $kernel_image $kernel_out diff --git a/recipes-core/runx/runx_git.bb b/recipes-core/runx/runx_git.bb new file mode 100644 index 00000000..831360ba --- /dev/null +++ b/recipes-core/runx/runx_git.bb @@ -0,0 +1,126 @@ +HOMEPAGE = "https://github.com/lf-edge/runx" +SUMMARY = "runx stuff" +DESCRIPTION = "Xen Runtime for OCI" + +SRCREV_runx = "edc9350a79ede0365066c9743080e3dc6430d602" + +KERNEL_SRC_VER="linux-5.4" +KERNEL_URL_VER="v5.x" + +SRC_URI = "\ + git://github.com/lf-edge/runx;nobranch=1;name=runx;protocol=https \ + https://www.kernel.org/pub/linux/kernel/${KERNEL_URL_VER}/${KERNEL_SRC_VER}.tar.xz;destsuffix=git/kernel/build \ + file://0001-make-kernel-cross-compilation-tweaks.patch \ + file://0001-make-kernel-bump-to-v5.4.104-for-gcc10-fixes.patch \ + file://0001-make-initrd-allow-externally-provided-busybox.patch \ + " + +SRC_URI[md5sum] = "ce9b2d974d27408a61c53a30d3f98fb9" +SRC_URI[sha256sum] = "bf338980b1670bca287f9994b7441c2361907635879169c64ae78364efc5f491" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=945fc9aa694796a6337395cc291ddd8c" + +S = "${WORKDIR}/git" +PV = "v1.0-git${SRCREV_runx}" + +inherit features_check +REQUIRED_DISTRO_FEATURES = "vmsep" + +inherit pkgconfig +# for the kernel build +inherit kernel-arch + +# we have a busybox bbappend that makes /bin available to the +# sysroot, and hence gets us the target binary that we need +DEPENDS = "busybox-initrd go-build" +DEPENDS += "resolvconf" + +# for the kernel build phase +DEPENDS += "openssl-native coreutils-native util-linux-native xz-native bc-native" +DEPENDS += "elfutils-native" +DEPENDS += "qemu-native bison-native" + +RDEPENDS:${PN} += " jq bash" +RDEPENDS:${PN} += " xen-tools-xl go-build socat daemonize" +RDEPENDS:${PN} += " qemu-system-i386 ca-certificates qemu qemu-keymaps" + +RUNX_USE_INTERNAL_BUSYBOX ?= "" + +do_compile() { + # we'll need this for the initrd later, so lets error if it isn't what + # we expect (statically linked) + file ${STAGING_DIR_HOST}/bin/busybox.nosuid + + # prep steps to short circuit some of make-kernel's fetching and + # building. + mkdir -p ${S}/kernel/build + mkdir -p ${S}/kernel/src + cp ${DL_DIR}/${KERNEL_SRC_VER}.tar.xz ${S}/kernel/build/ + + # In the future, we might want to link the extracted kernel source (if + # we move patches to recipe space, but for now, we need make-kernel to + # extract a copy and possibly patch it. + # ln -sf ${WORKDIR}/${KERNEL_SRC_VER} ${S}/kernel/src/ + + # build the kernel + echo "[INFO]: runx: building the kernel" + + export KERNEL_CC="${KERNEL_CC}" + export KERNEL_LD="${KERNEL_LD}" + export ARCH="${ARCH}" + export HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" + export HOSTCPP="${BUILD_CPP}" + export CROSS_COMPILE="${CROSS_COMPILE}" + export build_vars="HOSTCC='$HOSTCC' STRIP='$STRIP' OBJCOPY='$OBJCOPY' ARCH=$ARCH CC='$KERNEL_CC' LD='$KERNEL_LD'" + + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE + + # We want make-kernel, to have the following build lines: + # make O=$kernel_builddir HOSTCC="${HOSTCC}" ARCH=$ARCH oldconfig + # make -j4 O=$kernel_builddir HOSTCC="${HOSTCC}" STRIP="$STRIP" OBJCOPY="$OBJCOPY" ARCH=$ARCH CC="$KERNEL_CC" LD="$KERNEL_LD" $image + ${S}/kernel/make-kernel + + # construct the initrd + bbnote "runx: constructing the initrd" + if [ -z "${RUNX_USE_INTERNAL_BUSYBOX}" ]; then + bbnote "runx: using external busybox" + cp ${STAGING_DIR_HOST}/bin/busybox.nosuid ${WORKDIR}/busybox + export QEMU_USER="`which qemu-${HOST_ARCH}` -L ${STAGING_BASELIBDIR}/.." + export BUSYBOX="${WORKDIR}/busybox" + export busybox="${WORKDIR}/busybox" + export CROSS_COMPILE="${TARGET_PREFIX}" + else + bbnote "runx: using internal busybox" + export CC="${CC}" + export LD="${LD}" + export CFLAGS="${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${CFLAGS}" + export LDFLAGS="${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH} ${LDFLAGS}" + export HOSTCFLAGS="${BUILD_CFLAGS} ${BUILD_LDFLAGS}" + export CROSS_COMPILE="${TARGET_PREFIX}" + fi + ${S}/initrd/make-initrd +} + +do_install() { + install -d ${D}${bindir} + install -m 755 ${S}/runX ${D}${bindir} + + install -d ${D}${datadir}/runX + install -m 755 ${S}/kernel/out/kernel ${D}/${datadir}/runX + install -m 755 ${S}/initrd/out/initrd ${D}/${datadir}/runX + install -m 755 ${S}/files/start ${D}/${datadir}/runX + install -m 755 ${S}/files/create ${D}/${datadir}/runX + install -m 755 ${S}/files/state ${D}/${datadir}/runX + install -m 755 ${S}/files/delete ${D}/${datadir}/runX + install -m 755 ${S}/files/serial_start ${D}/${datadir}/runX + + +} + +deltask compile_ptest_base + +FILES:${PN} += "${bindir}/* ${datadir}/runX/*" + +INHIBIT_PACKAGE_STRIP = "1" +INSANE_SKIP:${PN} += "ldflags already-stripped" diff --git a/recipes-core/sysvinit/files/getty-wrapper b/recipes-core/sysvinit/files/getty-wrapper new file mode 100644 index 00000000..236e29e7 --- /dev/null +++ b/recipes-core/sysvinit/files/getty-wrapper @@ -0,0 +1,8 @@ +#!/bin/sh +if test -c /dev/"$2" +then + exec /sbin/getty $* +else + exec sleep 3600d +fi + diff --git a/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend b/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend index 8c088325..1705cbc4 100644 --- a/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend +++ b/recipes-core/sysvinit/sysvinit-inittab_2.%.bbappend @@ -1 +1,2 @@ require ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'sysvinit-inittab_xen.inc', '', d)} +require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'sysvinit-inittab_virtualization.inc', '', d)} diff --git a/recipes-core/sysvinit/sysvinit-inittab_virtualization.inc b/recipes-core/sysvinit/sysvinit-inittab_virtualization.inc new file mode 100644 index 00000000..5010dfd3 --- /dev/null +++ b/recipes-core/sysvinit/sysvinit-inittab_virtualization.inc @@ -0,0 +1,9 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI += "file://getty-wrapper" + +do_install:append() { + install -d ${D}${base_sbindir} + install -m 0755 ${UNPACKDIR}/getty-wrapper ${D}${base_sbindir}/getty-wrapper +} +FILES:${PN} += "${base_sbindir}/getty-wrapper" diff --git a/recipes-core/sysvinit/sysvinit-inittab_xen.inc b/recipes-core/sysvinit/sysvinit-inittab_xen.inc index 9d0589ce..724f47dc 100644 --- a/recipes-core/sysvinit/sysvinit-inittab_xen.inc +++ b/recipes-core/sysvinit/sysvinit-inittab_xen.inc @@ -1,4 +1,10 @@ -do_install_append() { - echo "" >> ${D}${sysconfdir}/inittab - echo "X0:12345:respawn:/sbin/getty 115200 hvc0" >> ${D}${sysconfdir}/inittab + + +do_install:append() { + # if SERIAL_CONSOLES contains hvc0, it is already added in inittab so do + # not add it twice + if echo "${SERIAL_CONSOLES}" | grep -vq "hvc0"; then + echo "" >> ${D}${sysconfdir}/inittab + echo "X0:12345:respawn:${base_sbindir}/getty-wrapper 115200 hvc0" >> ${D}${sysconfdir}/inittab + fi } |