Use meta-openwrt for i.MX6 with Poky
cover Use meta-openwrt for i.MX6 with Poky
We made an experiment to build OpenWRT using meta-openwrt and Poky Dunfell on a i.MX6 Solo platform. For making it build and run we had to apply the following patches. We hope that the patches help the further development of meta-openwrt and maybe we get helpful feedback in return.
Kevin Zhang (7):
layer.conf: Add dunfell to compatible releases
netifd: Remove dependency on bridge module
base-files: Do not use /etc/group from OpenWrt
base-files: Create /run/lock directory
busybox: Supply patches for different versions
lucihttp: Add recipe
luci: Fix error module 'luci.util' not found
conf/layer.conf | 2 +-
recipes-core/netifd/netifd_git.bb | 1 -
recipes-extended/luci/luci/cmake.patch | 15 +++++-
recipes-extended/luci/luci_git.bb | 2 +-
recipes-extended/lucihttp/lucihttp.bb | 23 +++++++++
.../base-files/base-files_3.%.bbappend | 8 +++-
...t_misdetection_triggered_without_LFS.patch | 47 +++++++++++++++++++
...t_misdetection_triggered_without_LFS.patch | 0
...t_misdetection_triggered_without_LFS.patch | 46 ++++++++++++++++++
recipes-tweaks/busybox/busybox_%.bbappend | 1 -
.../busybox/busybox_1.31.%.bbappend | 7 +++
.../busybox/busybox_1.32.%.bbappend | 7 +++
.../busybox/busybox_1.33.%.bbappend | 7 +++
13 files changed, 160 insertions(+), 6 deletions(-)
create mode 100644 recipes-extended/lucihttp/lucihttp.bb
create mode 100644 recipes-tweaks/busybox/busybox-1.31.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch
rename recipes-tweaks/busybox/{busybox => busybox-1.32.%}/z300-fix_off_t_misdetection_triggered_without_LFS.patch (100%)
create mode 100644 recipes-tweaks/busybox/busybox-1.33.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch
create mode 100644 recipes-tweaks/busybox/busybox_1.31.%.bbappend
create mode 100644 recipes-tweaks/busybox/busybox_1.32.%.bbappend
create mode 100644 recipes-tweaks/busybox/busybox_1.33.%.bbappendSignature · 1 line
2.25.1
PATCH 1/7 layer.conf: Add dunfell to compatible releases
From: Kevin Zhang <[email protected]>
We add dunfell to compatible releases so that we can build a newer version of OpenWrt with dunfell.
--- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/layer.conf +1 -1
@@ -10,5 +10,5 @@ BBFILE_PRIORITY_openwrt-layer = "8" LAYERDEPENDS_openwrt-layer = "core openembedded-layer networking-layer" -LAYERSERIES_COMPAT_openwrt-layer = "gatesgarth hardknott" +LAYERSERIES_COMPAT_openwrt-layer = "dunfell gatesgarth hardknott"
Signature · 1 line
2.25.1
PATCH 2/7 netifd: Remove dependency on bridge module
In reply to Mark JonasFrom: Kevin Zhang <[email protected]>
There are kernel functions which require bridging early during boot, e.g. the DSA framework. So if bridging is always a kernel module this would force people to use an initial ramdisk for startup to load the modules at an early point in time. Now, it is in the responsibility of the user to add the bridging functionality as a kernel module or compiled into the kernel.
--- recipes-core/netifd/netifd_git.bb | 1 - 1 file changed, 1 deletion(-)
recipes-core/netifd/netifd_git.bb +0 -1
@@ -85,6 +85,5 @@ CONFFILES_${PN}_append = "\ RDEPENDS_${PN} += "\ bridge-utils \ - kernel-module-bridge \ base-files-scripts-openwrt \ "
Signature · 1 line
2.25.1
PATCH 3/7 base-files: Do not use /etc/group from OpenWrt
In reply to Mark JonasFrom: Kevin Zhang <[email protected]>
If we build this recipe with 'Poky/glibc' instead of 'openembedded-core/musl', in 'rootfspostcommands.py' the function 'sort_passwd()' will fail because '/etc/group' and '/etc/gshadow' do not match.
We delete '/etc/group', '/etc/passwd' and '/etc/shadow' from OpenWrt and thus use those files created by DISTRO.
--- recipes-tweaks/base-files/base-files_3.%.bbappend | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
recipes-tweaks/base-files/base-files_3.%.bbappend +5 -1
@@ -40,6 +40,10 @@ do_install_append () { mkdir -p ${STMP} cp -dR --preserve=mode,links ${SG}/package/base-files/files/* ${STMP}/ + rm -f ${STMP}/etc/passwd + rm -f ${STMP}/etc/shadow + rm -f ${STMP}/etc/group + # procd - earlyinit rm -f ${STMP}/etc/inittab rm -f ${STMP}/etc/preinit
@@ -134,7 +138,7 @@ do_install_append () { ln -sf /proc/mounts ${D}${sysconfdir}/mtab fi - chmod 0600 ${D}${sysconfdir}/shadow + # chmod 0600 ${D}${sysconfdir}/shadow chmod 1777 ${D}/tmp sed -i "s#%PATH%#/usr/sbin:/sbin:/usr/bin:/bin#g" \
Signature · 1 line
2.25.1
PATCH 4/7 base-files: Create /run/lock directory
In reply to Mark JonasFrom: Kevin Zhang <[email protected]>
When starting an image openwrt-image-full, the services (e.g. netifd) are not started because the '/run/lock' directory does not exist.
This patch creates directory '/run/lock' in the rootfs.
We are not sure if this is the right solution. We observed that the '/etc/fstab' contains a line to mount '/run' in tempfs. But this does not happen. Which mechanism would normally create '/run/lock' at startup?
--- recipes-tweaks/base-files/base-files_3.%.bbappend | 2 ++ 1 file changed, 2 insertions(+)
recipes-tweaks/base-files/base-files_3.%.bbappend +2 -0
@@ -131,6 +131,8 @@ do_install_append () { # FIXME: Should this change for OE? mkdir -p ${D}/overlay + mkdir -p ${D}/run/lock + # Avoid flash writes ln -sf /tmp/resolv.conf /tmp/TZ ${D}${sysconfdir}/ if [ "${@bb.utils.contains('PACKAGECONFIG', 'oeoveropenwrt', 'true', 'false', d)}" != "true" ]; then
Signature · 1 line
2.25.1
PATCH 5/7 busybox: Supply patches for different versions
In reply to Mark JonasFrom: Kevin Zhang <[email protected]>
Dunfell uses busybox 1.31, gatesgarth uses 1.32, and hardknott uses 1.33.
Add this line in 'local.conf' or 'layer.conf' to avoid build error:BB_DANGLINGAPPENDS_WARNONLY = "1"
---
...t_misdetection_triggered_without_LFS.patch | 47 +++++++++++++++++++
...t_misdetection_triggered_without_LFS.patch | 0
...t_misdetection_triggered_without_LFS.patch | 46 ++++++++++++++++++
recipes-tweaks/busybox/busybox_%.bbappend | 1 -
.../busybox/busybox_1.31.%.bbappend | 7 +++
.../busybox/busybox_1.32.%.bbappend | 7 +++
.../busybox/busybox_1.33.%.bbappend | 7 +++
7 files changed, 114 insertions(+), 1 deletion(-)
create mode 100644 recipes-tweaks/busybox/busybox-1.31.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch
rename recipes-tweaks/busybox/{busybox => busybox-1.32.%}/z300-fix_off_t_misdetection_triggered_without_LFS.patch (100%)
create mode 100644 recipes-tweaks/busybox/busybox-1.33.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch
create mode 100644 recipes-tweaks/busybox/busybox_1.31.%.bbappend
create mode 100644 recipes-tweaks/busybox/busybox_1.32.%.bbappend
create mode 100644 recipes-tweaks/busybox/busybox_1.33.%.bbappendrecipes-tweaks/busybox/busybox-1.31.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch new file +47 -0
@@ -0,0 +1,47 @@ +Author: Daniel F. Dickinson <[email protected]> +Date: Tue Jan 16 03:06:33 2018 -0500 + + busybox: Fix compilation for musl on 32-bit archs + + At least with core-image-minimal busybox triggers the recently + added off_t misdetection alert even when LFS is not enabled; + this is due to a bug in busybox handling of the case...this + patch should get upstremed. + + Signed-off-by: Daniel F. Dickinson <[email protected]> +Index: busybox-1.24.1/include/libbb.h +=================================================================== +--- busybox-1.24.1.orig/include/libbb.h ++++ busybox-1.24.1/include/libbb.h +@@ -252,6 +252,14 @@ typedef unsigned long long uoff_t; + # define STRTOOFF strtoull + # define OFF_FMT "ll" + # endif ++/* scary. better ideas? (but do *test* them first!) */ ++#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) ++/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested. ++ * We misdetected that. Don't let it build: ++ */ ++struct BUG_off_t_size_is_misdetected { ++ char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1]; ++}; + #else + /* CONFIG_LFS is off */ + # if UINT_MAX == 0xffffffff +@@ -269,15 +277,8 @@ typedef unsigned long uoff_t; + # define STRTOOFF strtol + # define OFF_FMT "l" + # endif ++#define OFF_T_MAX UINT_MAX + #endif +-/* scary. better ideas? (but do *test* them first!) */ +-#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) +-/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested. +- * We misdetected that. Don't let it build: +- */ +-struct BUG_off_t_size_is_misdetected { +- char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1]; +-}; + + /* Some useful definitions */ + #undef FALSE
recipes-tweaks/busybox/busybox-1.32.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch renamed from recipes-tweaks/busybox/busybox/z300-fix_off_t_misdetection_triggered_without_LFS.patch +0 -0
recipes-tweaks/busybox/busybox-1.33.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch new file +46 -0
46 lines not on this page · raw message
recipes-tweaks/busybox/busybox_%.bbappend +0 -1
@@ -12,7 +12,6 @@ SRC_URI += "\ file://fragment-lock.cfg \ ${@bb.utils.contains('PACKAGECONFIG', 'oeoveropenwrt', '', 'file://fragment-noifupdown.cfg', d)} \ file://220-add_lock_util.patch \ - file://z300-fix_off_t_misdetection_triggered_without_LFS.patch \ " do_install_append () {
recipes-tweaks/busybox/busybox_1.31.%.bbappend new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Bosch Sicherheitssysteme GmbH +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +SRC_URI += "file://z300-fix_off_t_misdetection_triggered_without_LFS.patch"
recipes-tweaks/busybox/busybox_1.32.%.bbappend new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Bosch Sicherheitssysteme GmbH +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +SRC_URI += "file://z300-fix_off_t_misdetection_triggered_without_LFS.patch"
recipes-tweaks/busybox/busybox_1.33.%.bbappend new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Bosch Sicherheitssysteme GmbH +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +SRC_URI += "file://z300-fix_off_t_misdetection_triggered_without_LFS.patch"
Signature · 1 line
2.25.1
PATCH 6/7 lucihttp: Add recipe
In reply to Mark JonasFrom: Kevin Zhang <[email protected]>
The latest luci depends on lucihttp library.
--- recipes-extended/luci/luci_git.bb | 2 +- recipes-extended/lucihttp/lucihttp.bb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 recipes-extended/lucihttp/lucihttp.bb
recipes-extended/luci/luci_git.bb +1 -1
@@ -7,7 +7,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9" SECTION = "base" DEPENDS = "json-c libubox libnl lua5.1 iwinfo openssl libxcrypt" -RDEPENDS_${PN} = "lua5.1" +RDEPENDS_${PN} = "lua5.1 lucihttp" SRCREV = "07d9006d239b29c9377fccb91b45eb2d0e447919"
recipes-extended/lucihttp/lucihttp.bb new file +23 -0
@@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2021 Bosch Sicherheitssysteme GmbH +# +# SPDX-License-Identifier: MIT + +DESCRIPTION = "LuCI HTTP utility library" +HOMEPAGE = "https://github.com/jow-/lucihttp" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=a6b7565d075eb26cd08b6ac739db35e3" + +DEPENDS_class-target += " lua5.1" + +SRCREV = "a34a17d501c0e23f0a91dd9d3e87697347c861ba" +SRC_URI = "git://github.com/jow-/lucihttp.git" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig openwrt-lua + +# Do not build tests +EXTRA_OECMAKE += "-DBUILD_TESTS=OFF" + +RDEPENDS_${PN} = "lua5.1"
Signature · 1 line
2.25.1
PATCH 7/7 luci: Fix error module 'luci.util' not found
In reply to Mark JonasFrom: Kevin Zhang <[email protected]>
When running the latest luci there is an error:
module 'luci.util' not found.
This commit will install the missing files.
--- recipes-extended/luci/luci/cmake.patch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
recipes-extended/luci/luci/cmake.patch +14 -1
@@ -1,6 +1,6 @@ --- /dev/null +++ b/CMakeLists.txt -@@ -0,0 +1,31 @@ +@@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.0) + +PROJECT(luci)
@@ -26,6 +26,7 @@ + +ADD_SUBDIRECTORY(modules/luci-base) +ADD_SUBDIRECTORY(modules/luci-mod-admin-full) ++ADD_SUBDIRECTORY(libs/luci-lib-base) +ADD_SUBDIRECTORY(libs/luci-lib-nixio) +ADD_SUBDIRECTORY(libs/luci-lib-ip) +ADD_SUBDIRECTORY(libs/luci-lib-jsonc)
@@ -33,6 +34,18 @@ +ADD_SUBDIRECTORY(applications/luci-app-firewall) + --- /dev/null ++++ b/libs/luci-lib-base/CMakeLists.txt +@@ -0,0 +1,9 @@ ++cmake_minimum_required(VERSION 3.0) ++ ++PROJECT(luci-lib-base C) ++ ++INSTALL(DIRECTORY luasrc/ ++ DESTINATION "${LUAPATH}/luci" ++ USE_SOURCE_PERMISSIONS ++) ++ +--- /dev/null +++ b/libs/luci-lib-ip/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.0)
Signature · 1 line
2.25.1
Quoted 28 lines · Mark Jonas
We made an experiment to build OpenWRT using meta-openwrt and Poky Dunfell on a i.MX6 Solo platform. For making it build and run we had to apply the following patches. We hope that the patches help the further development of meta-openwrt and maybe we get helpful feedback in return.
Kevin Zhang (7):
layer.conf: Add dunfell to compatible releases
netifd: Remove dependency on bridge module
base-files: Do not use/etc/groupfrom OpenWrt
base-files: Create/run/lockdirectory
busybox: Supply patches for different versions
lucihttp: Add recipe
luci: Fix error module 'luci.util' not foundconf/layer.conf | 2 +- recipes-core/netifd/netifd_git.bb | 1 - recipes-extended/luci/luci/cmake.patch | 15 +++++- recipes-extended/luci/luci_git.bb | 2 +- recipes-extended/lucihttp/lucihttp.bb | 23 +++++++++ .../base-files/base-files_3.%.bbappend | 8 +++- ...t_misdetection_triggered_without_LFS.patch | 47 +++++++++++++++++++ ...t_misdetection_triggered_without_LFS.patch | 0 ...t_misdetection_triggered_without_LFS.patch | 46 ++++++++++++++++++ recipes-tweaks/busybox/busybox_%.bbappend | 1 - .../busybox/busybox_1.31.%.bbappend | 7 +++ .../busybox/busybox_1.32.%.bbappend | 7 +++ .../busybox/busybox_1.33.%.bbappend | 7 +++ 13 files changed, 160 insertions(+), 6 deletions(-)
Quoted 8 lines
create mode 100644 recipes-extended/lucihttp/lucihttp.bb
create mode 100644 recipes-tweaks/busybox/busybox-1.31.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch rename recipes-tweaks/busybox/{busybox => busybox-1.32.%}/z300-fix_off_t_misdetection_triggered_without_LFS.patch (100%) create mode 100644 recipes-tweaks/busybox/busybox-1.33.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch create mode 100644 recipes-tweaks/busybox/busybox_1.31.%.bbappend
create mode 100644 recipes-tweaks/busybox/busybox_1.32.%.bbappend
create mode 100644 recipes-tweaks/busybox/busybox_1.33.%.bbappend
Looks good. Can you create a GH pull for this please ?