From 894671b722957fb0e94851b0511cd600abadea38 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Fri, 21 Aug 2020 19:32:22 +0200 Subject: [PATCH] Meta-perinet: Initial commit Signed-off-by: Thomas Klaehn --- buildconf/genericx86-64/bblayers.conf.sample | 19 +++++++ buildconf/genericx86-64/conf-notes.txt | 3 ++ buildconf/genericx86-64/local.conf.sample | 42 ++++++++++++++++ conf/distro/perinet.conf | 42 ++++++++++++++++ conf/layer.conf | 15 ++++++ perinet-init-build-env | 49 +++++++++++++++++++ recipes-core/images/app-container-image.bb | 23 +++++++++ .../images/busybox-container-image.bb | 10 ++++ 8 files changed, 203 insertions(+) create mode 100644 buildconf/genericx86-64/bblayers.conf.sample create mode 100644 buildconf/genericx86-64/conf-notes.txt create mode 100644 buildconf/genericx86-64/local.conf.sample create mode 100644 conf/distro/perinet.conf create mode 100644 conf/layer.conf create mode 100644 perinet-init-build-env create mode 100644 recipes-core/images/app-container-image.bb create mode 100644 recipes-core/images/busybox-container-image.bb diff --git a/buildconf/genericx86-64/bblayers.conf.sample b/buildconf/genericx86-64/bblayers.conf.sample new file mode 100644 index 0000000..7e55825 --- /dev/null +++ b/buildconf/genericx86-64/bblayers.conf.sample @@ -0,0 +1,19 @@ +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "1" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ${TOPDIR}/../layers/poky/meta \ + ${TOPDIR}/../layers/poky/meta-poky \ + ${TOPDIR}/../layers/poky/meta-yocto-bsp \ + ${TOPDIR}/../layers/meta-openembedded/meta-filesystems \ + ${TOPDIR}/../layers/meta-openembedded/meta-oe \ + ${TOPDIR}/../layers/meta-openembedded/meta-networking \ + ${TOPDIR}/../layers/meta-openembedded/meta-python \ + ${TOPDIR}/../layers/meta-virtualization \ + ${TOPDIR}/../layers/meta-perinet \ + " + diff --git a/buildconf/genericx86-64/conf-notes.txt b/buildconf/genericx86-64/conf-notes.txt new file mode 100644 index 0000000..4878e37 --- /dev/null +++ b/buildconf/genericx86-64/conf-notes.txt @@ -0,0 +1,3 @@ +Common targets are: + perifirmware-buildenv-image + diff --git a/buildconf/genericx86-64/local.conf.sample b/buildconf/genericx86-64/local.conf.sample new file mode 100644 index 0000000..78d7579 --- /dev/null +++ b/buildconf/genericx86-64/local.conf.sample @@ -0,0 +1,42 @@ +MACHINE ?= "genericx86-64" + +#DL_DIR ?= "${TOPDIR}/../../downloads" +#SSTATE_DIR ?= "${TOPDIR}/../../sstate-cache" +#TMPDIR = "${TOPDIR}/tmp" + +DISTRO ?= "perinet" +PACKAGE_CLASSES ?= "package_ipk" + +#SDKMACHINE ?= "i686" + +EXTRA_IMAGE_FEATURES ?= "debug-tweaks" + +USER_CLASSES ?= "buildstats image-mklibs image-prelink" + +SERIAL_CONSOLES = "115200;ttyS0" + +PATCHRESOLVE = "noop" + +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + STOPTASKS,/tmp,100M,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K \ + ABORT,/tmp,10M,1K" + +#SSTATE_MIRRORS ?= "\ +#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ +#file://.* file:///some/local/dir/sstate/PATH" + +CONF_VERSION = "1" + +INHERIT += "rm_work" + +#INHERIT += "own-mirrors" +#SOURCE_MIRROR_URL = "https://files.blackfinn.de/mirror/sources" +#BB_GENERATE_MIRROR_TARBALLS = "1" + +export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE DL_DIR" diff --git a/conf/distro/perinet.conf b/conf/distro/perinet.conf new file mode 100644 index 0000000..bb057a3 --- /dev/null +++ b/conf/distro/perinet.conf @@ -0,0 +1,42 @@ +require conf/distro/poky.conf +# distro name +DISTRO = "perinet" +DISTRO_NAME = "perinet distribution" +DISTRO_VERSION = "1.0" +DISTRO_CODENAME = "perinet" + +# Comment out any of the lines below to disable them in the build +# DISTRO_FEATURES options: +# alsa bluetooth ext2 pcmcia usbgadget usbhost wifi nfs zeroconf pci +DISTRO_FEATURES_TINY = "largefile virtualization" +DISTRO_FEATURES_NET = "ipv4 ipv6" +#DISTRO_FEATURES_USB = "usbhost" +#DISTRO_FEATURES_WIFI = "wifi" + +DISTRO_FEATURES = " \ + ${DISTRO_FEATURES_TINY} \ + ${DISTRO_FEATURES_NET} \ + ${DISTRO_FEATURES_USB} \ + ${DISTRO_FEATURES_WIFI} \ +" + +INIT_MANAGER ?= "mdev-busybox" +#TCLIBC = "musl" +TCLIBC = "glibc" + +# Disable wide char support for ncurses as we don't include it in +# in the LIBC features below. +# Leave native enable to avoid build failures +ENABLE_WIDEC = "false" +ENABLE_WIDEC_class-native = "true" + +# Drop native language support. This removes the +# eglibc->bash->gettext->libc-posix-clang-wchar dependency. +USE_NLS="no" + +SDK_VENDOR = "-perinetdistsdk" +SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}" +MAINTAINER = "perinetdist " +INHERIT += "buildhistory" +BUILDHISTORY_COMMIT = "1" + diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..47adb11 --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,15 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += " \ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend \ +" + +BBFILE_COLLECTIONS += "meta-perinet" +BBFILE_PATTERN_meta-perinet = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-perinet = "11" + +LAYERSERIES_COMPAT_meta-perinet = "dunfell zeus warrior thud sumo rocko" + diff --git a/perinet-init-build-env b/perinet-init-build-env new file mode 100644 index 0000000..9e5190c --- /dev/null +++ b/perinet-init-build-env @@ -0,0 +1,49 @@ +function print_help { + echo "" + echo "Prepare environment for perinet-based yocto builds." + echo "" + echo "Usage:" + echo "source perinet-init-build-env " + echo "" + echo " is optional. If not specified it defaults to 'build'." + echo "" +} + +function print_config { + echo "Configuration:" + echo " MACHINE: $1" + echo " BUILD_DIR: $2" +} + + +DEFAULT_MACHINE=genericx86-64 +BUILD_DIR=build + +#print_help + +if [ -z "$MACHINE" ]; then + MACH=$DEFAULT_MACHINE +else + MACH=$MACHINE +fi + +unset MACHINE + +if [ $# -eq "1" ]; then + BUILD_DIR=$1 +fi + +print_config $MACH $BUILD_DIR + +rm -f build/conf/bblayers.conf \ + build/conf/templateconf.cfg + +mkdir -p $BUILD_DIR + +export MACHINE=$MACH +export TEMPLATECONF="../meta-perinet/buildconf/$MACHINE" + +source layers/poky/oe-init-build-env $BUILD_DIR + +return 0 + diff --git a/recipes-core/images/app-container-image.bb b/recipes-core/images/app-container-image.bb new file mode 100644 index 0000000..bdccc5d --- /dev/null +++ b/recipes-core/images/app-container-image.bb @@ -0,0 +1,23 @@ +SUMMARY = "A minimal container image" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +PREFERRED_PROVIDER_virtual/kernel = "linux-dummy" + +IMAGE_FSTYPES = "container oci" + +inherit image +inherit image-oci + +IMAGE_FEATURES = "" +IMAGE_LINGUAS = "" +NO_RECOMMENDATIONS = "1" + +IMAGE_CONTAINER_NO_DUMMY = "0" + +IMAGE_INSTALL = " \ + base-files \ + base-passwd \ + netbase \ +" + diff --git a/recipes-core/images/busybox-container-image.bb b/recipes-core/images/busybox-container-image.bb new file mode 100644 index 0000000..a050d23 --- /dev/null +++ b/recipes-core/images/busybox-container-image.bb @@ -0,0 +1,10 @@ +SUMMARY = "Busybox container image" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +require app-container-image.bb + +IMAGE_INSTALL += " \ + busybox \ +" +