Skip to content

Commit

Permalink
Open Source Components of Create 3
Browse files Browse the repository at this point in the history
  • Loading branch information
iRobotEdu committed Oct 21, 2022
0 parents commit 08122f5
Show file tree
Hide file tree
Showing 85 changed files with 7,028 additions and 0 deletions.
168 changes: 168 additions & 0 deletions conf/distro/irobot-mt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# iRobot changes and/or questions in copied code block inline
# please refer : https://git.wardrobe.irobot.com/projects/YOCTO/repos/meta-irobot-mt/pull-requests/12/overview
# Below section code is copied from poky-tiny.conf
# location: meta-poky/conf/distro/poky-tiny.conf
# Not sure if we should also overwrite some of the configs from poky.conf
# NOTE: If by chance intended to use linux-yocto kernel and kernel major.minor
# preferred version is not set, then by default it is from poky.conf

# [IROBOT]: copied code block from poky-tiny.conf starts here

# Distribution definition for: poky-tiny
#
# Copyright (c) 2011, Intel Corporation.
# All rights reserved.
#
# This file is released under the MIT license as described in
# ../meta/COPYING.MIT.
#
# Poky-tiny is intended to define a tiny Linux system comprised of a
# Linux kernel tailored to support each specific MACHINE and busybox.
# Poky-tiny sets some basic policy to ensure a usable system while still
# keeping the rootfs and kernel image as small as possible.
#
# The policies defined are intended to meet the following goals:
# o Serial consoles only (no framebuffer or VGA console)
# o Basic support for IPV4 networking
# o Single user ash shell
# o Static images (no support for adding packages or libraries later)
# o Read-only or RAMFS root filesystem
# o Combined Linux kernel + rootfs in under 4MB
# o Allow the user to select between eglibc or uclibc with the TCLIBC variable
#
# This is currently a partial definition, the following tasks remain:
# [ ] Integrate linux-yocto-tiny ktype into linux-yocto
# [ ] Define linux-yocto-tiny configs for all supported BSPs
# [ ] Drop ldconfig from the installation
# [ ] Modify the runqemu scripts to work with ext2 parameter:
# runqemu qemux86 qemuparams="-nographic" bootparams="console=ttyS0,115200 root=0800"
# [ ] Modify busybox to allow for DISTRO_FEATURES-like confiruration

require conf/distro/poky.conf
DISTRO = "irobot-mt"
DISTROOVERRIDES = "poky:poky-tiny:irobot-mt"
TCLIBC = "musl"
# FIXME: consider adding a new "tiny" feature
#DISTRO_FEATURES_append = " tiny"

# [IROBOT]: commenting out instead of deleting
# Distro config is evaluated after the machine config, so we have to explicitly
# set the kernel provider to override a machine config.
#PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny"
#PREFERRED_VERSION_linux-yocto-tiny ?= "4.18%"

# We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny
#POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot"
# Drop kernel-module-af-packet from RRECOMMENDS
POKY_DEFAULT_EXTRA_RRECOMMENDS = ""

# FIXME: what should we do with this?
TCLIBCAPPEND = ""

# 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"

# [IROBOT]: commenting out instead of deleting. We are including ipv4, ipv6 in
# machine conf file.
# May not be required for every machine ipv4, ipv6?
# keep usbhost and enable wifi
# we should look into pci requirements
# Comment out any of the lines below to disable them in the build
# DISTRO_FEATURES options:
# alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci
#DISTRO_FEATURES_TINY = "pci"
#DISTRO_FEATURES_NET = "ipv4 ipv6"
DISTRO_FEATURES_USB = "usbhost"
#DISTRO_FEATURES_USBGADGET = "usbgadget"
DISTRO_FEATURES_WIFI = "wifi"

DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \
${DISTRO_FEATURES_NET} \
${DISTRO_FEATURES_USB} \
${DISTRO_FEATURES_USBGADGET} \
${DISTRO_FEATURES_WIFI} \
"

# [IROBOT]: TODO: Do we really need to consider uclibc?
# Enable LFS - see bug YOCTO #5865
DISTRO_FEATURES_append_libc-uclibc = " largefile"
DISTRO_FEATURES_append_libc-musl = " largefile"

DISTRO_FEATURES_class-native = "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
DISTRO_FEATURES_class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"

# enable mdev/busybox for init
VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
VIRTUAL-RUNTIME_login_manager = "busybox"
VIRTUAL-RUNTIME_init_manager = "busybox"
VIRTUAL-RUNTIME_initscripts = "initscripts"
VIRTUAL-RUNTIME_keymaps = "keymaps"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"

# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in
# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and
# netbase.

# [IROBOT]: Commenting out IMAGE_FSTYPES, QB_DEFAULT_FSTYPE as we don't build
# QEMUeable image
# By default we only support initramfs. We don't build live as that
# pulls in a lot of dependencies for the live image and the installer, like
# udev, grub, etc. These pull in gettext, which fails to build with wide
# character support.
#IMAGE_FSTYPES = "cpio.gz"

#QB_DEFAULT_FSTYPE = "${IMAGE_FSTYPES}"

# Drop v86d from qemu dependency list (we support serial)
# Drop grub from meta-intel BSPs
# FIXME: A different mechanism is needed here. We could define -tiny
# variants of all compatible machines, but that leads to a lot
# more machine configs to maintain long term.
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""

# [IROBOT]: we are not using eglibc. do we really need this?
# The mtrace script included by eglibc is a perl script. This means the system
# will build perl in case this package is installed. Since we don't care about
# this script for the purposes of tiny, remove the dependency from here.
RDEPENDS_${PN}-mtrace_pn-eglibc = ""

# [IROBOT]: change from poky-tiny to irobot-mt to avoid confusion on distro
# incompatibility.

PNBLACKLIST[build-appliance-image] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-base] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-clutter] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-full-cmdline] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-lsb] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-lsb-dev] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-lsb-sdk] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-rt] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-rt-sdk] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-sato] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-sato-dev] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-sato-sdk] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-x11] = "not buildable with irobot-mt"
PNBLACKLIST[core-image-weston] = "not buildable with irobot-mt"

# Disable python usage in opkg-utils since it won't build with tiny config
PACKAGECONFIG_remove_pn-opkg-utils = "python"

# [IROBOT]: copied code block from poky-tiny.conf ends here

DISTRO_NAME = "iRobot distro for Mediatek Hardware"
DISTRO_VERSION = "0.2"

# Distro config is evaluated after the machine config, so perform a softer
# assignment for default kernel for current distro
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-mt7688"
PREFERRED_VERSION_linux-yocto-mt7688 ?= "4.14%"

######## The updated sudo version 1.8.32 has fixed for CVE-2021-3156 ##########
PREFERRED_VERSION_sudo="1.8.32"
11 changes: 11 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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 += "irobot-mt"
BBFILE_PATTERN_irobot-mt = "^${LAYERDIR}/"
BBFILE_PRIORITY_irobot-mt = "6"
LAYERSERIES_COMPAT_irobot-mt = "thud warrior"
155 changes: 155 additions & 0 deletions recipes-connectivity/bluez5/bluez5.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
SUMMARY = "Linux Bluetooth Stack Userland V5"
DESCRIPTION = "Linux Bluetooth stack V5 userland components. These include a system configurations, daemons, tools and system libraries."
HOMEPAGE = "http://www.bluez.org"
SECTION = "libs"
LICENSE = "GPLv2+ & LGPLv2.1+"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
file://src/main.c;beginline=1;endline=24;md5=0ad83ca0dc37ab08af448777c581e7ac"
DEPENDS = "dbus glib-2.0"
PROVIDES += "bluez-hcidump"
RPROVIDES_${PN} += "bluez-hcidump"

RCONFLICTS_${PN} = "bluez4"

PACKAGECONFIG ??= "obex-profiles \
readline \
${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
a2dp-profiles \
avrcp-profiles \
network-profiles \
hid-profiles \
hog-profiles \
tools \
deprecated \
udev \
"
PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
PACKAGECONFIG[testing] = "--enable-testing,--disable-testing"
PACKAGECONFIG[midi] = "--enable-midi,--disable-midi,alsa-lib"
PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd"
PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,,cups"
PACKAGECONFIG[nfc] = "--enable-nfc,--disable-nfc"
PACKAGECONFIG[sap-profiles] = "--enable-sap,--disable-sap"
PACKAGECONFIG[a2dp-profiles] = "--enable-a2dp,--disable-a2dp"
PACKAGECONFIG[avrcp-profiles] = "--enable-avrcp,--disable-avrcp"
PACKAGECONFIG[network-profiles] = "--enable-network,--disable-network"
PACKAGECONFIG[hid-profiles] = "--enable-hid,--disable-hid"
PACKAGECONFIG[hog-profiles] = "--enable-hog,--disable-hog"
PACKAGECONFIG[health-profiles] = "--enable-health,--disable-health"
PACKAGECONFIG[sixaxis] = "--enable-sixaxis,--disable-sixaxis"
PACKAGECONFIG[tools] = "--enable-tools,--disable-tools"
PACKAGECONFIG[threads] = "--enable-threads,--disable-threads"
PACKAGECONFIG[deprecated] = "--enable-deprecated,--disable-deprecated"
PACKAGECONFIG[mesh] = "--enable-mesh --enable-external-ell,--disable-mesh, json-c ell"
PACKAGECONFIG[btpclient] = "--enable-btpclient --enable-external-ell,--disable-btpclient, ell"
PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,python3-docutils-native"

SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
file://init \
file://run-ptest \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
file://0001-test-gatt-Fix-hung-issue.patch \
"
S = "${WORKDIR}/bluez-${PV}"

CVE_PRODUCT = "bluez"

inherit autotools pkgconfig systemd update-rc.d ptest gobject-introspection-data

EXTRA_OECONF = "\
--enable-test \
--enable-datafiles \
--enable-library \
--without-zsh-completion-dir \
"

# bluez5 builds a large number of useful utilities but does not
# install them. Specify which ones we want put into ${PN}-noinst-tools.
NOINST_TOOLS_READLINE ??= ""
NOINST_TOOLS_TESTING ??= ""
NOINST_TOOLS_BT ??= ""
NOINST_TOOLS = " \
${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'testing', '${NOINST_TOOLS_TESTING}', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'tools', '${NOINST_TOOLS_BT}', '', d)} \
"

do_install_append() {
install -d ${D}${INIT_D_DIR}
install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth

install -d ${D}${sysconfdir}/bluetooth/
if [ -f ${S}/profiles/network/network.conf ]; then
install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
fi
if [ -f ${S}/profiles/input/input.conf ]; then
install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
fi

if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
fi

# Install desired tools that upstream leaves in build area
for f in ${NOINST_TOOLS} ; do
install -m 755 ${B}/$f ${D}/${bindir}
done

# Patch python tools to use Python 3; they should be source compatible, but
# still refer to Python 2 in the shebang
sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/*
}

PACKAGES =+ "${PN}-testtools ${PN}-obex ${PN}-noinst-tools"

FILES_${PN} += " \
${libdir}/bluetooth/plugins/*.so \
${systemd_unitdir}/ ${datadir}/dbus-1 \
${libdir}/cups \
"
FILES_${PN}-dev += " \
${libdir}/bluetooth/plugins/*.la \
"

FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
${exec_prefix}/lib/systemd/user/obex.service \
${systemd_system_unitdir}/obex.service \
${sysconfdir}/systemd/system/multi-user.target.wants/obex.service \
${datadir}/dbus-1/services/org.bluez.obex.service \
${sysconfdir}/dbus-1/system.d/obexd.conf \
"
SYSTEMD_SERVICE_${PN}-obex = "obex.service"

FILES_${PN}-testtools = "${libdir}/bluez/test/*"

def get_noinst_tools_paths (d, bb, tools):
s = list()
bindir = d.getVar("bindir")
for bdp in tools.split():
f = os.path.basename(bdp)
s.append("%s/%s" % (bindir, f))
return "\n".join(s)

FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"

RDEPENDS_${PN}-testtools += "python3-core python3-dbus"
RDEPENDS_${PN}-testtools += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}"

SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluetooth.service', '', d)}"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "bluetooth"

do_compile_ptest() {
oe_runmake buildtests
}

do_install_ptest() {
cp -r ${B}/unit/ ${D}${PTEST_PATH}
rm -f ${D}${PTEST_PATH}/unit/*.o
}

RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-utf-16"
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From f74eb97c9fb3c0ee2895742e773ac6a3c41c999c Mon Sep 17 00:00:00 2001
From: Giovanni Campagna <[email protected]>
Date: Sat, 12 Oct 2013 17:45:25 +0200
Subject: [PATCH] Allow using obexd without systemd in the user session

Not all sessions run systemd --user (actually, the majority
doesn't), so the dbus daemon must be able to spawn obexd
directly, and to do so it needs the full path of the daemon.

Upstream-Status: Denied

Not accepted by upstream maintainer for being a distro specific
configuration. See thread:

http://thread.gmane.org/gmane.linux.bluez.kernel/38725/focus=38843

Signed-off-by: Javier Viguera <[email protected]>

---
Makefile.obexd | 4 ++--
.../src/{org.bluez.obex.service => org.bluez.obex.service.in} | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (76%)

diff --git a/Makefile.obexd b/Makefile.obexd
index de59d29..73004a3 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -1,12 +1,12 @@
if SYSTEMD
systemduserunitdir = $(SYSTEMD_USERUNITDIR)
systemduserunit_DATA = obexd/src/obex.service
+endif

dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
dbussessionbus_DATA = obexd/src/org.bluez.obex.service
-endif

-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in

if OBEX

diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
similarity index 76%
rename from obexd/src/org.bluez.obex.service
rename to obexd/src/org.bluez.obex.service.in
index a538088..9c815f2 100644
--- a/obexd/src/org.bluez.obex.service
+++ b/obexd/src/org.bluez.obex.service.in
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.bluez.obex
-Exec=/bin/false
+Exec=@libexecdir@/obexd
SystemdService=dbus-org.bluez.obex.service
Loading

0 comments on commit 08122f5

Please sign in to comment.