Skip to content

Commit 5acec53

Browse files
authored
Add SECURE_UPGRADE_PROD_TOOL_ARGS flag to make it possible for vendors to pass their own arguments on the prod signing script (#14581)
- Why I did it Since the prod signing tool is vendor specific, and each vendor may have different arguments they would like to use in the script, we would need a way to inject those arguments to the script. - How I did it Add a compilation flag SECURE_UPGRADE_PROD_TOOL_ARGS which vendors can use to inject any flag they would want to the prod signing script. - How to verify it Build SONiC using your own prod script
1 parent 1175143 commit 5acec53

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

Makefile.work

+1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
545545
SECURE_UPGRADE_DEV_SIGNING_KEY=$(SECURE_UPGRADE_DEV_SIGNING_KEY) \
546546
SECURE_UPGRADE_SIGNING_CERT=$(SECURE_UPGRADE_SIGNING_CERT) \
547547
SECURE_UPGRADE_PROD_SIGNING_TOOL=$(SECURE_UPGRADE_PROD_SIGNING_TOOL) \
548+
SECURE_UPGRADE_PROD_TOOL_ARGS=$(SECURE_UPGRADE_PROD_TOOL_ARGS) \
548549
SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
549550
ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \
550551
SLAVE_DIR=$(SLAVE_DIR) \

build_debian.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,11 @@ if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" && $SONIC_
674674
exit 1
675675
fi
676676

677-
sudo $sonic_su_prod_signing_tool $CONFIGURED_ARCH $FILESYSTEM_ROOT $LINUX_KERNEL_VERSION $OUTPUT_SEC_BOOT_DIR
677+
sudo $sonic_su_prod_signing_tool -a $CONFIGURED_ARCH \
678+
-r $FILESYSTEM_ROOT \
679+
-l $LINUX_KERNEL_VERSION \
680+
-o $OUTPUT_SEC_BOOT_DIR \
681+
$SECURE_UPGRADE_PROD_TOOL_ARGS
678682

679683
# verifying all EFI files and kernel modules in $OUTPUT_SEC_BOOT_DIR
680684
sudo ./scripts/secure_boot_signature_verification.sh -e $OUTPUT_SEC_BOOT_DIR \

rules/config

+2
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,12 @@ SONIC_ENABLE_SECUREBOOT_SIGNATURE ?= n
226226
# SECURE_UPGRADE_SIGNING_CERT - path to development signing certificate, used for image signing during build
227227
# SECURE_UPGRADE_MODE - enum value for secure upgrade mode, valid options are "dev", "prod" and "no_sign"
228228
# SECURE_UPGRADE_PROD_SIGNING_TOOL - path to a vendor signing tool for production flow.
229+
# SECURE_UPGRADE_PROD_TOOL_ARGS - Extra arguments options for vendor to use to run his specific prod signing script
229230
SECURE_UPGRADE_DEV_SIGNING_KEY ?=
230231
SECURE_UPGRADE_SIGNING_CERT ?=
231232
SECURE_UPGRADE_MODE = "no_sign"
232233
SECURE_UPGRADE_PROD_SIGNING_TOOL ?=
234+
SECURE_UPGRADE_PROD_TOOL_ARGS ?=
233235
# PACKAGE_URL_PREFIX - the package url prefix
234236
PACKAGE_URL_PREFIX ?= https://packages.trafficmanager.net/public/packages
235237

slave.mk

+2
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ $(info "SECURE_UPGRADE_MODE" : "$(SECURE_UPGRADE_MODE)")
383383
$(info "SECURE_UPGRADE_DEV_SIGNING_KEY" : "$(SECURE_UPGRADE_DEV_SIGNING_KEY)")
384384
$(info "SECURE_UPGRADE_SIGNING_CERT" : "$(SECURE_UPGRADE_SIGNING_CERT)")
385385
$(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)")
386+
$(info "SECURE_UPGRADE_PROD_TOOL_ARGS" : "$(SECURE_UPGRADE_PROD_TOOL_ARGS)")
386387
$(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)")
387388
$(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)")
388389
$(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)")
@@ -1458,6 +1459,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
14581459
SECURE_UPGRADE_DEV_SIGNING_KEY="$(SECURE_UPGRADE_DEV_SIGNING_KEY)" \
14591460
SECURE_UPGRADE_SIGNING_CERT="$(SECURE_UPGRADE_SIGNING_CERT)" \
14601461
SECURE_UPGRADE_PROD_SIGNING_TOOL="$(SECURE_UPGRADE_PROD_SIGNING_TOOL)" \
1462+
SECURE_UPGRADE_PROD_TOOL_ARGS="$(SECURE_UPGRADE_PROD_TOOL_ARGS)" \
14611463
SIGNING_KEY="$(SIGNING_KEY)" \
14621464
SIGNING_CERT="$(SIGNING_CERT)" \
14631465
CA_CERT="$(CA_CERT)" \

0 commit comments

Comments
 (0)