diff options
| author | Sean Anderson <sean.anderson@seco.com> | 2022-10-21 19:37:25 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-10-26 12:28:40 +0100 |
| commit | 930dc57fc8dcbf9ca8a3a431a8c4c02901f63182 (patch) | |
| tree | a6a16d60f1617e5467470f5374e5115b37b6f01f | |
| parent | deb6b92d44bf31265b6187d29c1b068517ec25c2 (diff) | |
| download | poky-930dc57fc8dcbf9ca8a3a431a8c4c02901f63182.tar.gz | |
uboot-sign: Split off kernel-fitimage variables
In preparation for the next commit, split off several
(From OE-Core rev: 60c1a170f1f8c11bc8f42026debf121433b39115)
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-recipe/kernel-fitimage.bbclass | 25 | ||||
| -rw-r--r-- | meta/classes-recipe/uboot-config.bbclass | 3 | ||||
| -rw-r--r-- | meta/classes-recipe/uboot-sign.bbclass | 19 |
3 files changed, 32 insertions, 15 deletions
diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index 8ddebf8dd8..e4a130a0f2 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass | |||
| @@ -65,6 +65,31 @@ python __anonymous () { | |||
| 65 | # Description string | 65 | # Description string |
| 66 | FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" | 66 | FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" |
| 67 | 67 | ||
| 68 | # Kernel fitImage Hash Algo | ||
| 69 | FIT_HASH_ALG ?= "sha256" | ||
| 70 | |||
| 71 | # Kernel fitImage Signature Algo | ||
| 72 | FIT_SIGN_ALG ?= "rsa2048" | ||
| 73 | |||
| 74 | # Kernel / U-Boot fitImage Padding Algo | ||
| 75 | FIT_PAD_ALG ?= "pkcs-1.5" | ||
| 76 | |||
| 77 | # Generate keys for signing Kernel fitImage | ||
| 78 | FIT_GENERATE_KEYS ?= "0" | ||
| 79 | |||
| 80 | # Size of private keys in number of bits | ||
| 81 | FIT_SIGN_NUMBITS ?= "2048" | ||
| 82 | |||
| 83 | # args to openssl genrsa (Default is just the public exponent) | ||
| 84 | FIT_KEY_GENRSA_ARGS ?= "-F4" | ||
| 85 | |||
| 86 | # args to openssl req (Default is -batch for non interactive mode and | ||
| 87 | # -new for new certificate) | ||
| 88 | FIT_KEY_REQ_ARGS ?= "-batch -new" | ||
| 89 | |||
| 90 | # Standard format for public key certificate | ||
| 91 | FIT_KEY_SIGN_PKCS ?= "-x509" | ||
| 92 | |||
| 68 | # Sign individual images as well | 93 | # Sign individual images as well |
| 69 | FIT_SIGN_INDIVIDUAL ?= "0" | 94 | FIT_SIGN_INDIVIDUAL ?= "0" |
| 70 | 95 | ||
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass index 7ab006a20d..73dc464444 100644 --- a/meta/classes-recipe/uboot-config.bbclass +++ b/meta/classes-recipe/uboot-config.bbclass | |||
| @@ -80,6 +80,9 @@ SPL_MKIMAGE_DTCOPTS ??= "" | |||
| 80 | UBOOT_MKIMAGE ?= "uboot-mkimage" | 80 | UBOOT_MKIMAGE ?= "uboot-mkimage" |
| 81 | UBOOT_MKIMAGE_SIGN ?= "${UBOOT_MKIMAGE}" | 81 | UBOOT_MKIMAGE_SIGN ?= "${UBOOT_MKIMAGE}" |
| 82 | 82 | ||
| 83 | # Signature activation - this requires KERNEL_IMAGETYPE = "fitImage" | ||
| 84 | UBOOT_SIGN_ENABLE ?= "0" | ||
| 85 | |||
| 83 | # Arguments passed to mkimage for signing | 86 | # Arguments passed to mkimage for signing |
| 84 | UBOOT_MKIMAGE_SIGN_ARGS ?= "" | 87 | UBOOT_MKIMAGE_SIGN_ARGS ?= "" |
| 85 | SPL_MKIMAGE_SIGN_ARGS ?= "" | 88 | SPL_MKIMAGE_SIGN_ARGS ?= "" |
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index 85e23b963f..569907fa68 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass | |||
| @@ -43,8 +43,7 @@ inherit uboot-config | |||
| 43 | # Enable use of a U-Boot fitImage | 43 | # Enable use of a U-Boot fitImage |
| 44 | UBOOT_FITIMAGE_ENABLE ?= "0" | 44 | UBOOT_FITIMAGE_ENABLE ?= "0" |
| 45 | 45 | ||
| 46 | # Signature activation - these require their respective fitImages | 46 | # Signature activation - this requires UBOOT_FITIMAGE_ENABLE = "1" |
| 47 | UBOOT_SIGN_ENABLE ?= "0" | ||
| 48 | SPL_SIGN_ENABLE ?= "0" | 47 | SPL_SIGN_ENABLE ?= "0" |
| 49 | 48 | ||
| 50 | # Default value for deployment filenames. | 49 | # Default value for deployment filenames. |
| @@ -71,36 +70,26 @@ SPL_NODTB_SYMLINK ?= "u-boot-spl-nodtb-${MACHINE}.bin" | |||
| 71 | # U-Boot fitImage description | 70 | # U-Boot fitImage description |
| 72 | UBOOT_FIT_DESC ?= "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" | 71 | UBOOT_FIT_DESC ?= "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" |
| 73 | 72 | ||
| 74 | # Kernel / U-Boot fitImage Hash Algo | 73 | # U-Boot fitImage Hash Algo |
| 75 | FIT_HASH_ALG ?= "sha256" | ||
| 76 | UBOOT_FIT_HASH_ALG ?= "sha256" | 74 | UBOOT_FIT_HASH_ALG ?= "sha256" |
| 77 | 75 | ||
| 78 | # Kernel / U-Boot fitImage Signature Algo | 76 | # U-Boot fitImage Signature Algo |
| 79 | FIT_SIGN_ALG ?= "rsa2048" | ||
| 80 | UBOOT_FIT_SIGN_ALG ?= "rsa2048" | 77 | UBOOT_FIT_SIGN_ALG ?= "rsa2048" |
| 81 | 78 | ||
| 82 | # Kernel / U-Boot fitImage Padding Algo | 79 | # Generate keys for signing U-Boot fitImage |
| 83 | FIT_PAD_ALG ?= "pkcs-1.5" | ||
| 84 | |||
| 85 | # Generate keys for signing Kernel / U-Boot fitImage | ||
| 86 | FIT_GENERATE_KEYS ?= "0" | ||
| 87 | UBOOT_FIT_GENERATE_KEYS ?= "0" | 80 | UBOOT_FIT_GENERATE_KEYS ?= "0" |
| 88 | 81 | ||
| 89 | # Size of private keys in number of bits | 82 | # Size of private keys in number of bits |
| 90 | FIT_SIGN_NUMBITS ?= "2048" | ||
| 91 | UBOOT_FIT_SIGN_NUMBITS ?= "2048" | 83 | UBOOT_FIT_SIGN_NUMBITS ?= "2048" |
| 92 | 84 | ||
| 93 | # args to openssl genrsa (Default is just the public exponent) | 85 | # args to openssl genrsa (Default is just the public exponent) |
| 94 | FIT_KEY_GENRSA_ARGS ?= "-F4" | ||
| 95 | UBOOT_FIT_KEY_GENRSA_ARGS ?= "-F4" | 86 | UBOOT_FIT_KEY_GENRSA_ARGS ?= "-F4" |
| 96 | 87 | ||
| 97 | # args to openssl req (Default is -batch for non interactive mode and | 88 | # args to openssl req (Default is -batch for non interactive mode and |
| 98 | # -new for new certificate) | 89 | # -new for new certificate) |
| 99 | FIT_KEY_REQ_ARGS ?= "-batch -new" | ||
| 100 | UBOOT_FIT_KEY_REQ_ARGS ?= "-batch -new" | 90 | UBOOT_FIT_KEY_REQ_ARGS ?= "-batch -new" |
| 101 | 91 | ||
| 102 | # Standard format for public key certificate | 92 | # Standard format for public key certificate |
| 103 | FIT_KEY_SIGN_PKCS ?= "-x509" | ||
| 104 | UBOOT_FIT_KEY_SIGN_PKCS ?= "-x509" | 93 | UBOOT_FIT_KEY_SIGN_PKCS ?= "-x509" |
| 105 | 94 | ||
| 106 | # Functions on this bbclass can apply to either U-boot or Kernel, | 95 | # Functions on this bbclass can apply to either U-boot or Kernel, |
