]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
runqemu: avoid setting "mem=" when using a DTB
authorJon Mason <jon.mason@arm.com>
Thu, 13 Nov 2025 15:18:01 +0000 (10:18 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 17 Nov 2025 11:09:03 +0000 (11:09 +0000)
Some emulated machines, such as the Raspberry Pi models, fail to boot
if a fixed "mem=" value is passed on the kernel command line. When a
DTB is used (QB_DTB is set), the memory size is already defined there,
so specifying it again is unnecessary and can cause issues.

Skip adding "mem=" to the kernel command line when QB_DTB is present.

Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu

index 2be7a0f2869fa6a173d062ad9b9b7808821e90af..370b45578137bbdc665c5daca169d12c7b121815 100755 (executable)
@@ -884,7 +884,7 @@ to your build configuration.
         self.set('QB_MEM', qb_mem)
 
         mach = self.get('MACHINE')
-        if not mach.startswith(('qemumips', 'qemux86', 'qemuloongarch64')):
+        if not mach.startswith(('qemumips', 'qemux86', 'qemuloongarch64')) and self.get('QB_DTB') == "":
             self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
 
         self.qemu_opt_script += ' %s' % self.get('QB_MEM')