summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/kernel-module-split.bbclass25
-rw-r--r--meta/classes-recipe/ptest-cargo.bbclass12
-rw-r--r--meta/classes-recipe/setuptools3.bbclass1
-rw-r--r--meta/classes-recipe/setuptools3_legacy.bbclass1
-rw-r--r--meta/classes-recipe/testimage.bbclass4
-rw-r--r--meta/classes-recipe/uboot-sign.bbclass14
6 files changed, 45 insertions, 12 deletions
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass
index 9487365eb7..a2d81f18e2 100644
--- a/meta/classes-recipe/kernel-module-split.bbclass
+++ b/meta/classes-recipe/kernel-module-split.bbclass
@@ -99,9 +99,12 @@ python split_kernel_module_packages () {
99 bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename) 99 bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename)
100 if autoload and basename not in autoloadlist: 100 if autoload and basename not in autoloadlist:
101 bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename)) 101 bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename))
102
103 # The .conf file can either be installed by a recipe or generated from module_autoload_*
104 conf = '%s/%s.conf' % (d.getVar('modulesloaddir'), basename)
105 name = '%s%s' % (dvar, conf)
106 # If module name is in KERNEL_MODULE_AUTOLOAD, then generate the .conf file and write to `name`.
102 if basename in autoloadlist: 107 if basename in autoloadlist:
103 conf = '%s/%s.conf' % (d.getVar('modulesloaddir'), basename)
104 name = '%s%s' % (dvar, conf)
105 os.makedirs(os.path.dirname(name), exist_ok=True) 108 os.makedirs(os.path.dirname(name), exist_ok=True)
106 with open(name, 'w') as f: 109 with open(name, 'w') as f:
107 if autoload: 110 if autoload:
@@ -109,6 +112,9 @@ python split_kernel_module_packages () {
109 f.write('%s\n' % m) 112 f.write('%s\n' % m)
110 else: 113 else:
111 f.write('%s\n' % basename) 114 f.write('%s\n' % basename)
115 # If the .conf file exits, then add it to FILES:* and CONFFILES:* and add postinstall hook.
116 # It doesn't matter if it was generated from module_autoload_* or installed by the recipe.
117 if os.path.exists(name):
112 conf2append = ' %s' % conf 118 conf2append = ' %s' % conf
113 d.appendVar('FILES:%s' % pkg, conf2append) 119 d.appendVar('FILES:%s' % pkg, conf2append)
114 d.appendVar('CONFFILES:%s' % pkg, conf2append) 120 d.appendVar('CONFFILES:%s' % pkg, conf2append)
@@ -121,19 +127,24 @@ python split_kernel_module_packages () {
121 # Write out any modconf fragment 127 # Write out any modconf fragment
122 modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split() 128 modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()
123 modconf = d.getVar('module_conf_%s' % basename) 129 modconf = d.getVar('module_conf_%s' % basename)
130
131 # The .conf file can either be installed by a recipe or generated from module_conf_*
132 conf = '%s/%s.conf' % (d.getVar('modprobedir'), basename)
133 name = '%s%s' % (dvar, conf)
134 # If module name is in KERNEL_MODULE_PROBECONF, then generate the .conf file and write to `name`.
124 if modconf and basename in modconflist: 135 if modconf and basename in modconflist:
125 conf = '%s/%s.conf' % (d.getVar('modprobedir'), basename)
126 name = '%s%s' % (dvar, conf)
127 os.makedirs(os.path.dirname(name), exist_ok=True) 136 os.makedirs(os.path.dirname(name), exist_ok=True)
128 with open(name, 'w') as f: 137 with open(name, 'w') as f:
129 f.write("%s\n" % modconf) 138 f.write("%s\n" % modconf)
139 elif modconf:
140 bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
141 # If the .conf file exits, then add it to FILES:* and CONFFILES:*.
142 # It doesn't matter if it was generated from module_conf_* or installed by the recipe.
143 if os.path.exists(name):
130 conf2append = ' %s' % conf 144 conf2append = ' %s' % conf
131 d.appendVar('FILES:%s' % pkg, conf2append) 145 d.appendVar('FILES:%s' % pkg, conf2append)
132 d.appendVar('CONFFILES:%s' % pkg, conf2append) 146 d.appendVar('CONFFILES:%s' % pkg, conf2append)
133 147
134 elif modconf:
135 bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
136
137 if "description" in vals: 148 if "description" in vals:
138 old_desc = d.getVar('DESCRIPTION:' + pkg) or "" 149 old_desc = d.getVar('DESCRIPTION:' + pkg) or ""
139 d.setVar('DESCRIPTION:' + pkg, old_desc + "; " + vals["description"]) 150 d.setVar('DESCRIPTION:' + pkg, old_desc + "; " + vals["description"])
diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass
index 7b18d43c38..ece25ff1eb 100644
--- a/meta/classes-recipe/ptest-cargo.bbclass
+++ b/meta/classes-recipe/ptest-cargo.bbclass
@@ -77,6 +77,7 @@ python do_compile_ptest_cargo() {
77 77
78python do_install_ptest_cargo() { 78python do_install_ptest_cargo() {
79 import shutil 79 import shutil
80 import textwrap
80 81
81 dest_dir = d.getVar("D") 82 dest_dir = d.getVar("D")
82 pn = d.getVar("PN") 83 pn = d.getVar("PN")
@@ -107,7 +108,16 @@ python do_install_ptest_cargo() {
107 f.write(f"\necho \"\"\n") 108 f.write(f"\necho \"\"\n")
108 f.write(f"echo \"## starting to run rust tests ##\"\n") 109 f.write(f"echo \"## starting to run rust tests ##\"\n")
109 for test_path in test_paths: 110 for test_path in test_paths:
110 f.write(f"if ! {test_path} {rust_test_args}; then rc=1; fi\n") 111 script = textwrap.dedent(f"""\
112 if ! {test_path} {rust_test_args}
113 then
114 rc=1
115 echo "FAIL: {test_path}"
116 else
117 echo "PASS: {test_path}"
118 fi
119 """)
120 f.write(script)
111 121
112 f.write("exit $rc\n") 122 f.write("exit $rc\n")
113 123
diff --git a/meta/classes-recipe/setuptools3.bbclass b/meta/classes-recipe/setuptools3.bbclass
index f19899d42e..0adce5e2ec 100644
--- a/meta/classes-recipe/setuptools3.bbclass
+++ b/meta/classes-recipe/setuptools3.bbclass
@@ -32,7 +32,6 @@ setuptools3_do_configure() {
32 32
33setuptools3_do_compile() { 33setuptools3_do_compile() {
34 cd ${SETUPTOOLS_SETUP_PATH} 34 cd ${SETUPTOOLS_SETUP_PATH}
35 NO_FETCH_BUILD=1 \
36 STAGING_INCDIR=${STAGING_INCDIR} \ 35 STAGING_INCDIR=${STAGING_INCDIR} \
37 STAGING_LIBDIR=${STAGING_LIBDIR} \ 36 STAGING_LIBDIR=${STAGING_LIBDIR} \
38 ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py \ 37 ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py \
diff --git a/meta/classes-recipe/setuptools3_legacy.bbclass b/meta/classes-recipe/setuptools3_legacy.bbclass
index 030c3d9e0e..166808a695 100644
--- a/meta/classes-recipe/setuptools3_legacy.bbclass
+++ b/meta/classes-recipe/setuptools3_legacy.bbclass
@@ -35,7 +35,6 @@ setuptools3_legacy_do_configure() {
35 35
36setuptools3_legacy_do_compile() { 36setuptools3_legacy_do_compile() {
37 cd ${SETUPTOOLS_SETUP_PATH} 37 cd ${SETUPTOOLS_SETUP_PATH}
38 NO_FETCH_BUILD=1 \
39 STAGING_INCDIR=${STAGING_INCDIR} \ 38 STAGING_INCDIR=${STAGING_INCDIR} \
40 STAGING_LIBDIR=${STAGING_LIBDIR} \ 39 STAGING_LIBDIR=${STAGING_LIBDIR} \
41 ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py \ 40 ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py \
diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index e090b1ef4b..847a6f18a8 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -26,7 +26,9 @@ TESTIMAGE_FAILED_QA_ARTIFACTS = "\
26 ${localstatedir}/log \ 26 ${localstatedir}/log \
27 ${localstatedir}/volatile/log \ 27 ${localstatedir}/volatile/log \
28 ${sysconfdir}/version \ 28 ${sysconfdir}/version \
29 ${sysconfdir}/os-release" 29 ${sysconfdir}/os-release \
30 ${nonarch_libdir}/os-release \
31"
30 32
31# If some ptests are run and fail, retrieve corresponding directories 33# If some ptests are run and fail, retrieve corresponding directories
32TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}" 34TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}"
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass
index 76a81546e3..796c040e8b 100644
--- a/meta/classes-recipe/uboot-sign.bbclass
+++ b/meta/classes-recipe/uboot-sign.bbclass
@@ -101,6 +101,10 @@ UBOOT_FIT_TEE_IMAGE ?= "tee-raw.bin"
101# User specific settings 101# User specific settings
102UBOOT_FIT_USER_SETTINGS ?= "" 102UBOOT_FIT_USER_SETTINGS ?= ""
103 103
104# Sets the firmware property to select the image to boot first.
105# If not set, the first entry in "loadables" is used instead.
106UBOOT_FIT_CONF_FIRMWARE ?= ""
107
104# Unit name containing a list of users additional binaries to be loaded. 108# Unit name containing a list of users additional binaries to be loaded.
105# It is a comma-separated list of strings. 109# It is a comma-separated list of strings.
106UBOOT_FIT_CONF_USER_LOADABLES ?= '' 110UBOOT_FIT_CONF_USER_LOADABLES ?= ''
@@ -113,6 +117,8 @@ python() {
113 sign = d.getVar('UBOOT_SIGN_ENABLE') == '1' 117 sign = d.getVar('UBOOT_SIGN_ENABLE') == '1'
114 if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1' or sign: 118 if d.getVar('UBOOT_FITIMAGE_ENABLE') == '1' or sign:
115 d.appendVar('DEPENDS', " u-boot-tools-native dtc-native") 119 d.appendVar('DEPENDS', " u-boot-tools-native dtc-native")
120 if d.getVar('FIT_GENERATE_KEYS') == '1' and sign:
121 d.appendVarFlag('do_uboot_assemble_fitimage', 'depends', ' virtual/kernel:do_kernel_generate_rsa_keys')
116} 122}
117 123
118concat_dtb() { 124concat_dtb() {
@@ -359,6 +365,7 @@ EOF
359# we want to sign it so that the SPL can verify it 365# we want to sign it so that the SPL can verify it
360uboot_fitimage_assemble() { 366uboot_fitimage_assemble() {
361 conf_loadables="\"uboot\"" 367 conf_loadables="\"uboot\""
368 conf_firmware=""
362 rm -f ${UBOOT_ITS} ${UBOOT_FITIMAGE_BINARY} 369 rm -f ${UBOOT_ITS} ${UBOOT_FITIMAGE_BINARY}
363 370
364 # First we create the ITS script 371 # First we create the ITS script
@@ -423,13 +430,17 @@ EOF
423 fi 430 fi
424 431
425 if [ -n "${UBOOT_FIT_USER_SETTINGS}" ] ; then 432 if [ -n "${UBOOT_FIT_USER_SETTINGS}" ] ; then
426 echo -e "${UBOOT_FIT_USER_SETTINGS}" >> ${UBOOT_ITS} 433 printf "%b" "${UBOOT_FIT_USER_SETTINGS}" >> ${UBOOT_ITS}
427 fi 434 fi
428 435
429 if [ -n "${UBOOT_FIT_CONF_USER_LOADABLES}" ] ; then 436 if [ -n "${UBOOT_FIT_CONF_USER_LOADABLES}" ] ; then
430 conf_loadables="${conf_loadables}${UBOOT_FIT_CONF_USER_LOADABLES}" 437 conf_loadables="${conf_loadables}${UBOOT_FIT_CONF_USER_LOADABLES}"
431 fi 438 fi
432 439
440 if [ -n "${UBOOT_FIT_CONF_FIRMWARE}" ] ; then
441 conf_firmware="firmware = \"${UBOOT_FIT_CONF_FIRMWARE}\";"
442 fi
443
433 cat << EOF >> ${UBOOT_ITS} 444 cat << EOF >> ${UBOOT_ITS}
434 }; 445 };
435 446
@@ -437,6 +448,7 @@ EOF
437 default = "conf"; 448 default = "conf";
438 conf { 449 conf {
439 description = "Boot with signed U-Boot FIT"; 450 description = "Boot with signed U-Boot FIT";
451 ${conf_firmware}
440 loadables = ${conf_loadables}; 452 loadables = ${conf_loadables};
441 fdt = "fdt"; 453 fdt = "fdt";
442 }; 454 };