Re: [isar-cip-core][RFC PATCH] customizations: Add FW and tools required for wifi testing


Jan Kiszka
 

On 22.11.21 18:37, Prabhakar Mahadev Lad wrote:
Hi Jan,

Thank you for the quick response.

-----Original Message-----
From: Jan Kiszka <jan.kiszka@siemens.com>
Sent: 22 November 2021 11:28
To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; cip-dev@lists.cip-project.org;
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek <pavel@denx.de>
Subject: Re: [cip-dev][isar-cip-core][RFC PATCH] customizations: Add FW and tools required for wifi
testing

On 22.11.21 12:19, Lad Prabhakar wrote:
Add firmware and tools required for testing wifin on hihope-rzg2m.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
Hi All,

Sending an RFC as I am not sure if this is the right place to add
this. I wanted to add the debian package depends in machine.conf file
but didnt find any variables.
IMAGE_INSTALL_append would work there, see eg.
https://github.com/siemens/jailhouse-
images%2Fblob%2Fmaster%2Fconf%2Fmachine%2Frpi4.conf&amp;data=04%7C01%7Cprabhakar.mahadev-
lad.rj%40bp.renesas.com%7Cae2601f49f5b4725b1ab08d9adab1943%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%
7C637731772644808211%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
CI6Mn0%3D%7C3000&amp;sdata=mqp0wknGyxKyY82YvgHJXl72aTu4DWSuUOHcaZPo8xA%3D&amp;reserved=0.
Adding IMAGE_INSTALL/IMAGE_PREINSTALL machine.conf didn’t help for me, I was seeing below issues:

| ERROR: Nothing PROVIDES 'wireless-regdb' (but /repo/recipes-core/images/cip-core-image.bb DEPENDS on or otherwise requires it)
| ERROR: Required build target 'cip-core-image' has no buildable providers.
| Missing or unbuildable dependency chain was: ['cip-core-image', 'wireless-regdb']

| ERROR: Nothing PROVIDES 'wireless-tools' (but /repo/recipes-core/images/cip-core-image.bb DEPENDS on or otherwise requires it)
| ERROR: Required build target 'cip-core-image' has no buildable providers.
| Missing or unbuildable dependency chain was: ['cip-core-image', 'wireless-tools']

| ERROR: Nothing PROVIDES 'firmware-ti-connectivity' (but /repo/recipes-core/images/cip-core-image.bb DEPENDS on or otherwise requires it)
| ERROR: Required build target 'cip-core-image' has no buildable providers.
| Missing or unbuildable dependency chain was: ['cip-core-image', 'firmware-ti-connectivity']

| ERROR: Nothing PROVIDES 'iw' (but /repo/recipes-core/images/cip-core-image.bb DEPENDS on or otherwise requires it)
| ERROR: Required build target 'cip-core-image' has no buildable providers.
| Missing or unbuildable dependency chain was: ['cip-core-image', 'iw']

As above didn’t work and customizations.bb is the only place were I was able to grep for DEBIAN_DEPENDS variable I went this approach 😉.
(Note also adding DEBIAN_DEPENDS in machine.conf didn’t work.)

Is there something which I am missing that would make it work with IMAGE_INSTALL_append variable?
DEBIAN_DEPENDS is the wrong variable to touch at global configuration
level. As in the references example, you need to extend the
IMAGE_PREINSTALL (for Debian packages; IMAGE_INSTALL would be for
self-built ones):

diff --git a/conf/machine/hihope-rzg2m.conf b/conf/machine/hihope-rzg2m.conf
index a2ae03d..4c611ae 100644
--- a/conf/machine/hihope-rzg2m.conf
+++ b/conf/machine/hihope-rzg2m.conf
@@ -17,3 +17,5 @@ KERNEL_DEFCONFIG = "cip-kernel-config/4.19.y-cip/arm64/renesas_defconfig"
USE_CIP_KERNEL_CONFIG = "1"
DTB_FILES = "r8a774a1-hihope-rzg2m-ex.dtb"
IMAGE_BOOT_FILES = "${KERNEL_IMAGE} ${DTB_FILES}"
+
+IMAGE_PREINSTALL_append = " firmware-ti-connectivity"


Whether we want to "hard-code" the installation wireless firmware in the machine conf here is a
different question. Maybe customizations is not that a bad place.
If adding IMAGE_INSTALL_append works in machine.conf, will go with this approach, as that would not disturb other platform builds.
You would still have to add/request the generic wireless tools
somewhere. For that, you either need to touch the customization package
(DEBIAN_DEPENDS) or directly expand the IMAGE_PREINSTALL list in
cip-core-image.bb. How about this pattern?

diff --git a/conf/machine/hihope-rzg2m.conf b/conf/machine/hihope-rzg2m.conf
index a2ae03d..4f4ee81 100644
--- a/conf/machine/hihope-rzg2m.conf
+++ b/conf/machine/hihope-rzg2m.conf
@@ -17,3 +17,6 @@ KERNEL_DEFCONFIG = "cip-kernel-config/4.19.y-cip/arm64/renesas_defconfig"
USE_CIP_KERNEL_CONFIG = "1"
DTB_FILES = "r8a774a1-hihope-rzg2m-ex.dtb"
IMAGE_BOOT_FILES = "${KERNEL_IMAGE} ${DTB_FILES}"
+
+WIRELESS_FIRMWARE_PACKAGE = "firmware-ti-connectivity"
+INSTALL_WIRELESS_TOOLS ?= "1"
diff --git a/recipes-core/customizations/customizations.bb b/recipes-core/customizations/customizations.bb
index 932b11c..1c2a125 100644
--- a/recipes-core/customizations/customizations.bb
+++ b/recipes-core/customizations/customizations.bb
@@ -18,10 +18,15 @@ SRC_URI = " \
file://ethernet \
file://99-silent-printk.conf"

+WIRELESS_FIRMWARE_PACKAGE ?= ""
+INSTALL_WIRELESS_TOOLS ??= "0"
+
DEPENDS += "sshd-regen-keys"

DEBIAN_DEPENDS = " \
- ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys"
+ ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys, \
+ ${@('iw, wireless-regdb, wireless-tools, ' + d.getVar('WIRELESS_FIRMWARE_PACKAGE')) \
+ if d.getVar('INSTALL_WIRELESS_TOOLS') == '1' else ''}"

do_install() {
install -v -d ${D}/etc/network/interfaces.d

Avoids enforcing wireless installation when using the machine conf, only
when using our customization package, something that downstream layers
usually don't do.

Jan

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

Join cip-dev@lists.cip-project.org to automatically receive all group messages.