diff options
33 files changed, 783 insertions, 132 deletions
diff --git a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py index 781763d1f1..961d4ea31d 100644 --- a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py +++ b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py | |||
@@ -18,7 +18,7 @@ class Systemdboot(OESelftestTestCase): | |||
18 | 18 | ||
19 | # Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in conf/local.conf | 19 | # Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in conf/local.conf |
20 | features = 'EFI_PROVIDER = "systemd-boot"\n' | 20 | features = 'EFI_PROVIDER = "systemd-boot"\n' |
21 | features += 'MACHINE = "genericx86-64"\n' | 21 | features += 'MACHINE:forcevariable = "genericx86-64"\n' |
22 | features += 'IMAGE_FSTYPES += "wic"\n' | 22 | features += 'IMAGE_FSTYPES += "wic"\n' |
23 | features += 'COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:genericx86-64 = "genericx86-64"\n' | 23 | features += 'COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:genericx86-64 = "genericx86-64"\n' |
24 | self.append_config(features) | 24 | self.append_config(features) |
diff --git a/meta/classes-recipe/core-image.bbclass b/meta/classes-recipe/core-image.bbclass index 4072e420c5..309a7c577b 100644 --- a/meta/classes-recipe/core-image.bbclass +++ b/meta/classes-recipe/core-image.bbclass | |||
@@ -33,6 +33,7 @@ | |||
33 | # LICENSE_CREATE_PACKAGE="1" to be set when building packages too | 33 | # LICENSE_CREATE_PACKAGE="1" to be set when building packages too |
34 | # - doc-pkgs - documentation packages for all installed packages in the rootfs | 34 | # - doc-pkgs - documentation packages for all installed packages in the rootfs |
35 | # - bash-completion-pkgs - bash-completion packages for recipes using bash-completion bbclass | 35 | # - bash-completion-pkgs - bash-completion packages for recipes using bash-completion bbclass |
36 | # - zsh-completion-pkgs - zsh-completion packages | ||
36 | # - ptest-pkgs - ptest packages for all ptest-enabled recipes | 37 | # - ptest-pkgs - ptest packages for all ptest-enabled recipes |
37 | # - read-only-rootfs - tweaks an image to support read-only rootfs | 38 | # - read-only-rootfs - tweaks an image to support read-only rootfs |
38 | # - stateless-rootfs - systemctl-native not run, image populated by systemd at runtime | 39 | # - stateless-rootfs - systemctl-native not run, image populated by systemd at runtime |
diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 6180874a4c..675aa97513 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass | |||
@@ -17,6 +17,7 @@ WICVARS ?= "\ | |||
17 | IMAGE_BOOT_FILES \ | 17 | IMAGE_BOOT_FILES \ |
18 | IMAGE_CLASSES \ | 18 | IMAGE_CLASSES \ |
19 | IMAGE_EFI_BOOT_FILES \ | 19 | IMAGE_EFI_BOOT_FILES \ |
20 | IMAGE_EXTRA_PARTITION_FILES \ | ||
20 | IMAGE_LINK_NAME \ | 21 | IMAGE_LINK_NAME \ |
21 | IMAGE_ROOTFS \ | 22 | IMAGE_ROOTFS \ |
22 | IMGDEPLOYDIR \ | 23 | IMGDEPLOYDIR \ |
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass index 75ed696b72..c289808404 100644 --- a/meta/classes-recipe/kernel-module-split.bbclass +++ b/meta/classes-recipe/kernel-module-split.bbclass | |||
@@ -131,7 +131,7 @@ python split_kernel_module_packages () { | |||
131 | if modconf and basename in modconflist: | 131 | if modconf and basename in modconflist: |
132 | os.makedirs(os.path.dirname(name), exist_ok=True) | 132 | os.makedirs(os.path.dirname(name), exist_ok=True) |
133 | with open(name, 'w') as f: | 133 | with open(name, 'w') as f: |
134 | f.write("%s\n" % modconf) | 134 | f.write("%s\n" % modconf.encode().decode('unicode-escape')) |
135 | elif modconf: | 135 | elif modconf: |
136 | bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename)) | 136 | bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename)) |
137 | # If the .conf file exits, then add it to FILES:* and CONFFILES:*. | 137 | # If the .conf file exits, then add it to FILES:* and CONFFILES:*. |
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass index 0c2fd26e6f..8e671cf28f 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass | |||
@@ -24,6 +24,7 @@ COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg' | |||
24 | COMPLEMENTARY_GLOB[src-pkgs] = '*-src' | 24 | COMPLEMENTARY_GLOB[src-pkgs] = '*-src' |
25 | COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest ${MLPREFIX}ptest-runner' | 25 | COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest ${MLPREFIX}ptest-runner' |
26 | COMPLEMENTARY_GLOB[bash-completion-pkgs] = '*-bash-completion' | 26 | COMPLEMENTARY_GLOB[bash-completion-pkgs] = '*-bash-completion' |
27 | COMPLEMENTARY_GLOB[zsh-completion-pkgs] = '*-zsh-completion' | ||
27 | 28 | ||
28 | def complementary_globs(featurevar, d): | 29 | def complementary_globs(featurevar, d): |
29 | all_globs = d.getVarFlags('COMPLEMENTARY_GLOB') | 30 | all_globs = d.getVarFlags('COMPLEMENTARY_GLOB') |
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index b48c53ef11..0e5150895f 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc | |||
@@ -481,7 +481,7 @@ RECIPE_MAINTAINER:pn-linux-yocto-rt = "Bruce Ashfield <bruce.ashfield@gmail.com> | |||
481 | RECIPE_MAINTAINER:pn-linux-yocto-tiny = "Bruce Ashfield <bruce.ashfield@gmail.com>" | 481 | RECIPE_MAINTAINER:pn-linux-yocto-tiny = "Bruce Ashfield <bruce.ashfield@gmail.com>" |
482 | RECIPE_MAINTAINER:pn-lld = "Khem Raj <raj.khem@gmail.com>" | 482 | RECIPE_MAINTAINER:pn-lld = "Khem Raj <raj.khem@gmail.com>" |
483 | RECIPE_MAINTAINER:pn-lldb = "Khem Raj <raj.khem@gmail.com>" | 483 | RECIPE_MAINTAINER:pn-lldb = "Khem Raj <raj.khem@gmail.com>" |
484 | RECIPE_MAINTAINER:pn-llvm-project-source-21.1.1 = "Khem Raj <raj.khem@gmail.com>" | 484 | RECIPE_MAINTAINER:pn-llvm-project-source-21.1.2 = "Khem Raj <raj.khem@gmail.com>" |
485 | RECIPE_MAINTAINER:pn-llvm-tblgen-native = "Khem Raj <raj.khem@gmail.com>" | 485 | RECIPE_MAINTAINER:pn-llvm-tblgen-native = "Khem Raj <raj.khem@gmail.com>" |
486 | RECIPE_MAINTAINER:pn-logrotate = "Yi Zhao <yi.zhao@windriver.com>" | 486 | RECIPE_MAINTAINER:pn-logrotate = "Yi Zhao <yi.zhao@windriver.com>" |
487 | RECIPE_MAINTAINER:pn-log4cplus = "Unassigned <unassigned@yoctoproject.org>" | 487 | RECIPE_MAINTAINER:pn-log4cplus = "Unassigned <unassigned@yoctoproject.org>" |
diff --git a/meta/conf/machine/include/arm/arch-armv8-7a.inc b/meta/conf/machine/include/arm/arch-armv8-7a.inc new file mode 100644 index 0000000000..6039baca35 --- /dev/null +++ b/meta/conf/machine/include/arm/arch-armv8-7a.inc | |||
@@ -0,0 +1,14 @@ | |||
1 | DEFAULTTUNE ?= "armv8-7a" | ||
2 | |||
3 | TUNEVALID[armv8-7a] = "Enable instructions for ARMv8.7-a" | ||
4 | TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-7a', ' -march=armv8.7-a', '', d)}" | ||
5 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-7a', 'armv8-7a:', '', d)}" | ||
6 | |||
7 | require conf/machine/include/arm/arch-armv8a.inc | ||
8 | |||
9 | # Little Endian base configs | ||
10 | AVAILTUNES += "armv8-7a" | ||
11 | ARMPKGARCH:tune-armv8-7a ?= "armv8-7a" | ||
12 | TUNE_FEATURES:tune-armv8-7a = "aarch64 armv8-7a" | ||
13 | PACKAGE_EXTRA_ARCHS:tune-armv8-7a = "${PACKAGE_EXTRA_ARCHS:tune-armv8a} armv8-7a" | ||
14 | BASE_LIB:tune-armv8-7a = "lib64" | ||
diff --git a/meta/conf/machine/include/arm/arch-armv8-8a.inc b/meta/conf/machine/include/arm/arch-armv8-8a.inc new file mode 100644 index 0000000000..5694330a1d --- /dev/null +++ b/meta/conf/machine/include/arm/arch-armv8-8a.inc | |||
@@ -0,0 +1,14 @@ | |||
1 | DEFAULTTUNE ?= "armv8-8a" | ||
2 | |||
3 | TUNEVALID[armv8-8a] = "Enable instructions for ARMv8.8-a" | ||
4 | TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-8a', ' -march=armv8.8-a', '', d)}" | ||
5 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-8a', 'armv8-8a:', '', d)}" | ||
6 | |||
7 | require conf/machine/include/arm/arch-armv8a.inc | ||
8 | |||
9 | # Little Endian base configs | ||
10 | AVAILTUNES += "armv8-8a" | ||
11 | ARMPKGARCH:tune-armv8-8a ?= "armv8-8a" | ||
12 | TUNE_FEATURES:tune-armv8-8a = "aarch64 armv8-8a" | ||
13 | PACKAGE_EXTRA_ARCHS:tune-armv8-8a = "${PACKAGE_EXTRA_ARCHS:tune-armv8a} armv8-8a" | ||
14 | BASE_LIB:tune-armv8-8a = "lib64" | ||
diff --git a/meta/conf/machine/include/arm/arch-armv9-1a.inc b/meta/conf/machine/include/arm/arch-armv9-1a.inc new file mode 100644 index 0000000000..f9e6dce77c --- /dev/null +++ b/meta/conf/machine/include/arm/arch-armv9-1a.inc | |||
@@ -0,0 +1,13 @@ | |||
1 | DEFAULTTUNE ?= "armv9-1a" | ||
2 | |||
3 | TUNEVALID[armv9-1a] = "Enable instructions for ARMv9.1-a" | ||
4 | TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv9-1a', ' -march=armv9.1-a', '', d)}" | ||
5 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv9-1a', 'armv9-1a:', '', d)}" | ||
6 | |||
7 | require conf/machine/include/arm/arch-armv9a.inc | ||
8 | |||
9 | AVAILTUNES += "armv9-1a" | ||
10 | ARMPKGARCH:tune-armv9-1a ?= "armv9-1a" | ||
11 | TUNE_FEATURES:tune-armv9-1a = "aarch64 armv9-1a" | ||
12 | PACKAGE_EXTRA_ARCHS:tune-armv9-1a = "${PACKAGE_EXTRA_ARCHS:tune-armv9a} armv9-1a" | ||
13 | BASE_LIB:tune-armv9-1a = "lib64" | ||
diff --git a/meta/conf/machine/include/arm/arch-armv9-2a.inc b/meta/conf/machine/include/arm/arch-armv9-2a.inc new file mode 100644 index 0000000000..4b5cf3ed15 --- /dev/null +++ b/meta/conf/machine/include/arm/arch-armv9-2a.inc | |||
@@ -0,0 +1,13 @@ | |||
1 | DEFAULTTUNE ?= "armv9-2a" | ||
2 | |||
3 | TUNEVALID[armv9-2a] = "Enable instructions for ARMv9.2-a" | ||
4 | TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv9-2a', ' -march=armv9.2-a', '', d)}" | ||
5 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv9-2a', 'armv9-2a:', '', d)}" | ||
6 | |||
7 | require conf/machine/include/arm/arch-armv9a.inc | ||
8 | |||
9 | AVAILTUNES += "armv9-2a" | ||
10 | ARMPKGARCH:tune-armv9-2a ?= "armv9-2a" | ||
11 | TUNE_FEATURES:tune-armv9-2a = "aarch64 armv9-2a" | ||
12 | PACKAGE_EXTRA_ARCHS:tune-armv9-2a = "${PACKAGE_EXTRA_ARCHS:tune-armv9a} armv9-2a" | ||
13 | BASE_LIB:tune-armv9-2a = "lib64" | ||
diff --git a/meta/conf/machine/include/arm/arch-armv9-3a.inc b/meta/conf/machine/include/arm/arch-armv9-3a.inc new file mode 100644 index 0000000000..c345f1532c --- /dev/null +++ b/meta/conf/machine/include/arm/arch-armv9-3a.inc | |||
@@ -0,0 +1,13 @@ | |||
1 | DEFAULTTUNE ?= "armv9-3a" | ||
2 | |||
3 | TUNEVALID[armv9-3a] = "Enable instructions for ARMv9.3-a" | ||
4 | TUNE_CCARGS_MARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'armv9-3a', ' -march=armv9.3-a', '', d)}" | ||
5 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv9-3a', 'armv9-3a:', '', d)}" | ||
6 | |||
7 | require conf/machine/include/arm/arch-armv9a.inc | ||
8 | |||
9 | AVAILTUNES += "armv9-3a" | ||
10 | ARMPKGARCH:tune-armv9-3a ?= "armv9-3a" | ||
11 | TUNE_FEATURES:tune-armv9-3a = "aarch64 armv9-3a" | ||
12 | PACKAGE_EXTRA_ARCHS:tune-armv9-3a = "${PACKAGE_EXTRA_ARCHS:tune-armv9a} armv9-3a" | ||
13 | BASE_LIB:tune-armv9-3a = "lib64" | ||
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 7eb176aa04..08bc1d1e44 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
@@ -157,7 +157,10 @@ class BitbakeLayers(OESelftestTestCase): | |||
157 | with open(jsonfile) as f: | 157 | with open(jsonfile) as f: |
158 | data = json.load(f) | 158 | data = json.load(f) |
159 | for s in data['sources']: | 159 | for s in data['sources']: |
160 | data['sources'][s]['git-remote']['rev'] = '5200799866b92259e855051112520006e1aaaac0' | 160 | if s == 'meta-yocto': |
161 | data['sources'][s]['git-remote']['rev'] = '913bd8ba4dd1d5d2a38261bde985b64a36e36281' | ||
162 | else: | ||
163 | data['sources'][s]['git-remote']['rev'] = '744a2277844ec9a384a9ca7dae2a634d5a0d3590' | ||
161 | with open(jsonfile, 'w') as f: | 164 | with open(jsonfile, 'w') as f: |
162 | json.dump(data, f) | 165 | json.dump(data, f) |
163 | 166 | ||
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 2b7c02ec6a..b92f017b81 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -13,7 +13,6 @@ import glob | |||
13 | import fnmatch | 13 | import fnmatch |
14 | import unittest | 14 | import unittest |
15 | import json | 15 | import json |
16 | import logging | ||
17 | 16 | ||
18 | from oeqa.selftest.case import OESelftestTestCase | 17 | from oeqa.selftest.case import OESelftestTestCase |
19 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer | 18 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer |
@@ -2524,13 +2523,6 @@ class DevtoolUpgradeTests(DevtoolBase): | |||
2524 | 2523 | ||
2525 | 2524 | ||
2526 | class DevtoolIdeSdkTests(DevtoolBase): | 2525 | class DevtoolIdeSdkTests(DevtoolBase): |
2527 | |||
2528 | def setUp(self): | ||
2529 | super().setUp() | ||
2530 | self._cmd_logger = None | ||
2531 | if self.logger.isEnabledFor(logging.DEBUG): | ||
2532 | self._cmd_logger = self.logger | ||
2533 | |||
2534 | def _write_bb_config(self, recipe_names): | 2526 | def _write_bb_config(self, recipe_names): |
2535 | """Helper to write the bitbake local.conf file""" | 2527 | """Helper to write the bitbake local.conf file""" |
2536 | conf_lines = [ | 2528 | conf_lines = [ |
@@ -2570,8 +2562,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2570 | self.track_for_cleanup(tempdir) | 2562 | self.track_for_cleanup(tempdir) |
2571 | self.add_command_to_tearDown('bitbake -c clean %s' % recipe_name) | 2563 | self.add_command_to_tearDown('bitbake -c clean %s' % recipe_name) |
2572 | 2564 | ||
2573 | result = runCmd('devtool modify %s -x %s --debug-build' % (recipe_name, tempdir), | 2565 | result = runCmd('devtool modify %s -x %s --debug-build' % (recipe_name, tempdir)) |
2574 | output_log=self._cmd_logger) | ||
2575 | self.assertExists(os.path.join(tempdir, build_file), | 2566 | self.assertExists(os.path.join(tempdir, build_file), |
2576 | 'Extracted source could not be found') | 2567 | 'Extracted source could not be found') |
2577 | self.assertExists(os.path.join(self.workspacedir, 'conf', | 2568 | self.assertExists(os.path.join(self.workspacedir, 'conf', |
@@ -2581,7 +2572,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2581 | self.assertTrue(matches, 'bbappend not created %s' % result.output) | 2572 | self.assertTrue(matches, 'bbappend not created %s' % result.output) |
2582 | 2573 | ||
2583 | # Test devtool status | 2574 | # Test devtool status |
2584 | result = runCmd('devtool status', output_log=self._cmd_logger) | 2575 | result = runCmd('devtool status') |
2585 | self.assertIn(recipe_name, result.output) | 2576 | self.assertIn(recipe_name, result.output) |
2586 | self.assertIn(tempdir, result.output) | 2577 | self.assertIn(tempdir, result.output) |
2587 | self._check_src_repo(tempdir) | 2578 | self._check_src_repo(tempdir) |
@@ -2637,7 +2628,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2637 | self._workspace_scripts_dir(recipe_name), i_and_d_script) | 2628 | self._workspace_scripts_dir(recipe_name), i_and_d_script) |
2638 | self.assertExists(install_deploy_cmd, | 2629 | self.assertExists(install_deploy_cmd, |
2639 | '%s script not found' % install_deploy_cmd) | 2630 | '%s script not found' % install_deploy_cmd) |
2640 | runCmd(install_deploy_cmd, output_log=self._cmd_logger) | 2631 | runCmd(install_deploy_cmd) |
2641 | 2632 | ||
2642 | MAGIC_STRING_ORIG = "Magic: 123456789" | 2633 | MAGIC_STRING_ORIG = "Magic: 123456789" |
2643 | MAGIC_STRING_NEW = "Magic: 987654321" | 2634 | MAGIC_STRING_NEW = "Magic: 987654321" |
@@ -2670,7 +2661,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2670 | cpp_code = cpp_code.replace(MAGIC_STRING_ORIG, MAGIC_STRING_NEW) | 2661 | cpp_code = cpp_code.replace(MAGIC_STRING_ORIG, MAGIC_STRING_NEW) |
2671 | with open(cpp_example_lib_hpp, 'w') as file: | 2662 | with open(cpp_example_lib_hpp, 'w') as file: |
2672 | file.write(cpp_code) | 2663 | file.write(cpp_code) |
2673 | runCmd(install_deploy_cmd, cwd=tempdir, output_log=self._cmd_logger) | 2664 | runCmd(install_deploy_cmd, cwd=tempdir) |
2674 | 2665 | ||
2675 | # Verify the modified example prints the modified magic string | 2666 | # Verify the modified example prints the modified magic string |
2676 | status, output = qemu.run(example_exe) | 2667 | status, output = qemu.run(example_exe) |
@@ -2697,8 +2688,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2697 | 2688 | ||
2698 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", gdb_recipe) | 2689 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", gdb_recipe) |
2699 | r = runCmd("%s --version" % gdb_binary, | 2690 | r = runCmd("%s --version" % gdb_binary, |
2700 | native_sysroot=native_sysroot, target_sys=target_sys, | 2691 | native_sysroot=native_sysroot, target_sys=target_sys) |
2701 | output_log=self._cmd_logger) | ||
2702 | self.assertEqual(r.status, 0) | 2692 | self.assertEqual(r.status, 0) |
2703 | self.assertIn("GNU gdb", r.output) | 2693 | self.assertIn("GNU gdb", r.output) |
2704 | 2694 | ||
@@ -2726,20 +2716,18 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2726 | recipe_name), 'gdb_1234_usr-bin-' + example_exe) | 2716 | recipe_name), 'gdb_1234_usr-bin-' + example_exe) |
2727 | 2717 | ||
2728 | # Start a gdbserver | 2718 | # Start a gdbserver |
2729 | r = runCmd(gdbserver_script, output_log=self._cmd_logger) | 2719 | r = runCmd(gdbserver_script) |
2730 | self.assertEqual(r.status, 0) | 2720 | self.assertEqual(r.status, 0) |
2731 | 2721 | ||
2732 | # Check there is a gdbserver running | 2722 | # Check there is a gdbserver running |
2733 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps'), | 2723 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps')) |
2734 | output_log=self._cmd_logger) | ||
2735 | self.assertEqual(r.status, 0) | 2724 | self.assertEqual(r.status, 0) |
2736 | self.assertIn("gdbserver ", r.output) | 2725 | self.assertIn("gdbserver ", r.output) |
2737 | 2726 | ||
2738 | # Check the pid file is correct | 2727 | # Check the pid file is correct |
2739 | test_cmd = "cat /proc/$(cat /tmp/gdbserver_1234_usr-bin-" + \ | 2728 | test_cmd = "cat /proc/$(cat /tmp/gdbserver_1234_usr-bin-" + \ |
2740 | example_exe + "/pid)/cmdline" | 2729 | example_exe + "/pid)/cmdline" |
2741 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, test_cmd), | 2730 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, test_cmd)) |
2742 | output_log=self._cmd_logger) | ||
2743 | self.assertEqual(r.status, 0) | 2731 | self.assertEqual(r.status, 0) |
2744 | self.assertIn("gdbserver", r.output) | 2732 | self.assertIn("gdbserver", r.output) |
2745 | 2733 | ||
@@ -2750,7 +2738,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2750 | gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %saaa\")'" % magic_string | 2738 | gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %saaa\")'" % magic_string |
2751 | gdb_batch_cmd += " -ex 'list cpp-example-lib.hpp:13,13'" | 2739 | gdb_batch_cmd += " -ex 'list cpp-example-lib.hpp:13,13'" |
2752 | gdb_batch_cmd += " -ex 'continue'" | 2740 | gdb_batch_cmd += " -ex 'continue'" |
2753 | r = runCmd(gdb_script + gdb_batch_cmd, output_log=self._cmd_logger) | 2741 | r = runCmd(gdb_script + gdb_batch_cmd) |
2754 | self.logger.debug("%s %s returned: %s", gdb_script, | 2742 | self.logger.debug("%s %s returned: %s", gdb_script, |
2755 | gdb_batch_cmd, r.output) | 2743 | gdb_batch_cmd, r.output) |
2756 | self.assertEqual(r.status, 0) | 2744 | self.assertEqual(r.status, 0) |
@@ -2762,11 +2750,11 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2762 | self.assertIn("exited normally", r.output) | 2750 | self.assertIn("exited normally", r.output) |
2763 | 2751 | ||
2764 | # Stop the gdbserver | 2752 | # Stop the gdbserver |
2765 | r = runCmd(gdbserver_script + ' stop', output_log=self._cmd_logger) | 2753 | r = runCmd(gdbserver_script + ' stop') |
2766 | self.assertEqual(r.status, 0) | 2754 | self.assertEqual(r.status, 0) |
2767 | 2755 | ||
2768 | # Check there is no gdbserver running | 2756 | # Check there is no gdbserver running |
2769 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps'), output_log=self._cmd_logger) | 2757 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps')) |
2770 | self.assertEqual(r.status, 0) | 2758 | self.assertEqual(r.status, 0) |
2771 | self.assertNotIn("gdbserver ", r.output) | 2759 | self.assertNotIn("gdbserver ", r.output) |
2772 | 2760 | ||
@@ -2787,29 +2775,29 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2787 | self.assertExists(cmake_exe) | 2775 | self.assertExists(cmake_exe) |
2788 | 2776 | ||
2789 | # Verify the cmake preset generated by devtool ide-sdk is available | 2777 | # Verify the cmake preset generated by devtool ide-sdk is available |
2790 | result = runCmd('%s --list-presets' % cmake_exe, cwd=tempdir, output_log=self._cmd_logger) | 2778 | result = runCmd('%s --list-presets' % cmake_exe, cwd=tempdir) |
2791 | self.assertIn(preset_name, result.output) | 2779 | self.assertIn(preset_name, result.output) |
2792 | 2780 | ||
2793 | # Verify cmake re-uses the o files compiled by bitbake | 2781 | # Verify cmake re-uses the o files compiled by bitbake |
2794 | result = runCmd('%s --build --preset %s' % | 2782 | result = runCmd('%s --build --preset %s' % |
2795 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) | 2783 | (cmake_exe, preset_name), cwd=tempdir) |
2796 | self.assertIn("ninja: no work to do.", result.output) | 2784 | self.assertIn("ninja: no work to do.", result.output) |
2797 | 2785 | ||
2798 | # Verify the unit tests work (in Qemu user mode) | 2786 | # Verify the unit tests work (in Qemu user mode) |
2799 | result = runCmd('%s --build --preset %s --target test' % | 2787 | result = runCmd('%s --build --preset %s --target test' % |
2800 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) | 2788 | (cmake_exe, preset_name), cwd=tempdir) |
2801 | self.assertIn("100% tests passed", result.output) | 2789 | self.assertIn("100% tests passed", result.output) |
2802 | 2790 | ||
2803 | # Verify re-building and testing works again | 2791 | # Verify re-building and testing works again |
2804 | result = runCmd('%s --build --preset %s --target clean' % | 2792 | result = runCmd('%s --build --preset %s --target clean' % |
2805 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) | 2793 | (cmake_exe, preset_name), cwd=tempdir) |
2806 | self.assertIn("Cleaning", result.output) | 2794 | self.assertIn("Cleaning", result.output) |
2807 | result = runCmd('%s --build --preset %s' % | 2795 | result = runCmd('%s --build --preset %s' % |
2808 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) | 2796 | (cmake_exe, preset_name), cwd=tempdir) |
2809 | self.assertIn("Building", result.output) | 2797 | self.assertIn("Building", result.output) |
2810 | self.assertIn("Linking", result.output) | 2798 | self.assertIn("Linking", result.output) |
2811 | result = runCmd('%s --build --preset %s --target test' % | 2799 | result = runCmd('%s --build --preset %s --target test' % |
2812 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) | 2800 | (cmake_exe, preset_name), cwd=tempdir) |
2813 | self.assertIn("Running tests...", result.output) | 2801 | self.assertIn("Running tests...", result.output) |
2814 | self.assertIn("100% tests passed", result.output) | 2802 | self.assertIn("100% tests passed", result.output) |
2815 | 2803 | ||
@@ -2834,7 +2822,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2834 | recipe_name, build_file, testimage) | 2822 | recipe_name, build_file, testimage) |
2835 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( | 2823 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( |
2836 | recipe_name, testimage, qemu.ip) | 2824 | recipe_name, testimage, qemu.ip) |
2837 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) | 2825 | runCmd(bitbake_sdk_cmd) |
2838 | self._gdb_cross() | 2826 | self._gdb_cross() |
2839 | self._verify_cmake_preset(tempdir) | 2827 | self._verify_cmake_preset(tempdir) |
2840 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) | 2828 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) |
@@ -2850,7 +2838,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2850 | recipe_name, build_file, testimage) | 2838 | recipe_name, build_file, testimage) |
2851 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( | 2839 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( |
2852 | recipe_name, testimage, qemu.ip) | 2840 | recipe_name, testimage, qemu.ip) |
2853 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) | 2841 | runCmd(bitbake_sdk_cmd) |
2854 | self._gdb_cross() | 2842 | self._gdb_cross() |
2855 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) | 2843 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) |
2856 | # Verify the oe-scripts sym-link is valid | 2844 | # Verify the oe-scripts sym-link is valid |
@@ -2869,7 +2857,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2869 | recipe_name, build_file, testimage) | 2857 | recipe_name, build_file, testimage) |
2870 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( | 2858 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( |
2871 | recipe_name, testimage) | 2859 | recipe_name, testimage) |
2872 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) | 2860 | runCmd(bitbake_sdk_cmd) |
2873 | self._verify_cmake_preset(tempdir) | 2861 | self._verify_cmake_preset(tempdir) |
2874 | self._verify_install_script_code(tempdir, recipe_name) | 2862 | self._verify_install_script_code(tempdir, recipe_name) |
2875 | self._gdb_cross() | 2863 | self._gdb_cross() |
@@ -2886,7 +2874,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2886 | recipe_name, build_file, testimage) | 2874 | recipe_name, build_file, testimage) |
2887 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( | 2875 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( |
2888 | recipe_name, testimage) | 2876 | recipe_name, testimage) |
2889 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) | 2877 | runCmd(bitbake_sdk_cmd) |
2890 | 2878 | ||
2891 | with open(os.path.join(tempdir, '.vscode', 'settings.json')) as settings_j: | 2879 | with open(os.path.join(tempdir, '.vscode', 'settings.json')) as settings_j: |
2892 | settings_d = json.load(settings_j) | 2880 | settings_d = json.load(settings_j) |
@@ -2898,25 +2886,20 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2898 | 2886 | ||
2899 | # Verify meson re-uses the o files compiled by bitbake | 2887 | # Verify meson re-uses the o files compiled by bitbake |
2900 | result = runCmd('%s compile -C %s' % | 2888 | result = runCmd('%s compile -C %s' % |
2901 | (meson_exe, meson_build_folder), cwd=tempdir, | 2889 | (meson_exe, meson_build_folder), cwd=tempdir) |
2902 | output_log=self._cmd_logger) | ||
2903 | self.assertIn("ninja: no work to do.", result.output) | 2890 | self.assertIn("ninja: no work to do.", result.output) |
2904 | 2891 | ||
2905 | # Verify the unit tests work (in Qemu) | 2892 | # Verify the unit tests work (in Qemu) |
2906 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir, | 2893 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir) |
2907 | output_log=self._cmd_logger) | ||
2908 | 2894 | ||
2909 | # Verify re-building and testing works again | 2895 | # Verify re-building and testing works again |
2910 | result = runCmd('%s compile -C %s --clean' % | 2896 | result = runCmd('%s compile -C %s --clean' % |
2911 | (meson_exe, meson_build_folder), cwd=tempdir, | 2897 | (meson_exe, meson_build_folder), cwd=tempdir) |
2912 | output_log=self._cmd_logger) | ||
2913 | self.assertIn("Cleaning...", result.output) | 2898 | self.assertIn("Cleaning...", result.output) |
2914 | result = runCmd('%s compile -C %s' % | 2899 | result = runCmd('%s compile -C %s' % |
2915 | (meson_exe, meson_build_folder), cwd=tempdir, | 2900 | (meson_exe, meson_build_folder), cwd=tempdir) |
2916 | output_log=self._cmd_logger) | ||
2917 | self.assertIn("Linking target", result.output) | 2901 | self.assertIn("Linking target", result.output) |
2918 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir, | 2902 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir) |
2919 | output_log=self._cmd_logger) | ||
2920 | 2903 | ||
2921 | self._verify_install_script_code(tempdir, recipe_name) | 2904 | self._verify_install_script_code(tempdir, recipe_name) |
2922 | self._gdb_cross() | 2905 | self._gdb_cross() |
@@ -2928,8 +2911,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2928 | self._check_workspace() | 2911 | self._check_workspace() |
2929 | 2912 | ||
2930 | result_init = runCmd( | 2913 | result_init = runCmd( |
2931 | 'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code', | 2914 | 'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code') |
2932 | output_log=self._cmd_logger) | ||
2933 | bb_vars = get_bb_vars( | 2915 | bb_vars = get_bb_vars( |
2934 | ['REAL_MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'], "meta-ide-support") | 2916 | ['REAL_MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'], "meta-ide-support") |
2935 | environment_script = 'environment-setup-%s' % bb_vars['REAL_MULTIMACH_TARGET_SYS'] | 2917 | environment_script = 'environment-setup-%s' % bb_vars['REAL_MULTIMACH_TARGET_SYS'] |
@@ -2944,21 +2926,18 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2944 | def runCmdEnv(cmd, cwd): | 2926 | def runCmdEnv(cmd, cwd): |
2945 | cmd = '/bin/sh -c ". %s > /dev/null && %s"' % ( | 2927 | cmd = '/bin/sh -c ". %s > /dev/null && %s"' % ( |
2946 | environment_script_path, cmd) | 2928 | environment_script_path, cmd) |
2947 | return runCmd(cmd, cwd, output_log=self._cmd_logger) | 2929 | return runCmd(cmd, cwd) |
2948 | 2930 | ||
2949 | # Verify building the C++ example works with CMake | 2931 | # Verify building the C++ example works with CMake |
2950 | tempdir_cmake = tempfile.mkdtemp(prefix='devtoolqa') | 2932 | tempdir_cmake = tempfile.mkdtemp(prefix='devtoolqa') |
2951 | self.track_for_cleanup(tempdir_cmake) | 2933 | self.track_for_cleanup(tempdir_cmake) |
2952 | 2934 | ||
2953 | result_cmake = runCmdEnv("which cmake", cwd=tempdir_cmake, | 2935 | result_cmake = runCmdEnv("which cmake", cwd=tempdir_cmake) |
2954 | output_log=self._cmd_logger) | ||
2955 | cmake_native = os.path.normpath(result_cmake.output.strip()) | 2936 | cmake_native = os.path.normpath(result_cmake.output.strip()) |
2956 | self.assertExists(cmake_native) | 2937 | self.assertExists(cmake_native) |
2957 | 2938 | ||
2958 | runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake, | 2939 | runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake) |
2959 | output_log=self._cmd_logger) | 2940 | runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake) |
2960 | runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake, | ||
2961 | output_log=self._cmd_logger) | ||
2962 | 2941 | ||
2963 | # Verify the printed note really referres to a cmake executable | 2942 | # Verify the printed note really referres to a cmake executable |
2964 | cmake_native_code = "" | 2943 | cmake_native_code = "" |
@@ -2974,14 +2953,12 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2974 | tempdir_meson = tempfile.mkdtemp(prefix='devtoolqa') | 2953 | tempdir_meson = tempfile.mkdtemp(prefix='devtoolqa') |
2975 | self.track_for_cleanup(tempdir_meson) | 2954 | self.track_for_cleanup(tempdir_meson) |
2976 | 2955 | ||
2977 | result_cmake = runCmdEnv("which meson", cwd=tempdir_meson, | 2956 | result_cmake = runCmdEnv("which meson", cwd=tempdir_meson) |
2978 | output_log=self._cmd_logger) | ||
2979 | meson_native = os.path.normpath(result_cmake.output.strip()) | 2957 | meson_native = os.path.normpath(result_cmake.output.strip()) |
2980 | self.assertExists(meson_native) | 2958 | self.assertExists(meson_native) |
2981 | 2959 | ||
2982 | runCmdEnv('meson setup %s' % tempdir_meson, cwd=cpp_example_src, | 2960 | runCmdEnv('meson setup %s' % tempdir_meson, cwd=cpp_example_src) |
2983 | output_log=self._cmd_logger) | 2961 | runCmdEnv('meson compile', cwd=tempdir_meson) |
2984 | runCmdEnv('meson compile', cwd=tempdir_meson, output_log=self._cmd_logger) | ||
2985 | 2962 | ||
2986 | def test_devtool_ide_sdk_plugins(self): | 2963 | def test_devtool_ide_sdk_plugins(self): |
2987 | """Test that devtool ide-sdk can use plugins from other layers.""" | 2964 | """Test that devtool ide-sdk can use plugins from other layers.""" |
@@ -3004,7 +2981,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
3004 | return m.group(1).split(',') | 2981 | return m.group(1).split(',') |
3005 | 2982 | ||
3006 | # verify the default plugins are available but the foo plugin is not | 2983 | # verify the default plugins are available but the foo plugin is not |
3007 | result = runCmd('devtool ide-sdk -h', output_log=self._cmd_logger) | 2984 | result = runCmd('devtool ide-sdk -h') |
3008 | found_ides = get_ides_from_help(result.output) | 2985 | found_ides = get_ides_from_help(result.output) |
3009 | self.assertIn('code', found_ides) | 2986 | self.assertIn('code', found_ides) |
3010 | self.assertIn('none', found_ides) | 2987 | self.assertIn('none', found_ides) |
@@ -3035,7 +3012,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
3035 | plugin_file.write(plugin_code) | 3012 | plugin_file.write(plugin_code) |
3036 | 3013 | ||
3037 | # Verify the foo plugin is available as well | 3014 | # Verify the foo plugin is available as well |
3038 | result = runCmd('devtool ide-sdk -h', output_log=self._cmd_logger) | 3015 | result = runCmd('devtool ide-sdk -h') |
3039 | found_ides = get_ides_from_help(result.output) | 3016 | found_ides = get_ides_from_help(result.output) |
3040 | self.assertIn('code', found_ides) | 3017 | self.assertIn('code', found_ides) |
3041 | self.assertIn('none', found_ides) | 3018 | self.assertIn('none', found_ides) |
@@ -3043,16 +3020,14 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
3043 | 3020 | ||
3044 | # Verify the foo plugin generates a shared config | 3021 | # Verify the foo plugin generates a shared config |
3045 | result = runCmd( | 3022 | result = runCmd( |
3046 | 'devtool ide-sdk -m shared --skip-bitbake --ide foo %s' % shared_recipe_name, | 3023 | 'devtool ide-sdk -m shared --skip-bitbake --ide foo %s' % shared_recipe_name) |
3047 | output_log=self._cmd_logger) | ||
3048 | with open(shared_config_file) as shared_config: | 3024 | with open(shared_config_file) as shared_config: |
3049 | shared_config_new = shared_config.read() | 3025 | shared_config_new = shared_config.read() |
3050 | self.assertEqual(shared_config_str, shared_config_new) | 3026 | self.assertEqual(shared_config_str, shared_config_new) |
3051 | 3027 | ||
3052 | # Verify the foo plugin generates a modified config | 3028 | # Verify the foo plugin generates a modified config |
3053 | result = runCmd('devtool ide-sdk --skip-bitbake --ide foo %s %s' % | 3029 | result = runCmd('devtool ide-sdk --skip-bitbake --ide foo %s %s' % |
3054 | (modified_recipe_name, testimage), | 3030 | (modified_recipe_name, testimage)) |
3055 | output_log=self._cmd_logger) | ||
3056 | with open(modified_config_file) as modified_config: | 3031 | with open(modified_config_file) as modified_config: |
3057 | modified_config_new = modified_config.read() | 3032 | modified_config_new = modified_config.read() |
3058 | self.assertEqual(modified_config_str, modified_config_new) | 3033 | self.assertEqual(modified_config_str, modified_config_new) |
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b1c318bd4e..bb4ac23ebf 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -18,6 +18,7 @@ from glob import glob | |||
18 | from shutil import rmtree, copy | 18 | from shutil import rmtree, copy |
19 | from tempfile import NamedTemporaryFile | 19 | from tempfile import NamedTemporaryFile |
20 | from tempfile import TemporaryDirectory | 20 | from tempfile import TemporaryDirectory |
21 | from textwrap import dedent | ||
21 | 22 | ||
22 | from oeqa.selftest.case import OESelftestTestCase | 23 | from oeqa.selftest.case import OESelftestTestCase |
23 | from oeqa.core.decorator import OETestTag | 24 | from oeqa.core.decorator import OETestTag |
@@ -1021,7 +1022,7 @@ class Wic2(WicTestCase): | |||
1021 | wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES', | 1022 | wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES', |
1022 | 'INITRD', 'INITRD_LIVE', 'ISODIR','INITRAMFS_IMAGE', | 1023 | 'INITRD', 'INITRD_LIVE', 'ISODIR','INITRAMFS_IMAGE', |
1023 | 'INITRAMFS_IMAGE_BUNDLE', 'INITRAMFS_LINK_NAME', | 1024 | 'INITRAMFS_IMAGE_BUNDLE', 'INITRAMFS_LINK_NAME', |
1024 | 'APPEND', 'IMAGE_EFI_BOOT_FILES')) | 1025 | 'APPEND', 'IMAGE_EFI_BOOT_FILES', 'IMAGE_EXTRA_PARTITION_FILES')) |
1025 | with open(path) as envfile: | 1026 | with open(path) as envfile: |
1026 | content = dict(line.split("=", 1) for line in envfile) | 1027 | content = dict(line.split("=", 1) for line in envfile) |
1027 | # test if variables used by wic present in the .env file | 1028 | # test if variables used by wic present in the .env file |
@@ -1329,41 +1330,47 @@ run_wic_cmd() { | |||
1329 | def test_extra_partition_space(self): | 1330 | def test_extra_partition_space(self): |
1330 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") | 1331 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") |
1331 | 1332 | ||
1332 | with NamedTemporaryFile("w", suffix=".wks") as tempf: | 1333 | oldpath = os.environ['PATH'] |
1333 | tempf.write("bootloader --ptable gpt\n" \ | 1334 | os.environ['PATH'] = get_bb_var("PATH", "wic-tools") |
1334 | "part --ondisk hda --size 10M --extra-partition-space 10M --fstype=ext4\n" \ | ||
1335 | "part --ondisk hda --fixed-size 20M --extra-partition-space 10M --fstype=ext4\n" \ | ||
1336 | "part --source rootfs --ondisk hda --extra-partition-space 10M --fstype=ext4\n" \ | ||
1337 | "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n") | ||
1338 | tempf.flush() | ||
1339 | |||
1340 | _, wicimg = self._get_wic(tempf.name) | ||
1341 | |||
1342 | res = runCmd("parted -m %s unit b p" % wicimg, | ||
1343 | native_sysroot=native_sysroot, stderr=subprocess.PIPE) | ||
1344 | |||
1345 | # parse parted output which looks like this: | ||
1346 | # BYT;\n | ||
1347 | # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n | ||
1348 | # 1:0.00MiB:200MiB:200MiB:ext4::;\n | ||
1349 | partlns = res.output.splitlines()[2:] | ||
1350 | |||
1351 | self.assertEqual(4, len(partlns)) | ||
1352 | 1335 | ||
1353 | # Test for each partitions that the extra part space exists | 1336 | try: |
1354 | for part in range(0, len(partlns)): | 1337 | with NamedTemporaryFile("w", suffix=".wks") as tempf: |
1355 | part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1)) | 1338 | tempf.write("bootloader --ptable gpt\n" \ |
1356 | partln = partlns[part].split(":") | 1339 | "part --ondisk hda --size 10M --extra-partition-space 10M --fstype=ext4\n" \ |
1357 | self.assertEqual(7, len(partln)) | 1340 | "part --ondisk hda --fixed-size 20M --extra-partition-space 10M --fstype=ext4\n" \ |
1358 | self.assertRegex(partln[3], r'^[0-9]+B$') | 1341 | "part --source rootfs --ondisk hda --extra-partition-space 10M --fstype=ext4\n" \ |
1359 | part_size = int(partln[3].rstrip("B")) | 1342 | "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n") |
1360 | start = int(partln[1].rstrip("B")) / 512 | 1343 | tempf.flush() |
1361 | length = part_size / 512 | 1344 | |
1362 | runCmd("dd if=%s of=%s skip=%d count=%d" % | 1345 | _, wicimg = self._get_wic(tempf.name) |
1363 | (wicimg, part_file, start, length)) | 1346 | |
1364 | res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file) | 1347 | res = runCmd("parted -m %s unit b p" % wicimg, |
1365 | fs_size = int(res.output.split(":")[1].strip()) * 1024 | 1348 | native_sysroot=native_sysroot, stderr=subprocess.PIPE) |
1366 | self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file) | 1349 | |
1350 | # parse parted output which looks like this: | ||
1351 | # BYT;\n | ||
1352 | # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n | ||
1353 | # 1:0.00MiB:200MiB:200MiB:ext4::;\n | ||
1354 | partlns = res.output.splitlines()[2:] | ||
1355 | |||
1356 | self.assertEqual(4, len(partlns)) | ||
1357 | |||
1358 | # Test for each partitions that the extra part space exists | ||
1359 | for part in range(0, len(partlns)): | ||
1360 | part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1)) | ||
1361 | partln = partlns[part].split(":") | ||
1362 | self.assertEqual(7, len(partln)) | ||
1363 | self.assertRegex(partln[3], r'^[0-9]+B$') | ||
1364 | part_size = int(partln[3].rstrip("B")) | ||
1365 | start = int(partln[1].rstrip("B")) / 512 | ||
1366 | length = part_size / 512 | ||
1367 | runCmd("dd if=%s of=%s skip=%d count=%d" % | ||
1368 | (wicimg, part_file, start, length)) | ||
1369 | res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file) | ||
1370 | fs_size = int(res.output.split(":")[1].strip()) * 1024 | ||
1371 | self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file) | ||
1372 | finally: | ||
1373 | os.environ['PATH'] = oldpath | ||
1367 | 1374 | ||
1368 | # TODO this test could also work on aarch64 | 1375 | # TODO this test could also work on aarch64 |
1369 | @skipIfNotArch(['i586', 'i686', 'x86_64']) | 1376 | @skipIfNotArch(['i586', 'i686', 'x86_64']) |
@@ -1647,6 +1654,53 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" | |||
1647 | status, output = qemu.run_serial(cmd) | 1654 | status, output = qemu.run_serial(cmd) |
1648 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 1655 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |
1649 | 1656 | ||
1657 | def test_extra_partition_plugin(self): | ||
1658 | """Test extra partition plugin""" | ||
1659 | config = dedent("""\ | ||
1660 | IMAGE_EXTRA_PARTITION_FILES_label-foo = "bar.conf;foo.conf" | ||
1661 | IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "bar.conf;foobar.conf" | ||
1662 | IMAGE_EXTRA_PARTITION_FILES = "foo/*" | ||
1663 | WICVARS:append = "\ | ||
1664 | IMAGE_EXTRA_PARTITION_FILES_label-foo \ | ||
1665 | IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ | ||
1666 | " | ||
1667 | """) | ||
1668 | self.append_config(config) | ||
1669 | |||
1670 | deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE') | ||
1671 | |||
1672 | testfile = open(os.path.join(deploy_dir, "bar.conf"), "w") | ||
1673 | testfile.write("test") | ||
1674 | testfile.close() | ||
1675 | |||
1676 | os.mkdir(os.path.join(deploy_dir, "foo")) | ||
1677 | testfile = open(os.path.join(deploy_dir, "foo", "bar.conf"), "w") | ||
1678 | testfile.write("test") | ||
1679 | testfile.close() | ||
1680 | |||
1681 | oldpath = os.environ['PATH'] | ||
1682 | os.environ['PATH'] = get_bb_var("PATH", "wic-tools") | ||
1683 | |||
1684 | try: | ||
1685 | with NamedTemporaryFile("w", suffix=".wks") as wks: | ||
1686 | wks.writelines(['part / --source extra_partition --ondisk sda --fstype=ext4 --label foo --align 4 --size 5M\n', | ||
1687 | 'part / --source extra_partition --ondisk sda --fstype=ext4 --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', | ||
1688 | 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n']) | ||
1689 | wks.flush() | ||
1690 | _, wicimg = self._get_wic(wks.name) | ||
1691 | |||
1692 | result = runCmd("wic ls %s | wc -l" % wicimg) | ||
1693 | self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) | ||
1694 | |||
1695 | for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): | ||
1696 | result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) | ||
1697 | self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) | ||
1698 | |||
1699 | self.remove_config(config) | ||
1700 | |||
1701 | finally: | ||
1702 | os.environ['PATH'] = oldpath | ||
1703 | |||
1650 | def test_fs_types(self): | 1704 | def test_fs_types(self): |
1651 | """Test filesystem types for empty and not empty partitions""" | 1705 | """Test filesystem types for empty and not empty partitions""" |
1652 | img = 'core-image-minimal' | 1706 | img = 'core-image-minimal' |
diff --git a/meta/lib/patchtest/repo.py b/meta/lib/patchtest/repo.py index 2cdd6736e4..6a7d7d2d3b 100644 --- a/meta/lib/patchtest/repo.py +++ b/meta/lib/patchtest/repo.py | |||
@@ -21,7 +21,12 @@ class PatchTestRepo(object): | |||
21 | self.repodir = repodir | 21 | self.repodir = repodir |
22 | self.repo = git.Repo.init(repodir) | 22 | self.repo = git.Repo.init(repodir) |
23 | self.patch = mbox.PatchSeries(patch) | 23 | self.patch = mbox.PatchSeries(patch) |
24 | self.current_branch = self.repo.active_branch.name | 24 | |
25 | if self.repo.head.is_detached: | ||
26 | self.current_commit = self.repo.head.commit.hexsha | ||
27 | self.current_branch = None | ||
28 | else: | ||
29 | self.current_branch = self.repo.active_branch.name | ||
25 | 30 | ||
26 | # targeted branch defined on the patch may be invalid, so make sure there | 31 | # targeted branch defined on the patch may be invalid, so make sure there |
27 | # is a corresponding remote branch | 32 | # is a corresponding remote branch |
@@ -80,6 +85,6 @@ class PatchTestRepo(object): | |||
80 | self._patchmerged = True | 85 | self._patchmerged = True |
81 | 86 | ||
82 | def clean(self): | 87 | def clean(self): |
83 | self.repo.git.execute(['git', 'checkout', self.current_branch]) | 88 | self.repo.git.execute(['git', 'checkout', self.current_branch if self.current_branch else self.current_commit]) |
84 | self.repo.git.execute(['git', 'branch', '-D', self._workingbranch]) | 89 | self.repo.git.execute(['git', 'branch', '-D', self._workingbranch]) |
85 | self._patchmerged = False | 90 | self._patchmerged = False |
diff --git a/meta/recipes-core/busybox/busybox/CVE-2025-46394-01.patch b/meta/recipes-core/busybox/busybox/CVE-2025-46394-01.patch new file mode 100644 index 0000000000..c95cba3c33 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/CVE-2025-46394-01.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From f5e1bf966b19ea1821f00a8c9ecd7774598689b4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Vlasenko <vda.linux@googlemail.com> | ||
3 | Date: Wed, 24 Sep 2025 03:28:47 +0200 | ||
4 | Subject: [PATCH] archival/libarchive: sanitize filenames on output (prevent | ||
5 | control sequence attacks | ||
6 | |||
7 | This fixes CVE-2025-46394 (terminal escape sequence injection) | ||
8 | |||
9 | Original credit: Ian.Norton at entrust.com | ||
10 | |||
11 | function old new delta | ||
12 | header_list 9 15 +6 | ||
13 | header_verbose_list 239 244 +5 | ||
14 | ------------------------------------------------------------------------------ | ||
15 | (add/remove: 0/0 grow/shrink: 2/0 up/down: 11/0) Total: 11 bytes | ||
16 | |||
17 | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> | ||
18 | |||
19 | CVE: CVE-2025-46394 | ||
20 | Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=f5e1bf966b19ea1821f00a8c9ecd7774598689b4] | ||
21 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
22 | --- | ||
23 | archival/libarchive/header_list.c | 2 +- | ||
24 | archival/libarchive/header_verbose_list.c | 4 ++-- | ||
25 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
26 | |||
27 | diff --git a/archival/libarchive/header_list.c b/archival/libarchive/header_list.c | ||
28 | index 0621aa406..9490b3635 100644 | ||
29 | --- a/archival/libarchive/header_list.c | ||
30 | +++ b/archival/libarchive/header_list.c | ||
31 | @@ -8,5 +8,5 @@ | ||
32 | void FAST_FUNC header_list(const file_header_t *file_header) | ||
33 | { | ||
34 | //TODO: cpio -vp DIR should output "DIR/NAME", not just "NAME" */ | ||
35 | - puts(file_header->name); | ||
36 | + puts(printable_string(file_header->name)); | ||
37 | } | ||
38 | diff --git a/archival/libarchive/header_verbose_list.c b/archival/libarchive/header_verbose_list.c | ||
39 | index a575a08a0..e7a09430d 100644 | ||
40 | --- a/archival/libarchive/header_verbose_list.c | ||
41 | +++ b/archival/libarchive/header_verbose_list.c | ||
42 | @@ -57,13 +57,13 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | ||
43 | ptm->tm_hour, | ||
44 | ptm->tm_min, | ||
45 | ptm->tm_sec, | ||
46 | - file_header->name); | ||
47 | + printable_string(file_header->name)); | ||
48 | |||
49 | #endif /* FEATURE_TAR_UNAME_GNAME */ | ||
50 | |||
51 | /* NB: GNU tar shows "->" for symlinks and "link to" for hardlinks */ | ||
52 | if (file_header->link_target) { | ||
53 | - printf(" -> %s", file_header->link_target); | ||
54 | + printf(" -> %s", printable_string(file_header->link_target)); | ||
55 | } | ||
56 | bb_putchar('\n'); | ||
57 | } | ||
diff --git a/meta/recipes-core/busybox/busybox/CVE-2025-46394-02.patch b/meta/recipes-core/busybox/busybox/CVE-2025-46394-02.patch new file mode 100644 index 0000000000..ec17b9285a --- /dev/null +++ b/meta/recipes-core/busybox/busybox/CVE-2025-46394-02.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 7378db981d87b4a2264e14d60340a7fb5c67ae59 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Marko <peter.marko@siemens.com> | ||
3 | Date: Fri, 3 Oct 2025 16:12:56 +0200 | ||
4 | Subject: [PATCH] testsuite/tar.tests: fix test after CVE-2025-46394 | ||
5 | |||
6 | tar now sanitizes output and this test needs to expect that. | ||
7 | |||
8 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
9 | |||
10 | CVE: CVE-2025-46394 | ||
11 | Upstream-Status: Submitted [https://lists.busybox.net/pipermail/busybox/2025-October/091743.html] | ||
12 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
13 | --- | ||
14 | testsuite/tar.tests | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/testsuite/tar.tests b/testsuite/tar.tests | ||
18 | index 0f2e89112..48fc38114 100755 | ||
19 | --- a/testsuite/tar.tests | ||
20 | +++ b/testsuite/tar.tests | ||
21 | @@ -325,9 +325,9 @@ unset LANG | ||
22 | rm -rf etc usr | ||
23 | ' "\ | ||
24 | etc/ssl/certs/3b2716e5.0 | ||
25 | -etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem | ||
26 | +etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sa??lay??c??s??.pem | ||
27 | etc/ssl/certs/f80cc7f6.0 | ||
28 | -usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt | ||
29 | +usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sa??lay??c??s??.crt | ||
30 | 0 | ||
31 | etc/ssl/certs/3b2716e5.0 -> EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem | ||
32 | etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem -> /usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt | ||
diff --git a/meta/recipes-core/busybox/busybox_1.37.0.bb b/meta/recipes-core/busybox/busybox_1.37.0.bb index bec25348b8..9e6a7b7b4c 100644 --- a/meta/recipes-core/busybox/busybox_1.37.0.bb +++ b/meta/recipes-core/busybox/busybox_1.37.0.bb | |||
@@ -56,6 +56,8 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ | |||
56 | file://0001-archival-disallow-path-traversals-CVE-2023-39810.patch \ | 56 | file://0001-archival-disallow-path-traversals-CVE-2023-39810.patch \ |
57 | file://0001-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch \ | 57 | file://0001-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch \ |
58 | file://0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch \ | 58 | file://0001-busybox-Add-awk-gsub-erroneous-word-start-match-test.patch \ |
59 | file://CVE-2025-46394-01.patch \ | ||
60 | file://CVE-2025-46394-02.patch \ | ||
59 | " | 61 | " |
60 | SRC_URI:append:libc-musl = " file://musl.cfg" | 62 | SRC_URI:append:libc-musl = " file://musl.cfg" |
61 | SRC_URI:append:x86-64 = " file://sha_accel.cfg" | 63 | SRC_URI:append:x86-64 = " file://sha_accel.cfg" |
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index 0cbae48729..4827779e2f 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh | |||
@@ -178,7 +178,7 @@ rm_dir() { | |||
178 | 178 | ||
179 | get_label_name() { | 179 | get_label_name() { |
180 | # Get the LABEL or PARTLABEL | 180 | # Get the LABEL or PARTLABEL |
181 | LABEL=`/sbin/blkid | grep "$1:" | grep -o 'LABEL=".*"' | cut -d '"' -f2` | 181 | LABEL=`/sbin/blkid "$1" | grep -o 'LABEL=".*"' | cut -d '"' -f2 | sed 's,/,_,g'` |
182 | # If the $DEVNAME has a LABEL or a PARTLABEL | 182 | # If the $DEVNAME has a LABEL or a PARTLABEL |
183 | if [ -n "$LABEL" ]; then | 183 | if [ -n "$LABEL" ]; then |
184 | # Set the mount location dir name to LABEL appended | 184 | # Set the mount location dir name to LABEL appended |
diff --git a/meta/recipes-devtools/clang/common-clang.inc b/meta/recipes-devtools/clang/common-clang.inc index bf3a63914a..ca3a3a08b4 100644 --- a/meta/recipes-devtools/clang/common-clang.inc +++ b/meta/recipes-devtools/clang/common-clang.inc | |||
@@ -5,7 +5,7 @@ LLVM_HTTP ?= "https://github.com/llvm" | |||
5 | 5 | ||
6 | MAJOR_VER = "21" | 6 | MAJOR_VER = "21" |
7 | MINOR_VER = "1" | 7 | MINOR_VER = "1" |
8 | PATCH_VER = "1" | 8 | PATCH_VER = "2" |
9 | # could be 'rcX' or 'git' or empty ( for release ) | 9 | # could be 'rcX' or 'git' or empty ( for release ) |
10 | VER_SUFFIX = "" | 10 | VER_SUFFIX = "" |
11 | 11 | ||
diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc index b8f7d41089..d7f069d253 100644 --- a/meta/recipes-devtools/clang/common.inc +++ b/meta/recipes-devtools/clang/common.inc | |||
@@ -17,7 +17,7 @@ BASEURI ?= "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}${VER_SUFFI | |||
17 | UPSTREAM_CHECK_URI = "${LLVM_HTTP}/llvm-project/releases/" | 17 | UPSTREAM_CHECK_URI = "${LLVM_HTTP}/llvm-project/releases/" |
18 | UPSTREAM_CHECK_REGEX = "releases/tag/llvmorg-?(?P<pver>\d+(\.\d+)+)" | 18 | UPSTREAM_CHECK_REGEX = "releases/tag/llvmorg-?(?P<pver>\d+(\.\d+)+)" |
19 | SOURCEDIR ?= "llvm-project-${PV}${VER_SUFFIX}.src" | 19 | SOURCEDIR ?= "llvm-project-${PV}${VER_SUFFIX}.src" |
20 | SRC_URI[sha256sum] = "8863980e14484a72a9b7d2c80500e1749054d74f08f8c5102fd540a3c5ac9f8a" | 20 | SRC_URI[sha256sum] = "1a417d1c8faf8d93e73fec1cbb76d393ed3218974c2283c7bac9672d3d47c54b" |
21 | 21 | ||
22 | SRC_URI = "\ | 22 | SRC_URI = "\ |
23 | ${BASEURI} \ | 23 | ${BASEURI} \ |
diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb index d8896609b1..87ccfe3704 100644 --- a/meta/recipes-devtools/gn/gn_git.bb +++ b/meta/recipes-devtools/gn/gn_git.bb | |||
@@ -49,4 +49,4 @@ BBCLASSEXTEND = "native" | |||
49 | 49 | ||
50 | COMPATIBLE_HOST = "^(?!riscv32).*" | 50 | COMPATIBLE_HOST = "^(?!riscv32).*" |
51 | 51 | ||
52 | CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized" | 52 | CFLAGS += "-Wno-error=maybe-uninitialized" |
diff --git a/meta/recipes-devtools/go/go-1.25.0.inc b/meta/recipes-devtools/go/go-1.25.0.inc index f562fbb34b..1558b4623d 100644 --- a/meta/recipes-devtools/go/go-1.25.0.inc +++ b/meta/recipes-devtools/go/go-1.25.0.inc | |||
@@ -16,5 +16,6 @@ SRC_URI += "\ | |||
16 | file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \ | 16 | file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \ |
17 | file://0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch \ | 17 | file://0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch \ |
18 | file://0011-cmd-link-stop-forcing-binutils-gold-dependency-on-aa.patch \ | 18 | file://0011-cmd-link-stop-forcing-binutils-gold-dependency-on-aa.patch \ |
19 | file://0001-runtime-when-using-cgo-on-386-call-C-sigaction-funct.patch \ | ||
19 | " | 20 | " |
20 | SRC_URI[main.sha256sum] = "4bd01e91297207bfa450ea40d4d5a93b1b531a5e438473b2a06e18e077227225" | 21 | SRC_URI[main.sha256sum] = "4bd01e91297207bfa450ea40d4d5a93b1b531a5e438473b2a06e18e077227225" |
diff --git a/meta/recipes-devtools/go/go/0001-runtime-when-using-cgo-on-386-call-C-sigaction-funct.patch b/meta/recipes-devtools/go/go/0001-runtime-when-using-cgo-on-386-call-C-sigaction-funct.patch new file mode 100644 index 0000000000..33e3b033a1 --- /dev/null +++ b/meta/recipes-devtools/go/go/0001-runtime-when-using-cgo-on-386-call-C-sigaction-funct.patch | |||
@@ -0,0 +1,248 @@ | |||
1 | From c5737dc21bbac9fbefc35ac9313e66291d66b382 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ian Lance Taylor <iant@golang.org> | ||
3 | Date: Fri, 5 Sep 2025 22:24:37 -0700 | ||
4 | Subject: [PATCH] runtime: when using cgo on 386, call C sigaction function | ||
5 | |||
6 | On 386 the C sigaction function assumes that the caller does not set | ||
7 | the SA_RESTORER flag. It does not copy the C sa_restorer field to | ||
8 | the kernel sa_restorer field. The effect is that the kernel sees | ||
9 | the SA_RESTORER flag but a NULL sa_restorer field, and the program | ||
10 | crashes when returning from a signal handler. | ||
11 | |||
12 | On the other hand, the C sigaction function will return the SA_RESTORER | ||
13 | flag and the sa_restorer field stored in the kernel. | ||
14 | |||
15 | This means that if the Go runtime installs a signal handler, | ||
16 | with SA_RESTORER as is required when calling the kernel, | ||
17 | and the Go program calls C code that calls the C sigaction function | ||
18 | to query the current signal handler, that C code will get a result | ||
19 | that it can't pass back to sigaction. | ||
20 | |||
21 | This CL fixes the problem by using the C sigaction function | ||
22 | for 386 programs that use cgo. This reuses the functionality | ||
23 | used on amd64 and other GOARCHs to support the race detector. | ||
24 | |||
25 | See #75253, or runtime/testdata/testprogcgo/eintr.go, for sample | ||
26 | code that used to fail on 386. No new test case is required, | ||
27 | we just remove the skip we used to have for eintr.go. | ||
28 | |||
29 | Fixes #75253 | ||
30 | |||
31 | Change-Id: I803059b1fb9e09e9fbb43f68eccb6a59a92c2991 | ||
32 | Reviewed-on: https://go-review.googlesource.com/c/go/+/701375 | ||
33 | LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> | ||
34 | Reviewed-by: Cherry Mui <cherryyz@google.com> | ||
35 | Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> | ||
36 | Auto-Submit: Ian Lance Taylor <iant@golang.org> | ||
37 | Upstream-Status: Backport [https://github.com/golang/go/commit/c5737dc21bbac9fbefc35ac9313e66291d66b382] | ||
38 | Signed-off-by: Randolph Sapp <rs@ti.com> | ||
39 | --- | ||
40 | src/runtime/cgo/gcc_sigaction.c | 8 ++++---- | ||
41 | src/runtime/cgo/sigaction.go | 2 +- | ||
42 | src/runtime/cgo_sigaction.go | 6 +++++- | ||
43 | src/runtime/crash_cgo_test.go | 11 ----------- | ||
44 | src/runtime/os_freebsd.go | 6 ++++++ | ||
45 | src/runtime/os_linux.go | 18 +++++++++++++++++- | ||
46 | src/runtime/sigaction.go | 2 +- | ||
47 | src/runtime/sys_linux_386.s | 19 +++++++++++++++++++ | ||
48 | 8 files changed, 53 insertions(+), 19 deletions(-) | ||
49 | |||
50 | diff --git a/src/runtime/cgo/gcc_sigaction.c b/src/runtime/cgo/gcc_sigaction.c | ||
51 | index 7cbef7db11..ad48a88dc1 100644 | ||
52 | --- a/src/runtime/cgo/gcc_sigaction.c | ||
53 | +++ b/src/runtime/cgo/gcc_sigaction.c | ||
54 | @@ -2,7 +2,7 @@ | ||
55 | // Use of this source code is governed by a BSD-style | ||
56 | // license that can be found in the LICENSE file. | ||
57 | |||
58 | -//go:build linux && (amd64 || arm64 || loong64 || ppc64le) | ||
59 | +//go:build linux && (386 || amd64 || arm64 || loong64 || ppc64le) | ||
60 | |||
61 | #include <errno.h> | ||
62 | #include <stddef.h> | ||
63 | @@ -17,7 +17,7 @@ | ||
64 | // to and from struct sigaction — are specific to ${goos}/${goarch}. | ||
65 | typedef struct { | ||
66 | uintptr_t handler; | ||
67 | - uint64_t flags; | ||
68 | + unsigned long flags; | ||
69 | #ifdef __loongarch__ | ||
70 | uint64_t mask; | ||
71 | uintptr_t restorer; | ||
72 | @@ -57,7 +57,7 @@ x_cgo_sigaction(intptr_t signum, const go_sigaction_t *goact, go_sigaction_t *ol | ||
73 | sigaddset(&act.sa_mask, (int)(i+1)); | ||
74 | } | ||
75 | } | ||
76 | - act.sa_flags = (int)(goact->flags & ~(uint64_t)SA_RESTORER); | ||
77 | + act.sa_flags = (int)(goact->flags & ~(unsigned long)SA_RESTORER); | ||
78 | } | ||
79 | |||
80 | ret = sigaction((int)signum, goact ? &act : NULL, oldgoact ? &oldact : NULL); | ||
81 | @@ -79,7 +79,7 @@ x_cgo_sigaction(intptr_t signum, const go_sigaction_t *goact, go_sigaction_t *ol | ||
82 | oldgoact->mask |= (uint64_t)(1)<<i; | ||
83 | } | ||
84 | } | ||
85 | - oldgoact->flags = (uint64_t)oldact.sa_flags; | ||
86 | + oldgoact->flags = (unsigned long)oldact.sa_flags; | ||
87 | } | ||
88 | |||
89 | _cgo_tsan_release(); | ||
90 | diff --git a/src/runtime/cgo/sigaction.go b/src/runtime/cgo/sigaction.go | ||
91 | index dc3f5fd255..90034bad32 100644 | ||
92 | --- a/src/runtime/cgo/sigaction.go | ||
93 | +++ b/src/runtime/cgo/sigaction.go | ||
94 | @@ -2,7 +2,7 @@ | ||
95 | // Use of this source code is governed by a BSD-style | ||
96 | // license that can be found in the LICENSE file. | ||
97 | |||
98 | -//go:build (linux && (amd64 || arm64 || loong64 || ppc64le)) || (freebsd && amd64) | ||
99 | +//go:build (linux && (386 || amd64 || arm64 || loong64 || ppc64le)) || (freebsd && amd64) | ||
100 | |||
101 | package cgo | ||
102 | |||
103 | diff --git a/src/runtime/cgo_sigaction.go b/src/runtime/cgo_sigaction.go | ||
104 | index 5c644587f0..f725dbef4d 100644 | ||
105 | --- a/src/runtime/cgo_sigaction.go | ||
106 | +++ b/src/runtime/cgo_sigaction.go | ||
107 | @@ -3,8 +3,10 @@ | ||
108 | // license that can be found in the LICENSE file. | ||
109 | |||
110 | // Support for sanitizers. See runtime/cgo/sigaction.go. | ||
111 | +// Also used on linux/386 to clear the SA_RESTORER flag | ||
112 | +// when using cgo; see issue #75253. | ||
113 | |||
114 | -//go:build (linux && (amd64 || arm64 || loong64 || ppc64le)) || (freebsd && amd64) | ||
115 | +//go:build (linux && (386 || amd64 || arm64 || loong64 || ppc64le)) || (freebsd && amd64) | ||
116 | |||
117 | package runtime | ||
118 | |||
119 | @@ -42,6 +44,8 @@ func sigaction(sig uint32, new, old *sigactiont) { | ||
120 | |||
121 | var ret int32 | ||
122 | |||
123 | + fixSigactionForCgo(new) | ||
124 | + | ||
125 | var g *g | ||
126 | if mainStarted { | ||
127 | g = getg() | ||
128 | diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go | ||
129 | index c5d7303261..b77ff8dafd 100644 | ||
130 | --- a/src/runtime/crash_cgo_test.go | ||
131 | +++ b/src/runtime/crash_cgo_test.go | ||
132 | @@ -842,17 +842,6 @@ func TestEINTR(t *testing.T) { | ||
133 | switch runtime.GOOS { | ||
134 | case "plan9", "windows": | ||
135 | t.Skipf("no EINTR on %s", runtime.GOOS) | ||
136 | - case "linux": | ||
137 | - if runtime.GOARCH == "386" { | ||
138 | - // On linux-386 the Go signal handler sets | ||
139 | - // a restorer function that is not preserved | ||
140 | - // by the C sigaction call in the test, | ||
141 | - // causing the signal handler to crash when | ||
142 | - // returning the normal code. The test is not | ||
143 | - // architecture-specific, so just skip on 386 | ||
144 | - // rather than doing a complicated workaround. | ||
145 | - t.Skip("skipping on linux-386; C sigaction does not preserve Go restorer") | ||
146 | - } | ||
147 | } | ||
148 | if runtime.GOOS == "freebsd" && race.Enabled { | ||
149 | t.Skipf("race + cgo freebsd not supported. See https://go.dev/issue/73788.") | ||
150 | diff --git a/src/runtime/os_freebsd.go b/src/runtime/os_freebsd.go | ||
151 | index ab859cfb47..68d895b95d 100644 | ||
152 | --- a/src/runtime/os_freebsd.go | ||
153 | +++ b/src/runtime/os_freebsd.go | ||
154 | @@ -457,6 +457,12 @@ func sysSigaction(sig uint32, new, old *sigactiont) { | ||
155 | } | ||
156 | } | ||
157 | |||
158 | +// fixSigactionForCgo is needed for Linux. | ||
159 | +// | ||
160 | +//go:nosplit | ||
161 | +func fixSigactionForCgo(new *sigactiont) { | ||
162 | +} | ||
163 | + | ||
164 | // asmSigaction is implemented in assembly. | ||
165 | // | ||
166 | //go:noescape | ||
167 | diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go | ||
168 | index c9d25a5be8..f9fe1b5f33 100644 | ||
169 | --- a/src/runtime/os_linux.go | ||
170 | +++ b/src/runtime/os_linux.go | ||
171 | @@ -486,7 +486,8 @@ func setsig(i uint32, fn uintptr) { | ||
172 | sigfillset(&sa.sa_mask) | ||
173 | // Although Linux manpage says "sa_restorer element is obsolete and | ||
174 | // should not be used". x86_64 kernel requires it. Only use it on | ||
175 | - // x86. | ||
176 | + // x86. Note that on 386 this is cleared when using the C sigaction | ||
177 | + // function via cgo; see fixSigactionForCgo. | ||
178 | if GOARCH == "386" || GOARCH == "amd64" { | ||
179 | sa.sa_restorer = abi.FuncPCABI0(sigreturn__sigaction) | ||
180 | } | ||
181 | @@ -562,6 +563,21 @@ func sysSigaction(sig uint32, new, old *sigactiont) { | ||
182 | //go:noescape | ||
183 | func rt_sigaction(sig uintptr, new, old *sigactiont, size uintptr) int32 | ||
184 | |||
185 | +// fixSigactionForCgo is called when we are using cgo to call the | ||
186 | +// C sigaction function. On 386 the C function does not expect the | ||
187 | +// SA_RESTORER flag to be set, and in some cases will fail if it is set: | ||
188 | +// it will pass the SA_RESTORER flag to the kernel without passing | ||
189 | +// the sa_restorer field. Since the C function will handle SA_RESTORER | ||
190 | +// for us, we need not pass it. See issue #75253. | ||
191 | +// | ||
192 | +//go:nosplit | ||
193 | +func fixSigactionForCgo(new *sigactiont) { | ||
194 | + if GOARCH == "386" && new != nil { | ||
195 | + new.sa_flags &^= _SA_RESTORER | ||
196 | + new.sa_restorer = 0 | ||
197 | + } | ||
198 | +} | ||
199 | + | ||
200 | func getpid() int | ||
201 | func tgkill(tgid, tid, sig int) | ||
202 | |||
203 | diff --git a/src/runtime/sigaction.go b/src/runtime/sigaction.go | ||
204 | index 2027ae80bf..1a99f7f3ec 100644 | ||
205 | --- a/src/runtime/sigaction.go | ||
206 | +++ b/src/runtime/sigaction.go | ||
207 | @@ -2,7 +2,7 @@ | ||
208 | // Use of this source code is governed by a BSD-style | ||
209 | // license that can be found in the LICENSE file. | ||
210 | |||
211 | -//go:build (linux && !amd64 && !arm64 && !loong64 && !ppc64le) || (freebsd && !amd64) | ||
212 | +//go:build (linux && !386 && !amd64 && !arm64 && !loong64 && !ppc64le) || (freebsd && !amd64) | ||
213 | |||
214 | package runtime | ||
215 | |||
216 | diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s | ||
217 | index d53be243fe..8e832687e0 100644 | ||
218 | --- a/src/runtime/sys_linux_386.s | ||
219 | +++ b/src/runtime/sys_linux_386.s | ||
220 | @@ -410,6 +410,25 @@ TEXT runtime·rt_sigaction(SB),NOSPLIT,$0 | ||
221 | MOVL AX, ret+16(FP) | ||
222 | RET | ||
223 | |||
224 | +// Call the function stored in _cgo_sigaction using the GCC calling convention. | ||
225 | +TEXT runtime·callCgoSigaction(SB),NOSPLIT,$0-16 | ||
226 | + MOVL _cgo_sigaction(SB), AX | ||
227 | + MOVL sig+0(FP), BX | ||
228 | + MOVL new+4(FP), CX | ||
229 | + MOVL old+8(FP), DX | ||
230 | + MOVL SP, SI // align stack to call C function | ||
231 | + SUBL $32, SP | ||
232 | + ANDL $~15, SP | ||
233 | + MOVL BX, 0(SP) | ||
234 | + MOVL CX, 4(SP) | ||
235 | + MOVL DX, 8(SP) | ||
236 | + MOVL SI, 12(SP) | ||
237 | + CALL AX | ||
238 | + MOVL 12(SP), BX | ||
239 | + MOVL BX, SP | ||
240 | + MOVL AX, ret+12(FP) | ||
241 | + RET | ||
242 | + | ||
243 | TEXT runtime·sigfwd(SB),NOSPLIT,$12-16 | ||
244 | MOVL fn+0(FP), AX | ||
245 | MOVL sig+4(FP), BX | ||
246 | -- | ||
247 | 2.51.0 | ||
248 | |||
diff --git a/meta/recipes-devtools/python/python3-lxml_6.0.1.bb b/meta/recipes-devtools/python/python3-lxml_6.0.2.bb index 5d76641675..876fda93b6 100644 --- a/meta/recipes-devtools/python/python3-lxml_6.0.1.bb +++ b/meta/recipes-devtools/python/python3-lxml_6.0.2.bb | |||
@@ -18,7 +18,7 @@ LIC_FILES_CHKSUM = "file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \ | |||
18 | 18 | ||
19 | DEPENDS += "libxml2 libxslt" | 19 | DEPENDS += "libxml2 libxslt" |
20 | 20 | ||
21 | SRC_URI[sha256sum] = "2b3a882ebf27dd026df3801a87cf49ff791336e0f94b0fad195db77e01240690" | 21 | SRC_URI[sha256sum] = "cd79f3367bd74b317dda655dc8fcfa304d9eb6e4fb06b7168c5cf27f96e0cd62" |
22 | 22 | ||
23 | SRC_URI += "${PYPI_SRC_URI}" | 23 | SRC_URI += "${PYPI_SRC_URI}" |
24 | inherit pkgconfig pypi setuptools3 | 24 | inherit pkgconfig pypi setuptools3 |
diff --git a/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb b/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb index a9e84039d2..0bc8519e90 100644 --- a/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb +++ b/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb | |||
@@ -20,6 +20,10 @@ REQUIRED_DISTRO_FEATURES = "opengl x11" | |||
20 | 20 | ||
21 | EXTRA_OEMESON = "-Dwith-system-data-files=true" | 21 | EXTRA_OEMESON = "-Dwith-system-data-files=true" |
22 | 22 | ||
23 | PACKAGE_BEFORE_PN = "${PN}-info" | ||
24 | RDEPENDS:${PN} += " ${PN}-info" | ||
25 | FILES:${PN}-info = "${bindir}/*info" | ||
26 | |||
23 | # Note: wayland is not included as the feature requires libdecor recipe, | 27 | # Note: wayland is not included as the feature requires libdecor recipe, |
24 | # which is not currently in core | 28 | # which is not currently in core |
25 | PACKAGECONFIG ?= "drm egl gles1 gles2 \ | 29 | PACKAGECONFIG ?= "drm egl gles1 gles2 \ |
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index c3751f3414..7046deeb2b 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc | |||
@@ -19,8 +19,8 @@ SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \ | |||
19 | file://0001-freedreno-don-t-encode-build-path-into-binaries.patch \ | 19 | file://0001-freedreno-don-t-encode-build-path-into-binaries.patch \ |
20 | " | 20 | " |
21 | 21 | ||
22 | SRC_URI[sha256sum] = "f2d6b28562f1d6cb9c17ee8e58eeade7aa5faf927ae71065eadb41e17f92b4f8" | 22 | SRC_URI[sha256sum] = "a370b4c549cbfbe646b319e34d73edb50ed883978f5e95133f282f0eae39ab52" |
23 | PV = "25.2.3" | 23 | PV = "25.2.4" |
24 | 24 | ||
25 | UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)" | 25 | UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)" |
26 | 26 | ||
diff --git a/meta/recipes-graphics/spir/spirv-llvm-translator_21.1.0.bb b/meta/recipes-graphics/spir/spirv-llvm-translator_21.1.1.bb index 13a93f3c5e..503e7df644 100644 --- a/meta/recipes-graphics/spir/spirv-llvm-translator_21.1.0.bb +++ b/meta/recipes-graphics/spir/spirv-llvm-translator_21.1.1.bb | |||
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" | |||
6 | 6 | ||
7 | # pattern: llvm_branch_200, currently there are no minor releases, so, no llvm_branch_201 | 7 | # pattern: llvm_branch_200, currently there are no minor releases, so, no llvm_branch_201 |
8 | SPIRV_BRANCH = "llvm_release_${@oe.utils.trim_version('${PV}', 1).replace('.', '')}0" | 8 | SPIRV_BRANCH = "llvm_release_${@oe.utils.trim_version('${PV}', 1).replace('.', '')}0" |
9 | SRCREV = "acb023b63a4bafd53d0ba6a1a452b1f0e5671458" | 9 | SRCREV = "29758b55816c14abb3e4142d42aca7a95bf46710" |
10 | SRC_URI = " \ | 10 | SRC_URI = " \ |
11 | git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;tag=v${PV};branch=${SPIRV_BRANCH} \ | 11 | git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;tag=v${PV};branch=${SPIRV_BRANCH} \ |
12 | " | 12 | " |
diff --git a/meta/recipes-graphics/xorg-lib/libx11/99_x11 b/meta/recipes-graphics/xorg-lib/libx11/99_x11 new file mode 100644 index 0000000000..53c5b49d10 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libx11/99_x11 | |||
@@ -0,0 +1 @@ | |||
d root root 1777 /tmp/.X11-unix none | |||
diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb b/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb index 580e44889d..23a4b228a9 100644 --- a/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb +++ b/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb | |||
@@ -21,7 +21,8 @@ PE = "1" | |||
21 | 21 | ||
22 | XORG_PN = "libX11" | 22 | XORG_PN = "libX11" |
23 | 23 | ||
24 | SRC_URI += "file://disable_tests.patch" | 24 | SRC_URI += "file://disable_tests.patch \ |
25 | file://99_x11" | ||
25 | 26 | ||
26 | SRC_URI[sha256sum] = "fa026f9bb0124f4d6c808f9aef4057aad65e7b35d8ff43951cef0abe06bb9a9a" | 27 | SRC_URI[sha256sum] = "fa026f9bb0124f4d6c808f9aef4057aad65e7b35d8ff43951cef0abe06bb9a9a" |
27 | 28 | ||
@@ -35,7 +36,17 @@ PACKAGECONFIG[xcms] = "--enable-xcms,--disable-xcms" | |||
35 | 36 | ||
36 | PACKAGES =+ "${PN}-xcb" | 37 | PACKAGES =+ "${PN}-xcb" |
37 | 38 | ||
38 | FILES:${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt" | 39 | do_install:append() { |
40 | # temporary directory required for x11 domain sockets | ||
41 | # systemd provides their own definition using tmpfiles.d | ||
42 | if ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'false', 'true', d)}; then | ||
43 | install -d ${D}${sysconfdir}/default/volatiles | ||
44 | install -m 0644 ${UNPACKDIR}/99_x11 ${D}${sysconfdir}/default/volatiles/99_x11 | ||
45 | fi | ||
46 | } | ||
47 | |||
48 | FILES:${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt \ | ||
49 | ${libdir}/tmpfiles.d/x11.conf ${sysconfdir}/default/volatiles/99_x11" | ||
39 | FILES:${PN}-xcb += "${libdir}/libX11-xcb.so.*" | 50 | FILES:${PN}-xcb += "${libdir}/libX11-xcb.so.*" |
40 | FILES:${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale" | 51 | FILES:${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale" |
41 | 52 | ||
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index b9e60cbe4e..9d596be3a7 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py | |||
@@ -345,29 +345,64 @@ class Disk: | |||
345 | path)) | 345 | path)) |
346 | 346 | ||
347 | def copy(self, src, dest): | 347 | def copy(self, src, dest): |
348 | """Copy partition image into wic image.""" | 348 | """Copy files or directories to/from the vfat or ext* partition.""" |
349 | pnum = dest.part if isinstance(src, str) else src.part | 349 | pnum = dest.part if isinstance(src, str) else src.part |
350 | partimg = self._get_part_image(pnum) | ||
350 | 351 | ||
351 | if self.partitions[pnum].fstype.startswith('ext'): | 352 | if self.partitions[pnum].fstype.startswith('ext'): |
352 | if isinstance(src, str): | 353 | if isinstance(src, str): # host to image case |
353 | cmd = "printf 'cd {}\nwrite {} {}\n' | {} -w {}".\ | 354 | if os.path.isdir(src): |
354 | format(os.path.dirname(dest.path), src, os.path.basename(src), | 355 | base = os.path.abspath(src) |
355 | self.debugfs, self._get_part_image(pnum)) | 356 | base_parent = os.path.dirname(base) |
356 | else: # copy from wic | 357 | cmds = [] |
357 | # run both dump and rdump to support both files and directory | 358 | made = set() |
359 | |||
360 | for root, dirs, files in os.walk(base): | ||
361 | for fname in files: | ||
362 | host_file = os.path.join(root, fname) | ||
363 | rel = os.path.relpath(host_file, base_parent) | ||
364 | dest_file = os.path.join(dest.path, rel) | ||
365 | dest_dir = os.path.dirname(dest_file) | ||
366 | |||
367 | # create dir structure (mkdir -p) | ||
368 | parts = dest_dir.strip('/').split('/') | ||
369 | cur = '' | ||
370 | for p in parts: | ||
371 | cur = cur + '/' + p | ||
372 | if cur not in made: | ||
373 | cmds.append(f'mkdir "{cur}"') | ||
374 | made.add(cur) | ||
375 | |||
376 | cmds.append(f'write "{host_file}" "{dest_file}"') | ||
377 | |||
378 | # write script to a temp file | ||
379 | with tempfile.NamedTemporaryFile(mode='w', delete=False, | ||
380 | prefix='wic-debugfs-') as tf: | ||
381 | for line in cmds: | ||
382 | tf.write(line + '\n') | ||
383 | scriptname = tf.name | ||
384 | |||
385 | cmd = f"{self.debugfs} -w -f {scriptname} {partimg}" | ||
386 | |||
387 | else: # single file | ||
388 | cmd = "printf 'cd {}\nwrite {} {}\n' | {} -w {}".\ | ||
389 | format(os.path.dirname(dest.path), src, | ||
390 | os.path.basename(src), self.debugfs, partimg) | ||
391 | |||
392 | else: # image to host case | ||
358 | cmd = "printf 'cd {}\ndump /{} {}\nrdump /{} {}\n' | {} {}".\ | 393 | cmd = "printf 'cd {}\ndump /{} {}\nrdump /{} {}\n' | {} {}".\ |
359 | format(os.path.dirname(src.path), src.path, | 394 | format(os.path.dirname(src.path), src.path, |
360 | dest, src.path, dest, self.debugfs, | 395 | dest, src.path, dest, self.debugfs, partimg) |
361 | self._get_part_image(pnum)) | 396 | |
362 | else: # fat | 397 | else: # fat |
363 | if isinstance(src, str): | 398 | if isinstance(src, str): |
364 | cmd = "{} -i {} -snop {} ::{}".format(self.mcopy, | 399 | cmd = "{} -i {} -snop {} ::{}".format(self.mcopy, |
365 | self._get_part_image(pnum), | 400 | partimg, |
366 | src, dest.path) | 401 | src, dest.path) |
367 | else: | 402 | else: |
368 | cmd = "{} -i {} -snop ::{} {}".format(self.mcopy, | 403 | cmd = "{} -i {} -snop ::{} {}".format(self.mcopy, |
369 | self._get_part_image(pnum), | 404 | partimg, |
370 | src.path, dest) | 405 | src.path, dest) |
371 | 406 | ||
372 | exec_cmd(cmd, as_shell=True) | 407 | exec_cmd(cmd, as_shell=True) |
373 | self._put_part_image(pnum) | 408 | self._put_part_image(pnum) |
diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py new file mode 100644 index 0000000000..d370b0107e --- /dev/null +++ b/scripts/lib/wic/plugins/source/extra_partition.py | |||
@@ -0,0 +1,134 @@ | |||
1 | import logging | ||
2 | import os | ||
3 | import re | ||
4 | |||
5 | from glob import glob | ||
6 | |||
7 | from wic import WicError | ||
8 | from wic.pluginbase import SourcePlugin | ||
9 | from wic.misc import exec_cmd, get_bitbake_var | ||
10 | |||
11 | logger = logging.getLogger('wic') | ||
12 | |||
13 | class ExtraPartitionPlugin(SourcePlugin): | ||
14 | """ | ||
15 | Populates an extra partition with files listed in the IMAGE_EXTRA_PARTITION_FILES | ||
16 | BitBake variable. Files should be deployed to the DEPLOY_DIR_IMAGE directory. | ||
17 | |||
18 | The plugin supports: | ||
19 | - Glob pattern matching for file selection. | ||
20 | - File renaming. | ||
21 | - Suffixes to specify the target partition (by label, UUID, or partname), | ||
22 | enabling multiple extra partitions to coexist. | ||
23 | |||
24 | For example: | ||
25 | |||
26 | IMAGE_EXTRA_PARTITION_FILES_label-foo = "bar.conf;foo.conf" | ||
27 | IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "bar.conf;foobar.conf" | ||
28 | IMAGE_EXTRA_PARTITION_FILES = "foo/*" | ||
29 | WICVARS:append = "\ | ||
30 | IMAGE_EXTRA_PARTITION_FILES_label-foo \ | ||
31 | IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ | ||
32 | " | ||
33 | |||
34 | """ | ||
35 | |||
36 | name = 'extra_partition' | ||
37 | image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' | ||
38 | |||
39 | @classmethod | ||
40 | def do_configure_partition(cls, part, source_params, cr, cr_workdir, | ||
41 | oe_builddir, bootimg_dir, kernel_dir, | ||
42 | native_sysroot): | ||
43 | """ | ||
44 | Called before do_prepare_partition(), list the files to copy | ||
45 | """ | ||
46 | extradir = "%s/extra.%d" % (cr_workdir, part.lineno) | ||
47 | install_cmd = "install -d %s" % extradir | ||
48 | exec_cmd(install_cmd) | ||
49 | |||
50 | if not kernel_dir: | ||
51 | kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | ||
52 | if not kernel_dir: | ||
53 | raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") | ||
54 | |||
55 | extra_files = None | ||
56 | for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): | ||
57 | if fmt: | ||
58 | var = fmt % id | ||
59 | else: | ||
60 | var = "" | ||
61 | extra_files = get_bitbake_var(cls.image_extra_partition_files_var_name + var) | ||
62 | if extra_files is not None: | ||
63 | break | ||
64 | |||
65 | if extra_files is None: | ||
66 | raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) | ||
67 | |||
68 | logger.info('Extra files: %s', extra_files) | ||
69 | |||
70 | # list of tuples (src_name, dst_name) | ||
71 | deploy_files = [] | ||
72 | for src_entry in re.findall(r'[\w;\-\./\*]+', extra_files): | ||
73 | if ';' in src_entry: | ||
74 | dst_entry = tuple(src_entry.split(';')) | ||
75 | if not dst_entry[0] or not dst_entry[1]: | ||
76 | raise WicError('Malformed extra file entry: %s' % src_entry) | ||
77 | else: | ||
78 | dst_entry = (src_entry, src_entry) | ||
79 | |||
80 | logger.debug('Destination entry: %r', dst_entry) | ||
81 | deploy_files.append(dst_entry) | ||
82 | |||
83 | cls.install_task = []; | ||
84 | for deploy_entry in deploy_files: | ||
85 | src, dst = deploy_entry | ||
86 | if '*' in src: | ||
87 | # by default install files under their basename | ||
88 | entry_name_fn = os.path.basename | ||
89 | if dst != src: | ||
90 | # unless a target name was given, then treat name | ||
91 | # as a directory and append a basename | ||
92 | entry_name_fn = lambda name: \ | ||
93 | os.path.join(dst, | ||
94 | os.path.basename(name)) | ||
95 | |||
96 | srcs = glob(os.path.join(kernel_dir, src)) | ||
97 | |||
98 | logger.debug('Globbed sources: %s', ', '.join(srcs)) | ||
99 | for entry in srcs: | ||
100 | src = os.path.relpath(entry, kernel_dir) | ||
101 | entry_dst_name = entry_name_fn(entry) | ||
102 | cls.install_task.append((src, entry_dst_name)) | ||
103 | else: | ||
104 | cls.install_task.append((src, dst)) | ||
105 | |||
106 | |||
107 | @classmethod | ||
108 | def do_prepare_partition(cls, part, source_params, cr, cr_workdir, | ||
109 | oe_builddir, bootimg_dir, kernel_dir, | ||
110 | rootfs_dir, native_sysroot): | ||
111 | """ | ||
112 | Called to do the actual content population for a partition i.e. it | ||
113 | 'prepares' the partition to be incorporated into the image. | ||
114 | In this case, we copies all files listed in IMAGE_EXTRA_PARTITION_FILES variable. | ||
115 | """ | ||
116 | extradir = "%s/extra.%d" % (cr_workdir, part.lineno) | ||
117 | |||
118 | if not kernel_dir: | ||
119 | kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | ||
120 | if not kernel_dir: | ||
121 | raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") | ||
122 | |||
123 | for task in cls.install_task: | ||
124 | src_path, dst_path = task | ||
125 | logger.debug('Install %s as %s', src_path, dst_path) | ||
126 | install_cmd = "install -m 0644 -D %s %s" \ | ||
127 | % (os.path.join(kernel_dir, src_path), | ||
128 | os.path.join(extradir, dst_path)) | ||
129 | exec_cmd(install_cmd) | ||
130 | |||
131 | logger.debug('Prepare extra partition using rootfs in %s', extradir) | ||
132 | part.prepare_rootfs(cr_workdir, oe_builddir, extradir, | ||
133 | native_sysroot, False) | ||
134 | |||
diff --git a/scripts/runqemu b/scripts/runqemu index c28980e616..4bac151ccf 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -421,8 +421,27 @@ class BaseConfig(object): | |||
421 | else: | 421 | else: |
422 | raise RunQemuError("Unknown path arg %s" % p) | 422 | raise RunQemuError("Unknown path arg %s" % p) |
423 | 423 | ||
424 | def uncompress_rootfs(self): | 424 | def rootfs_fixups(self): |
425 | """Decompress ZST rootfs image if needed""" | 425 | |
426 | """Decompress and/or resize the rootfs image, if needed""" | ||
427 | qb_rootfs_opt = self.get('QB_ROOTFS_OPT') | ||
428 | |||
429 | # Check if sdcard size is a power of 2, as that is currently a requirement for qemu | ||
430 | # See https://gitlab.com/qemu-project/qemu/-/issues/1754 | ||
431 | rootfs_size = os.path.getsize(self.rootfs) | ||
432 | rootfs_size_pwr2 = 1 << (rootfs_size - 1).bit_length() | ||
433 | if ("if=sd" in qb_rootfs_opt or "if=pflash" in qb_rootfs_opt) and rootfs_size != rootfs_size_pwr2: | ||
434 | logger.info("Using sd-card or pflash and is not power of 2. File size %d, power of 2 size %d" %(rootfs_size, rootfs_size_pwr2)) | ||
435 | logger.info("Attempting to use truncate to correct this.") | ||
436 | |||
437 | # Ensure the 'truncate' tool is installed before attempting to make a power of 2. | ||
438 | if not shutil.which('truncate'): | ||
439 | raise RunQemuError(f"'truncate' is required to make {self.rootfs} a power of 2 in size but was not found in PATH") | ||
440 | try: | ||
441 | subprocess.check_call(['truncate', '-s', str(rootfs_size_pwr2), self.rootfs]) | ||
442 | except subprocess.CalledProcessError as e: | ||
443 | raise RunQemuError(f"Failed to make {self.rootfs} power of 2 in size: {e}") | ||
444 | |||
426 | if not self.rootfs or not self.fstype.endswith('.zst'): | 445 | if not self.rootfs or not self.fstype.endswith('.zst'): |
427 | return | 446 | return |
428 | 447 | ||
@@ -884,7 +903,7 @@ to your build configuration. | |||
884 | self.set('QB_MEM', qb_mem) | 903 | self.set('QB_MEM', qb_mem) |
885 | 904 | ||
886 | mach = self.get('MACHINE') | 905 | mach = self.get('MACHINE') |
887 | if not mach.startswith(('qemumips', 'qemux86', 'qemuloongarch64')): | 906 | if not mach.startswith(('qemumips', 'qemux86', 'qemuloongarch64')) and self.get('QB_DTB') == "": |
888 | self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' | 907 | self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' |
889 | 908 | ||
890 | self.qemu_opt_script += ' %s' % self.get('QB_MEM') | 909 | self.qemu_opt_script += ' %s' % self.get('QB_MEM') |
@@ -1809,7 +1828,7 @@ def main(): | |||
1809 | config.check_args() | 1828 | config.check_args() |
1810 | config.read_qemuboot() | 1829 | config.read_qemuboot() |
1811 | config.check_and_set() | 1830 | config.check_and_set() |
1812 | config.uncompress_rootfs() | 1831 | config.rootfs_fixups() |
1813 | # Check whether the combos is valid or not | 1832 | # Check whether the combos is valid or not |
1814 | config.validate_combos() | 1833 | config.validate_combos() |
1815 | config.print_config() | 1834 | config.print_config() |