From a4e291b0ebf4284529f619cd0b6616d5381a5283 Mon Sep 17 00:00:00 2001 From: Johnny Lin Date: Thu, 24 Nov 2022 08:31:26 +0800 Subject: [PATCH 1/3] Run a shell script 'vpd.sh' for VPD customization under your project The vpd.sh can do your own customization such as setting VPD variables during build. For example, project folder is osf-builder/projects/deltalake, you can place vpd.sh under deltalake with a vpd.sh script like: #!/bin/bash VPD="../../tools/vpd" ROM="build/deltalake/coreboot/build/coreboot.rom" #Or don't add '-O' that reformats the RO_VPD created by osf-builder/Makefile.inc $VPD -f $ROM -O -i RO_VPD -s fsp_log_enable=0 $VPD -f $ROM -i RO_VPD -s test_key=123 $VPD -f $ROM -O -i RW_VPD Signed-off-by: Johnny Lin --- Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.inc b/Makefile.inc index b90557b..27f488c 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -119,6 +119,7 @@ $(ROM_OUT): $(COREBOOT_OUT) $(VPD_TOOL) -f "$<" -O -i RO_VPD -s internal_versions="`cat $(FINAL_CONFIG_OUT)`" [ -z "$(VERSION)" ] || $(VPD_TOOL) -f "$<" -i RO_VPD -s firmware_version=$(VERSION) $(VPD_TOOL) -f "$<" -O -i RW_VPD || true # Format RW_VPD region, if present. + [ -f "$(CURDIR)/vpd.sh" ] && bash "$(CURDIR)/vpd.sh" || echo "$(CURDIR)/vpd.sh doesn't exist" cp "$<" "$@" @echo '***' >&2 @echo '*** Build done, $@' >&2 From 6ba9de05af2a2db19d3f1ce84672793b6ad13f9c Mon Sep 17 00:00:00 2001 From: Johnny Lin <50692592+johnnylinwiwynn@users.noreply.github.com> Date: Thu, 24 Nov 2022 09:20:37 +0800 Subject: [PATCH 2/3] Update README.md for vpd.sh Signed-off-by: Johnny Lin --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b355b1d..740d4e3 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Entire build requires `PLATFORM` to be defined, this specifies the platform for * `make wipe` will wipe everything, including downloaded deps. * `make wipe-coreboot` and `make wipe-kernel` will clean just the coreboot and kernel components. * Note that toolchain cache survives wipe and will be used in the next build. +* You can place a shell script vpd.sh under your project folder which would be executed for your customized actions such as setting your VPD key-value pairs to your coreboot image. ## License From b78a8fbf728dc25417c510ef86de8a7aab38591f Mon Sep 17 00:00:00 2001 From: Johnny Lin Date: Thu, 24 Nov 2022 11:31:21 +0800 Subject: [PATCH 3/3] Add a sample vpd.sh for qemu Signed-off-by: Johnny Lin --- examples/qemu/vpd.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 examples/qemu/vpd.sh diff --git a/examples/qemu/vpd.sh b/examples/qemu/vpd.sh new file mode 100755 index 0000000..1145976 --- /dev/null +++ b/examples/qemu/vpd.sh @@ -0,0 +1,9 @@ +#!/bin/bash +VPD="../../tools/vpd" +ROM="build/qemu-x86_64/coreboot/build/coreboot.rom" + +#Or don't add '-O' that reformats the RO_VPD created by osf-builder/Makefile.inc +$VPD -f $ROM -O -i RO_VPD -s fsp_log_enable=0 +$VPD -f $ROM -i RO_VPD -s test_key=123 +$VPD -f $ROM -O -i RW_VPD +