Skip to contentSkip to conversation

recipes-xenomai/xenomai.inc: add exception handling

PATCH In review Q. Gylstorff 2 participants 3 messages Feb 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 10/11 recipes-xenomai/xenomai.inc: add exception handling

From: Quirin Gylstorff <[email protected]>

If SRCREV is not available for given DISTRO_ARCH and xenomai version get_srcrev raise a FetchError exception. Avoid a build error be catching the exception.

---
 recipes-xenomai/xenomai/xenomai.inc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
recipes-xenomai/xenomai/xenomai.inc +7 -1
index 3df635c..0a082a4 100644
@@ -13,7 +13,13 @@ inherit dpkg
 
 PROVIDES += "xenomai-kernel-source xenomai-runtime xenomai-runtime-dbgsym libxenomai1 libxenomai-dev libxenomai1-dbgsym"
 # use bitbake get_srcrev to get the current commit id
-COMMIT="${@bb.fetch2.get_srcrev(d).strip('AUTOINC+')}"
+def get_commit(d):
+    try:
+        return bb.fetch2.get_srcrev(d).strip('AUTOINC+')
+    except bb.fetch2.FetchError:
+        return ""
+
+COMMIT="${@get_commit(d)}"
 do_prepare_build() {
 	# The xenomai-kernel-source package is supposed to be generic, but we
 	# build it per architecture in Isar, and those packages happen to be
Signature · 1 line
2.20.1
#1 lore raw

PATCH 11/11 ci: Add target ipc227e for testing 4.4

From: Quirin Gylstorff <[email protected]>

---
 .gitlab-ci.yml                             |  4 +-
 recipes-kernel/linux/files/amd64_defconfig |  3 +-
 scripts/run-lava-tests.sh                  |  1 +
 tests/jobs/xenomai-ipc227e.yml             | 74 ++++++++++++++++++++++
 4 files changed, 79 insertions(+), 3 deletions(-)
 create mode 100644 tests/jobs/xenomai-ipc227e.yml
.gitlab-ci.yml +2 -2
index 608d5db..a783a6b 100644
@@ -145,7 +145,7 @@ lava-test:board-x86-64-efi:linux-4.4:
   needs: [ "build:board-x86-64-efi:linux-4.4" ]
   extends: .test
   variables:
-    TARGET: x86-64
+    TARGET: ipc227e
     DEPLOY_DIR_EXTENSION: "4.4"
 
 build:board-beaglebone:xenomai-3.0.x:
@@ -175,5 +175,5 @@ lava-test:board-x86-64-efi:xenomai-3.0.x:
   needs: [ "build:board-x86-64-efi:xenomai-3.0.x" ]
   extends: .test
   variables:
-    TARGET: x86-64
+    TARGET: ipc227e
     DEPLOY_DIR_EXTENSION: "xenomai-3.0.x"
recipes-kernel/linux/files/amd64_defconfig +2 -1
index 9faed52..bc5cd0b 100644
@@ -1891,7 +1891,8 @@ CONFIG_NET_VENDOR_INTEL=y
 CONFIG_E1000=y
 CONFIG_E1000E=y
 CONFIG_E1000E_HWTS=y
-# CONFIG_IGB is not set
+CONFIG_IGB=y
+CONFIG_IGB_HWMON=y
 # CONFIG_IGBVF is not set
 # CONFIG_IXGB is not set
 # CONFIG_IXGBE is not set
scripts/run-lava-tests.sh +1 -0
index e02385a..1f502c4 100755
@@ -49,6 +49,7 @@ tmp_dir=$(mktemp -d)
 template=${tmp_dir}/job_${TARGET}_${CI_PIPELINE_ID}.yml
 cp ${job_template_path}-${TARGET}.yml ${template}
 sed -i "s|\${TARGET}|${TARGET}|g" $template
+sed -i "s|\${BUILD_ARCH}|${BUILD_ARCH}|g" $template
 sed -i "s|\${DEPLOY_URL}|${DEPLOY_URL}|g" $template
 sed -i "s|\${ISAR_IMAGE}|${ISAR_IMAGE}|g" $template
 sed -i "s|\${ISAR_DISTRIBUTION}|${ISAR_DISTRIBUTION}|g" $template
tests/jobs/xenomai-ipc227e.yml new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw
In reply to Q. Gylstorff
Quoted 21 lines · Q. Gylstorff

From: Quirin Gylstorff <[email protected]>

If SRCREV is not available for given DISTRO_ARCH and xenomai version get_srcrev raise a FetchError exception. Avoid a build error be catching the exception.

---
  recipes-xenomai/xenomai/xenomai.inc | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
recipes-xenomai/xenomai/xenomai.inc +0 -1
index 3df635c..0a082a4 100644
@@ -13,7 +13,13 @@ inherit dpkg
 
  PROVIDES += "xenomai-kernel-source xenomai-runtime xenomai-runtime-dbgsym libxenomai1 libxenomai-dev libxenomai1-dbgsym"
  # use bitbake get_srcrev to get the current commit id
-COMMIT="${@bb.fetch2.get_srcrev(d).strip('AUTOINC+')}"

recipes-xenomai/xenomai/xenomai.inc inherit dpkg · line 25

Quoted 10 lines
recipes-xenomai/xenomai/xenomai.inc +7 -0
+def get_commit(d):
+    try:
+        return bb.fetch2.get_srcrev(d).strip('AUTOINC+')
+    except bb.fetch2.FetchError:
+        return ""
+
+COMMIT="${@get_commit(d)}"
  do_prepare_build() {
  	# The xenomai-kernel-source package is supposed to be generic, but we
  	# build it per architecture in Isar, and those packages happen to be

We have the same pattern in the linux-latest recipe. Should it be adjusted as well?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux