Skip to content

Commit 46694a8

Browse files
committed
[secure boot]Fix Secure boot build flag condition by adding an extra defined verification
1 parent e0d9df7 commit 46694a8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
126126
../manage-config $(CONFIGURED_ARCH) $(CONFIGURED_PLATFORM)
127127
fi
128128

129-
ifeq ($(SECURE_UPGRADE_MOD),$(filter $(SECURE_UPGRADE_MOD),dev prod))
129+
# Secure Boot Configuration
130+
ifneq ($(origin SECURE_UPGRADE_MODE), undefined)
131+
ifeq ($(SECURE_UPGRADE_MODE),$(filter $(SECURE_UPGRADE_MODE),dev prod))
132+
ifneq ($(origin SECURE_UPGRADE_DEV_SIGNING_CERT), undefined)
130133
if [ -f $(SECURE_UPGRADE_DEV_SIGNING_CERT) ]; then
131134
echo "Add secure boot support in kernel config file"
132135
cp ../patch/secure_boot_kernel_config.sh .
@@ -136,8 +139,11 @@ ifeq ($(SECURE_UPGRADE_MOD),$(filter $(SECURE_UPGRADE_MOD),dev prod))
136139
echo "no certificate file exists, SECURE_UPGRADE_DEV_SIGNING_CERT=$(SECURE_UPGRADE_DEV_SIGNING_CERT)"
137140
exit 1
138141
fi
139-
140-
endif # ifeq ($(SECURE_UPGRADE_MOD),$(filter $(SECURE_UPGRADE_MOD),dev prod))
142+
else
143+
echo "SECURE_UPGRADE_DEV_SIGNING_CERT is not defined"
144+
endif # ifneq ($(origin SECURE_UPGRADE_DEV_SIGNING_CERT), undefined)
145+
endif # ifeq ($(SECURE_UPGRADE_MODE),$(filter $(SECURE_UPGRADE_MODE),dev prod))
146+
endif # ifneq ($(origin SECURE_UPGRADE_MODE), undefined)
141147

142148
# Building a custom kernel from Debian kernel source
143149
ARCH=$(CONFIGURED_ARCH) DEB_HOST_ARCH=$(CONFIGURED_ARCH) DEB_BUILD_PROFILES=nodoc fakeroot make -f debian/rules -j $(shell nproc) binary-indep

0 commit comments

Comments
 (0)