diff options
-rw-r--r-- | onlineupdate/CustomTarget_generated.mk | 4 | ||||
-rwxr-xr-x | onlineupdate/source/update/updater/gen_cert_header.py | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/onlineupdate/CustomTarget_generated.mk b/onlineupdate/CustomTarget_generated.mk index 0c0f230387a8..346629976328 100644 --- a/onlineupdate/CustomTarget_generated.mk +++ b/onlineupdate/CustomTarget_generated.mk @@ -15,13 +15,13 @@ $(onlineupdate_INC)/primaryCert.h : \ $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1) mkdir -p $(dir $@) - $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "primaryCertData" /lo/users/moggi/NSSDBDir/master-daily.der > $(onlineupdate_INC)/primaryCert.h #"$(UPDATE_CONFIG)" + $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "primaryCertData" $(UPDATE_CONFIG) > $(onlineupdate_INC)/primaryCert.h #"$(UPDATE_CONFIG)" $(onlineupdate_INC)/secondaryCert.h : \ $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1) mkdir -p $(dir $@) - $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "secondaryCertData" /lo/users/moggi/NSSDBDir/master-daily.der > $(onlineupdate_INC)/secondaryCert.h #"$(UPDATE_CONFIG)" + $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "secondaryCertData" $(UPDATE_CONFIG) > $(onlineupdate_INC)/secondaryCert.h #"$(UPDATE_CONFIG)" $(call gb_CustomTarget_get_target,onlineupdate/generated) : \ $(onlineupdate_INC)/primaryCert.h \ diff --git a/onlineupdate/source/update/updater/gen_cert_header.py b/onlineupdate/source/update/updater/gen_cert_header.py index 5b70758db3f2..8fedcd9bcf62 100755 --- a/onlineupdate/source/update/updater/gen_cert_header.py +++ b/onlineupdate/source/update/updater/gen_cert_header.py @@ -2,6 +2,7 @@ import sys import binascii +import configparser def file_byte_generator(filename): with open(filename, "rb") as f: @@ -17,6 +18,8 @@ def create_header(array_name, in_filename): if __name__ == '__main__': if len(sys.argv) < 3: - print('ERROR: usage: gen_cert_header.py array_name in_filename') + print('ERROR: usage: gen_cert_header.py array_name update_config_file') sys.exit(1); - sys.exit(create_header(sys.argv[1], sys.argv[2])) + config = configparser.ConfigParser() + config.read(sys.argv[2]) + sys.exit(create_header(sys.argv[1], config['Updater']['certificate-der'])) |