From 42e8b62d447f3cdd79b80dc00419a1733fd0c3ae Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 1 Sep 2023 09:16:21 +0800 Subject: agl-wireless-monitor: provide boa and basic dependency chain 1, add new feature 'agl-wireless-monitor' to help compile the project. 2, provide boa web server for project, it is fixed and configured, for more information you can go check the conf patch. 3, provide basic bb file for main program, currently some of the html files are included. Bug-AGL: SPEC-4838 Signed-off-by: Yan Change-Id: Ia870a76be602a9bc10eeed5e91873c2757a56a2a --- meta-agl-wireless-monitor/README.md | 10 ++++ .../conf/include/agl-wireless-monitor.inc | 2 + meta-agl-wireless-monitor/conf/layer.conf | 15 +++++ .../boa/boa-0.94.13/0001-boa-fix-compat.h.patch | 28 ++++++++++ ...onfigure-avoid-run-test-on-cross-platform.patch | 30 ++++++++++ .../boa-0.94.13/0001-boa-fix-icky-kernel-bug.patch | 32 +++++++++++ ...-boa-modify-conf-file-matching-AGL-system.patch | 65 ++++++++++++++++++++++ .../recipes-component/boa/boa_0.94.13.bb | 38 +++++++++++++ .../incar-wireless-monitor.bb | 20 +++++++ .../packagegroup-agl-wireless-monitor.bb | 12 ++++ .../agl-wireless-monitor/50_bblayers.conf.inc | 3 + .../feature/agl-wireless-monitor/50_local.conf.inc | 1 + 12 files changed, 256 insertions(+) create mode 100644 meta-agl-wireless-monitor/README.md create mode 100644 meta-agl-wireless-monitor/conf/include/agl-wireless-monitor.inc create mode 100644 meta-agl-wireless-monitor/conf/layer.conf create mode 100644 meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-compat.h.patch create mode 100644 meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-configure-avoid-run-test-on-cross-platform.patch create mode 100644 meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-icky-kernel-bug.patch create mode 100644 meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-modify-conf-file-matching-AGL-system.patch create mode 100644 meta-agl-wireless-monitor/recipes-component/boa/boa_0.94.13.bb create mode 100644 meta-agl-wireless-monitor/recipes-core/incar-wireless-monitor/incar-wireless-monitor.bb create mode 100644 meta-agl-wireless-monitor/recipes-platform/packagegroup/packagegroup-agl-wireless-monitor.bb create mode 100644 templates/feature/agl-wireless-monitor/50_bblayers.conf.inc create mode 100644 templates/feature/agl-wireless-monitor/50_local.conf.inc diff --git a/meta-agl-wireless-monitor/README.md b/meta-agl-wireless-monitor/README.md new file mode 100644 index 00000000..eb58c7b7 --- /dev/null +++ b/meta-agl-wireless-monitor/README.md @@ -0,0 +1,10 @@ +# AGL wireless monitor layer + +This yocto layer adds the feature 'agl-wireless-monitor' + +'agl-wireless-monitor' is used to compile the main program, 3rd +party conponents such as boa and mjpeg-streamer. + +It is a RaspberryPi 4B platform specific demo, you also need reference +hardware to motivate such a demo. + diff --git a/meta-agl-wireless-monitor/conf/include/agl-wireless-monitor.inc b/meta-agl-wireless-monitor/conf/include/agl-wireless-monitor.inc new file mode 100644 index 00000000..acf3ed60 --- /dev/null +++ b/meta-agl-wireless-monitor/conf/include/agl-wireless-monitor.inc @@ -0,0 +1,2 @@ +IMAGE_FEATURES += "agl-wireless-monitor" +FEATURE_PACKAGES_agl-wireless-monitor = "packagegroup-agl-wireless-monitor" diff --git a/meta-agl-wireless-monitor/conf/layer.conf b/meta-agl-wireless-monitor/conf/layer.conf new file mode 100644 index 00000000..9e4f91b8 --- /dev/null +++ b/meta-agl-wireless-monitor/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 += "agl-wireless-monitor" +BBFILE_PATTERN_agl-wireless-monitor = "^${LAYERDIR}/" +BBFILE_PRIORITY_agl-drm-lease = "100" + +# This should only be incremented on significant changes that will +# cause compatibility issues with other layers +LAYERVERSION_agl-wireless-monitor = "1" + +LAYERSERIES_COMPAT_agl-wireless-monitor = "kirkstone" diff --git a/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-compat.h.patch b/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-compat.h.patch new file mode 100644 index 00000000..caa0e263 --- /dev/null +++ b/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-compat.h.patch @@ -0,0 +1,28 @@ +From 2d33bc14c1ed37bcc50973740e432d6d894141b6 Mon Sep 17 00:00:00 2023 +From: Yan +Date: Fri, 25 Aug 2023 10:03:15 +0800 +Subject: [PATCH] boa: fix compat.h + +fix this grammer mistake. + +Upstream-Status: Pending +Signed-off-by: Yan +--- + src/compat.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/compat.h b/src/compat.h +index b3be2e0..31b656a 100644 +--- a/src/compat.h ++++ b/src/compat.h +@@ -117,7 +117,7 @@ char *strdup(char *s); + #endif + + #ifdef HAVE_TM_GMTOFF +-#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff ++#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff + #else + #define TIMEZONE_OFFSET(foo) timezone + #endif +-- +2.25.1 diff --git a/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-configure-avoid-run-test-on-cross-platform.patch b/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-configure-avoid-run-test-on-cross-platform.patch new file mode 100644 index 00000000..b0afccce --- /dev/null +++ b/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-fix-configure-avoid-run-test-on-cross-platform.patch @@ -0,0 +1,30 @@ +From 88d73d77794cde03f93ed53f21a163f5980696be Mon Sep 17 00:00:00 2023 +From: Yan +Date: Fri, 25 Aug 2023 09:53:43 +0800 +Subject: [PATCH] boa: fix configure avoid run test on cross platform + +during configuration, boa configure would run already +cross compiled test files on host machine, remove exit +is to ignore this run test failure. + +Upstream-Status: Pending +Signed-off-by: Yan +--- + src/configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/configure b/src/configure +index bda829f..7a6a624 100755 +--- a/src/configure ++++ b/src/configure +@@ -1552,7 +1552,7 @@ if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then +- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ++ { echo "configure: error: can not run test program while cross compiling" 1>&2; } + else + cat > conftest.$ac_ext < +Date: Fri, 25 Aug 2023 09:59:38 +0800 +Subject: [PATCH] boa: fix icky kernel bug + +Upstream-Status: Pending +comment out these DIE sentecnce to avoid crash +when you start the boa server. + +Signed-off-by: Yan +--- + src/boa.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/boa.c b/src/boa.c +index 8ce2c7b..b2f3f83 100644 +--- a/src/boa.c ++++ b/src/boa.c +@@ -222,9 +222,11 @@ static void drop_privs(void) + /* test for failed-but-return-was-successful setuid + * http://www.securityportal.com/list-archive/bugtraq/2000/Jun/0101.html + */ ++ #if 0 + if (setuid(0) != -1) { + DIE("icky Linux kernel bug!"); + } ++ #endif + } else { + if (server_gid || server_uid) { + log_error_time(); +-- +2.25.1 diff --git a/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-modify-conf-file-matching-AGL-system.patch b/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-modify-conf-file-matching-AGL-system.patch new file mode 100644 index 00000000..ce46d4e0 --- /dev/null +++ b/meta-agl-wireless-monitor/recipes-component/boa/boa-0.94.13/0001-boa-modify-conf-file-matching-AGL-system.patch @@ -0,0 +1,65 @@ +From c2396f1a329f954f37aa59d5eabda819c06e954e Mon Sep 17 00:00:00 2023 +From: Yan +Date: Fri, 25 Aug 2023 09:44:01 +0800 +Subject: [PATCH] boa: modify conf file matching AGL system + +set boa and boa_index working path to /usr/bin +error log and access log are re-directed to /var/log/ +default index reset to homepage + +Upstream-Status: Pending +Signed-off-by: Yan +--- + boa.conf | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/boa.conf b/boa.conf +index e3775db..77c9f9b 100644 +--- a/boa.conf ++++ b/boa.conf +@@ -59,7 +59,7 @@ Group nogroup + # Set to /dev/null if you don't want errors logged. + # If unset, defaults to /dev/stderr + +-ErrorLog /var/log/boa/error_log ++ErrorLog /var/log/boa_error_log + # Please NOTE: Sending the logs to a pipe ('|'), as shown below, + # is somewhat experimental and might fail under heavy load. + # "Usual libc implementations of printf will stall the whole +@@ -71,7 +71,7 @@ ErrorLog /var/log/boa/error_log + # Comment out or set to /dev/null (less effective) to disable + # Access logging. + +-AccessLog /var/log/boa/access_log ++AccessLog /var/log/boa_access_log + # Please NOTE: Sending the logs to a pipe ('|'), as shown below, + # is somewhat experimental and might fail under heavy load. + # "Usual libc implementations of printf will stall the whole +@@ -108,7 +108,7 @@ AccessLog /var/log/boa/access_log + # DocumentRoot: The root directory of the HTML documents. + # Comment out to disable server non user files. + +-DocumentRoot /var/www ++DocumentRoot /etc/boa/www + + # UserDir: The name of the directory which is appended onto a user's home + # directory if a ~user request is recieved. +@@ -120,14 +120,14 @@ UserDir public_html + # fly creation of directory indexes can be _slow_. + # Comment out to always use DirectoryMaker + +-DirectoryIndex index.html ++DirectoryIndex homepage.html + + # DirectoryMaker: Name of program used to create a directory listing. + # Comment out to disable directory listings. If both this and + # DirectoryIndex are commented out, accessing a directory will give + # an error (though accessing files in the directory are still ok). + +-DirectoryMaker /usr/lib/boa/boa_indexer ++DirectoryMaker /usr/bin/boa_indexer + + # DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker + # has been commented out, the the on-the-fly indexing of Boa can be used +-- +2.25.1 diff --git a/meta-agl-wireless-monitor/recipes-component/boa/boa_0.94.13.bb b/meta-agl-wireless-monitor/recipes-component/boa/boa_0.94.13.bb new file mode 100644 index 00000000..fbdc799c --- /dev/null +++ b/meta-agl-wireless-monitor/recipes-component/boa/boa_0.94.13.bb @@ -0,0 +1,38 @@ +SUMMARY = "Boa Web Server" +HOMEPAGE = "http://www.boa.org/" +DESCRIPTION = "Boa web server is a tiny web server." + +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://Gnu_License;md5=94d55d512a9ba36caa9b7df079bae19f" + +DEPENDS = "bison-native flex-native" + +SRC_URI = "http://www.boa.org/boa-0.94.13.tar.gz \ + file://0001-boa-fix-compat.h.patch \ + file://0001-boa-fix-configure-avoid-run-test-on-cross-platform.patch \ + file://0001-boa-fix-icky-kernel-bug.patch \ + file://0001-boa-modify-conf-file-matching-AGL-system.patch \ +" + +SRC_URI[sha256sum] = "e00bb50eb859c736f2afc913976e82e8fc68a1fbe34fa294e014aa95f4d87366" + +do_configure() { + cd ${S}/src + ./configure + sed -i '/^CC =/ s/$/& -fcommon/' Makefile +} + +do_compile() { + cd ${S}/src + oe_runmake +} + +do_install() { + install -d ${D}/usr/bin/ + install -m 0755 ${S}/src/boa ${D}/usr/bin/ + install -m 0755 ${S}/src/boa_indexer ${D}/usr/bin/ + install -d ${D}/etc/boa/ + install -m 0755 ${S}/boa.conf ${D}/etc/boa/ +} + +RDEPENDS:${PN} += "mime-support" diff --git a/meta-agl-wireless-monitor/recipes-core/incar-wireless-monitor/incar-wireless-monitor.bb b/meta-agl-wireless-monitor/recipes-core/incar-wireless-monitor/incar-wireless-monitor.bb new file mode 100644 index 00000000..1fa4dd1d --- /dev/null +++ b/meta-agl-wireless-monitor/recipes-core/incar-wireless-monitor/incar-wireless-monitor.bb @@ -0,0 +1,20 @@ +SUMMARY = "An in-car wireless monitor demo." +HOMEPAGE = "https://git.automotivelinux.org/staging/incar-wireless-monitor/" +LICENSE = "Apache-2.0" + +S = "${WORKDIR}/git" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +PN = 'incar-wireless-monitor' +PV = '1' + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/incar-wireless-monitor;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "927829c95bac0874b07b0aaee1663f42f5e59530" + +RDEPENDS:${PN} += "boa" + +do_install() { + install -d ${D}/etc/boa/www/ + install -m 0755 ${WORKDIR}/git/ui/www/*.html ${D}/etc/boa/www/ +} diff --git a/meta-agl-wireless-monitor/recipes-platform/packagegroup/packagegroup-agl-wireless-monitor.bb b/meta-agl-wireless-monitor/recipes-platform/packagegroup/packagegroup-agl-wireless-monitor.bb new file mode 100644 index 00000000..5a3c5dd7 --- /dev/null +++ b/meta-agl-wireless-monitor/recipes-platform/packagegroup/packagegroup-agl-wireless-monitor.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "AGL Wireless Monitor Group" +LICENSE = "Apache-2.0" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-agl-wireless-monitor \ +" + +RDEPENDS:${PN} += " \ + incar-wireless-monitor \ +" diff --git a/templates/feature/agl-wireless-monitor/50_bblayers.conf.inc b/templates/feature/agl-wireless-monitor/50_bblayers.conf.inc new file mode 100644 index 00000000..275ad160 --- /dev/null +++ b/templates/feature/agl-wireless-monitor/50_bblayers.conf.inc @@ -0,0 +1,3 @@ +BBLAYERS =+ " \ + ${METADIR}/meta-agl-devel/meta-agl-wireless-monitor \ +" diff --git a/templates/feature/agl-wireless-monitor/50_local.conf.inc b/templates/feature/agl-wireless-monitor/50_local.conf.inc new file mode 100644 index 00000000..748047f0 --- /dev/null +++ b/templates/feature/agl-wireless-monitor/50_local.conf.inc @@ -0,0 +1 @@ +require conf/include/agl-wireless-monitor.inc -- cgit 1.2.3-korg