mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-20 21:13:36 +08:00
Add new cacertder option
Allows you to add a custom ca cert to an image. Note: This option is only relevant for newer (as yet unreleased) bootloader images that support custom CA certs and reserve a space for this in the flash image.
This commit is contained in:
@@ -19,6 +19,7 @@ VALID_IMAGE_SIZES = [512 * 1024, 2 * 1024 * 1024]
|
|||||||
BOOTCONF_TXT = 'bootconf.txt'
|
BOOTCONF_TXT = 'bootconf.txt'
|
||||||
BOOTCONF_SIG = 'bootconf.sig'
|
BOOTCONF_SIG = 'bootconf.sig'
|
||||||
PUBKEY_BIN = 'pubkey.bin'
|
PUBKEY_BIN = 'pubkey.bin'
|
||||||
|
CACERT_DER = 'cacert.der'
|
||||||
|
|
||||||
# Each section starts with a magic number followed by a 32 bit offset to the
|
# Each section starts with a magic number followed by a 32 bit offset to the
|
||||||
# next section (big-endian).
|
# next section (big-endian).
|
||||||
@@ -515,6 +516,7 @@ See 'rpi-eeprom-update -h' for more information about the available EEPROM image
|
|||||||
parser.add_argument('-p', '--pubkey', help='Signed boot only. The name of the RSA public key file to store in the EEPROM', required=False)
|
parser.add_argument('-p', '--pubkey', help='Signed boot only. The name of the RSA public key file to store in the EEPROM', required=False)
|
||||||
parser.add_argument('-x', '--extract', action='store_true', default=False, help='Extract the modifiable files (boot.conf, pubkey, signature)', required=False)
|
parser.add_argument('-x', '--extract', action='store_true', default=False, help='Extract the modifiable files (boot.conf, pubkey, signature)', required=False)
|
||||||
parser.add_argument('-t', '--timestamp', help='Set the timestamp in the EEPROM image file', required=False)
|
parser.add_argument('-t', '--timestamp', help='Set the timestamp in the EEPROM image file', required=False)
|
||||||
|
parser.add_argument('--cacertder', help='The name of a CA Certificate DER encoded file to store in the EEPROM', required=False)
|
||||||
parser.add_argument('eeprom', nargs='?', help='Name of EEPROM file to use as input')
|
parser.add_argument('eeprom', nargs='?', help='Name of EEPROM file to use as input')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -545,6 +547,8 @@ See 'rpi-eeprom-update -h' for more information about the available EEPROM image
|
|||||||
image.update_file(args.digest, BOOTCONF_SIG)
|
image.update_file(args.digest, BOOTCONF_SIG)
|
||||||
if args.pubkey is not None:
|
if args.pubkey is not None:
|
||||||
image.update_key(args.pubkey, PUBKEY_BIN)
|
image.update_key(args.pubkey, PUBKEY_BIN)
|
||||||
|
if args.cacertder is not None:
|
||||||
|
image.update_file(args.cacertder, CACERT_DER)
|
||||||
image.write()
|
image.write()
|
||||||
elif args.config is None and args.timestamp is not None:
|
elif args.config is None and args.timestamp is not None:
|
||||||
image.write()
|
image.write()
|
||||||
|
|||||||
Reference in New Issue
Block a user