]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[riscv] Add a .pf32 build target for padded parallel flash images
authorMichael Brown <mcb30@ipxe.org>
Tue, 13 May 2025 17:25:24 +0000 (18:25 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 13 May 2025 17:25:24 +0000 (18:25 +0100)
QEMU's -pflash option requires an image that has been padded to the
exact expected size (32MB for all of the supported RISC-V virtual
machines).

Add a .pf32 build target which is simply the equivalent .sbi target
padded to 32MB in size, to simplify testing.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile
src/arch/riscv/Makefile.sbi

index be5c7fda6b060c3ea7cce440752d7a6a44ddee31..6367b13ea9ef2761b89cf0427c86be43eb067009 100644 (file)
@@ -26,6 +26,7 @@ PRINTF                := printf
 PERL           := perl
 PYTHON         := python
 TRUE           := true
+TRUNCATE       := truncate
 CC             = $(CROSS_COMPILE)gcc
 CPP            = $(CC) -E
 AS             = $(CROSS_COMPILE)as
index 2546366b2300e9b9c4f75e42a254f6bfd08116f8..d748ef42eb386eaea4e64f37dbe3a52b2d00a288 100644 (file)
@@ -15,3 +15,10 @@ LDSCRIPT     = arch/riscv/scripts/sbi.lds
 #
 MEDIA          += sbi
 MEDIA          += lkrn
+
+# Padded flash device images (e.g. for QEMU's -pflash option)
+#
+NON_AUTO_MEDIA += pf32
+%.pf32 : %.sbi $(MAKEDEPS)
+       $(Q)$(CP) $< $@
+       $(Q)$(TRUNCATE) -s 32M $@