diff options
-rw-r--r-- | meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py | 2 | ||||
-rw-r--r-- | meta/classes-recipe/core-image.bbclass | 1 | ||||
-rw-r--r-- | meta/classes-recipe/kernel-module-split.bbclass | 2 | ||||
-rw-r--r-- | meta/classes-recipe/populate_sdk_base.bbclass | 1 | ||||
-rw-r--r-- | meta/classes-recipe/populate_sdk_ext.bbclass | 13 | ||||
-rw-r--r-- | meta/classes-recipe/toolchain-scripts.bbclass | 3 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 1 | ||||
-rw-r--r-- | meta/lib/bbconfigbuild/configfragments.py | 4 | ||||
-rw-r--r-- | meta/lib/patchtest/repo.py | 9 | ||||
-rw-r--r-- | meta/recipes-devtools/gn/gn_git.bb | 2 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libx11/99_x11 | 1 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb | 15 | ||||
-rw-r--r-- | scripts/lib/wic/engine.py | 63 | ||||
-rwxr-xr-x | scripts/runqemu | 27 |
14 files changed, 34 insertions, 110 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 309a7c577b..4072e420c5 100644 --- a/meta/classes-recipe/core-image.bbclass +++ b/meta/classes-recipe/core-image.bbclass | |||
@@ -33,7 +33,6 @@ | |||
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 | ||
37 | # - ptest-pkgs - ptest packages for all ptest-enabled recipes | 36 | # - ptest-pkgs - ptest packages for all ptest-enabled recipes |
38 | # - read-only-rootfs - tweaks an image to support read-only rootfs | 37 | # - read-only-rootfs - tweaks an image to support read-only rootfs |
39 | # - stateless-rootfs - systemctl-native not run, image populated by systemd at runtime | 38 | # - stateless-rootfs - systemctl-native not run, image populated by systemd at runtime |
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass index c289808404..75ed696b72 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.encode().decode('unicode-escape')) | 134 | f.write("%s\n" % modconf) |
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 8e671cf28f..0c2fd26e6f 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass | |||
@@ -24,7 +24,6 @@ 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' | ||
28 | 27 | ||
29 | def complementary_globs(featurevar, d): | 28 | def complementary_globs(featurevar, d): |
30 | all_globs = d.getVarFlags('COMPLEMENTARY_GLOB') | 29 | all_globs = d.getVarFlags('COMPLEMENTARY_GLOB') |
diff --git a/meta/classes-recipe/populate_sdk_ext.bbclass b/meta/classes-recipe/populate_sdk_ext.bbclass index 36a3e9c836..2859320ddf 100644 --- a/meta/classes-recipe/populate_sdk_ext.bbclass +++ b/meta/classes-recipe/populate_sdk_ext.bbclass | |||
@@ -317,15 +317,10 @@ def write_local_conf(d, baseoutpath, derivative, core_meta_subdir, uninative_che | |||
317 | return origvalue, op, 0, True | 317 | return origvalue, op, 0, True |
318 | varlist = ['[^#=+ ]*'] | 318 | varlist = ['[^#=+ ]*'] |
319 | oldlines = [] | 319 | oldlines = [] |
320 | if os.path.exists(builddir + '/conf/site.conf'): | 320 | for conffile in ['site.conf', 'auto.conf', 'toolcfg.conf', 'local.conf']: |
321 | with open(builddir + '/conf/site.conf', 'r') as f: | 321 | if os.path.exists(builddir + '/conf/' + conffile): |
322 | oldlines += f.readlines() | 322 | with open(builddir + '/conf/' + conffile, 'r') as f: |
323 | if os.path.exists(builddir + '/conf/auto.conf'): | 323 | oldlines += f.readlines() |
324 | with open(builddir + '/conf/auto.conf', 'r') as f: | ||
325 | oldlines += f.readlines() | ||
326 | if os.path.exists(builddir + '/conf/local.conf'): | ||
327 | with open(builddir + '/conf/local.conf', 'r') as f: | ||
328 | oldlines += f.readlines() | ||
329 | (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var) | 324 | (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var) |
330 | 325 | ||
331 | with open(baseoutpath + '/conf/local.conf', 'w') as f: | 326 | with open(baseoutpath + '/conf/local.conf', 'w') as f: |
diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 5d28df845b..ec040b5ebb 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass | |||
@@ -87,11 +87,12 @@ toolchain_create_sdk_env_script () { | |||
87 | # Caller must ensure CONFIG_SITE is setup | 87 | # Caller must ensure CONFIG_SITE is setup |
88 | toolchain_create_tree_env_script () { | 88 | toolchain_create_tree_env_script () { |
89 | script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} | 89 | script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} |
90 | bitbakedir=$(readlink -f ${BITBAKEPATH}/..) | ||
90 | rm -f $script | 91 | rm -f $script |
91 | touch $script | 92 | touch $script |
92 | echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script | 93 | echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script |
93 | echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script | 94 | echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script |
94 | echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script | 95 | echo "orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR} $bitbakedir; cd \$orig" >> $script |
95 | echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script | 96 | echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script |
96 | echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script | 97 | echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script |
97 | echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script | 98 | echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script |
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index eebefc4840..8d1ea5491d 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -813,6 +813,7 @@ FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDE | |||
813 | require conf/abi_version.conf | 813 | require conf/abi_version.conf |
814 | include conf/site.conf | 814 | include conf/site.conf |
815 | include conf/auto.conf | 815 | include conf/auto.conf |
816 | include conf/toolcfg.conf | ||
816 | include conf/local.conf | 817 | include conf/local.conf |
817 | 818 | ||
818 | OE_FRAGMENTS_PREFIX ?= "conf/fragments" | 819 | OE_FRAGMENTS_PREFIX ?= "conf/fragments" |
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index fec985b442..21baedc9a4 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py | |||
@@ -115,7 +115,7 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
115 | def create_conf(self, confpath): | 115 | def create_conf(self, confpath): |
116 | if not os.path.exists(confpath): | 116 | if not os.path.exists(confpath): |
117 | with open(confpath, 'w') as f: | 117 | with open(confpath, 'w') as f: |
118 | f.write('') | 118 | f.write('# Automated config file controlled by tools\n') |
119 | with open(confpath, 'r') as f: | 119 | with open(confpath, 'r') as f: |
120 | lines = f.read() | 120 | lines = f.read() |
121 | if "OE_FRAGMENTS += " not in lines: | 121 | if "OE_FRAGMENTS += " not in lines: |
@@ -184,7 +184,7 @@ class ConfigFragmentsPlugin(LayerPlugin): | |||
184 | print("All fragments removed from {}.".format(args.confpath)) | 184 | print("All fragments removed from {}.".format(args.confpath)) |
185 | 185 | ||
186 | def register_commands(self, sp): | 186 | def register_commands(self, sp): |
187 | default_confpath = os.path.join(os.environ["BBPATH"], "conf/local.conf") | 187 | default_confpath = os.path.join(os.environ["BBPATH"], "conf/toolcfg.conf") |
188 | 188 | ||
189 | parser_list_fragments = self.add_command(sp, 'list-fragments', self.do_list_fragments, parserecipes=False) | 189 | parser_list_fragments = self.add_command(sp, 'list-fragments', self.do_list_fragments, parserecipes=False) |
190 | parser_list_fragments.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) | 190 | parser_list_fragments.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) |
diff --git a/meta/lib/patchtest/repo.py b/meta/lib/patchtest/repo.py index 6a7d7d2d3b..2cdd6736e4 100644 --- a/meta/lib/patchtest/repo.py +++ b/meta/lib/patchtest/repo.py | |||
@@ -21,12 +21,7 @@ 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 | 24 | self.current_branch = self.repo.active_branch.name | |
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 | ||
30 | 25 | ||
31 | # targeted branch defined on the patch may be invalid, so make sure there | 26 | # targeted branch defined on the patch may be invalid, so make sure there |
32 | # is a corresponding remote branch | 27 | # is a corresponding remote branch |
@@ -85,6 +80,6 @@ class PatchTestRepo(object): | |||
85 | self._patchmerged = True | 80 | self._patchmerged = True |
86 | 81 | ||
87 | def clean(self): | 82 | def clean(self): |
88 | self.repo.git.execute(['git', 'checkout', self.current_branch if self.current_branch else self.current_commit]) | 83 | self.repo.git.execute(['git', 'checkout', self.current_branch]) |
89 | self.repo.git.execute(['git', 'branch', '-D', self._workingbranch]) | 84 | self.repo.git.execute(['git', 'branch', '-D', self._workingbranch]) |
90 | self._patchmerged = False | 85 | self._patchmerged = False |
diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb index 87ccfe3704..d8896609b1 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 += "-Wno-error=maybe-uninitialized" | 52 | CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized" |
diff --git a/meta/recipes-graphics/xorg-lib/libx11/99_x11 b/meta/recipes-graphics/xorg-lib/libx11/99_x11 deleted file mode 100644 index 53c5b49d10..0000000000 --- a/meta/recipes-graphics/xorg-lib/libx11/99_x11 +++ /dev/null | |||
@@ -1 +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 23a4b228a9..580e44889d 100644 --- a/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb +++ b/meta/recipes-graphics/xorg-lib/libx11_1.8.12.bb | |||
@@ -21,8 +21,7 @@ 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" | ||
26 | 25 | ||
27 | SRC_URI[sha256sum] = "fa026f9bb0124f4d6c808f9aef4057aad65e7b35d8ff43951cef0abe06bb9a9a" | 26 | SRC_URI[sha256sum] = "fa026f9bb0124f4d6c808f9aef4057aad65e7b35d8ff43951cef0abe06bb9a9a" |
28 | 27 | ||
@@ -36,17 +35,7 @@ PACKAGECONFIG[xcms] = "--enable-xcms,--disable-xcms" | |||
36 | 35 | ||
37 | PACKAGES =+ "${PN}-xcb" | 36 | PACKAGES =+ "${PN}-xcb" |
38 | 37 | ||
39 | do_install:append() { | 38 | FILES:${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt" |
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" | ||
50 | FILES:${PN}-xcb += "${libdir}/libX11-xcb.so.*" | 39 | FILES:${PN}-xcb += "${libdir}/libX11-xcb.so.*" |
51 | FILES:${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale" | 40 | FILES:${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale" |
52 | 41 | ||
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index 9d596be3a7..b9e60cbe4e 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py | |||
@@ -345,64 +345,29 @@ class Disk: | |||
345 | path)) | 345 | path)) |
346 | 346 | ||
347 | def copy(self, src, dest): | 347 | def copy(self, src, dest): |
348 | """Copy files or directories to/from the vfat or ext* partition.""" | 348 | """Copy partition image into wic image.""" |
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) | ||
351 | 350 | ||
352 | if self.partitions[pnum].fstype.startswith('ext'): | 351 | if self.partitions[pnum].fstype.startswith('ext'): |
353 | if isinstance(src, str): # host to image case | 352 | if isinstance(src, str): |
354 | if os.path.isdir(src): | 353 | cmd = "printf 'cd {}\nwrite {} {}\n' | {} -w {}".\ |
355 | base = os.path.abspath(src) | 354 | format(os.path.dirname(dest.path), src, os.path.basename(src), |
356 | base_parent = os.path.dirname(base) | 355 | self.debugfs, self._get_part_image(pnum)) |
357 | cmds = [] | 356 | else: # copy from wic |
358 | made = set() | 357 | # run both dump and rdump to support both files and directory |
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 | ||
393 | cmd = "printf 'cd {}\ndump /{} {}\nrdump /{} {}\n' | {} {}".\ | 358 | cmd = "printf 'cd {}\ndump /{} {}\nrdump /{} {}\n' | {} {}".\ |
394 | format(os.path.dirname(src.path), src.path, | 359 | format(os.path.dirname(src.path), src.path, |
395 | dest, src.path, dest, self.debugfs, partimg) | 360 | dest, src.path, dest, self.debugfs, |
396 | 361 | self._get_part_image(pnum)) | |
397 | else: # fat | 362 | else: # fat |
398 | if isinstance(src, str): | 363 | if isinstance(src, str): |
399 | cmd = "{} -i {} -snop {} ::{}".format(self.mcopy, | 364 | cmd = "{} -i {} -snop {} ::{}".format(self.mcopy, |
400 | partimg, | 365 | self._get_part_image(pnum), |
401 | src, dest.path) | 366 | src, dest.path) |
402 | else: | 367 | else: |
403 | cmd = "{} -i {} -snop ::{} {}".format(self.mcopy, | 368 | cmd = "{} -i {} -snop ::{} {}".format(self.mcopy, |
404 | partimg, | 369 | self._get_part_image(pnum), |
405 | src.path, dest) | 370 | src.path, dest) |
406 | 371 | ||
407 | exec_cmd(cmd, as_shell=True) | 372 | exec_cmd(cmd, as_shell=True) |
408 | self._put_part_image(pnum) | 373 | self._put_part_image(pnum) |
diff --git a/scripts/runqemu b/scripts/runqemu index 4bac151ccf..c28980e616 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -421,27 +421,8 @@ 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 rootfs_fixups(self): | 424 | def uncompress_rootfs(self): |
425 | 425 | """Decompress ZST rootfs image if needed""" | |
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 | |||
445 | if not self.rootfs or not self.fstype.endswith('.zst'): | 426 | if not self.rootfs or not self.fstype.endswith('.zst'): |
446 | return | 427 | return |
447 | 428 | ||
@@ -903,7 +884,7 @@ to your build configuration. | |||
903 | self.set('QB_MEM', qb_mem) | 884 | self.set('QB_MEM', qb_mem) |
904 | 885 | ||
905 | mach = self.get('MACHINE') | 886 | mach = self.get('MACHINE') |
906 | if not mach.startswith(('qemumips', 'qemux86', 'qemuloongarch64')) and self.get('QB_DTB') == "": | 887 | if not mach.startswith(('qemumips', 'qemux86', 'qemuloongarch64')): |
907 | self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' | 888 | self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' |
908 | 889 | ||
909 | self.qemu_opt_script += ' %s' % self.get('QB_MEM') | 890 | self.qemu_opt_script += ' %s' % self.get('QB_MEM') |
@@ -1828,7 +1809,7 @@ def main(): | |||
1828 | config.check_args() | 1809 | config.check_args() |
1829 | config.read_qemuboot() | 1810 | config.read_qemuboot() |
1830 | config.check_and_set() | 1811 | config.check_and_set() |
1831 | config.rootfs_fixups() | 1812 | config.uncompress_rootfs() |
1832 | # Check whether the combos is valid or not | 1813 | # Check whether the combos is valid or not |
1833 | config.validate_combos() | 1814 | config.validate_combos() |
1834 | config.print_config() | 1815 | config.print_config() |