diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/classes')
4 files changed, 121 insertions, 30 deletions
diff --git a/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass b/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass new file mode 100644 index 000000000..834c09229 --- /dev/null +++ b/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass @@ -0,0 +1,112 @@ +
+
+inherit obmc-phosphor-full-fitimage
+
+require recipes-core/os-release/version-vars.inc
+
+IMAGE_TYPES += "intel-pfr"
+
+IMAGE_TYPEDEP_intel-pfr = "mtd-auto"
+IMAGE_TYPES_MASKED += "intel-pfr"
+
+# PFR macros
+# directory where PFR scripts and key are copied
+PFR_STAGING_DIR = "${STAGING_DIR}/intel-pfr-files"
+# PFR images directory
+PFR_IMAGES_DIR = "${DEPLOY_DIR_IMAGE}/pfr_images"
+
+# Refer flash map in manifest.json for the addresses offset
+PFM_OFFSET = "0x80000"
+
+# 0x80000/1024 = 0x200 or 512, 1K Page size.
+PFM_OFFSET_PAGE = "512"
+
+# RC_IMAGE
+RC_IMAGE_OFFSET = "0x02a00000"
+
+# RC_IMAGE_PAGE= 0x02a00000/1024 = 0xA800 or 43008
+RC_IMAGE_PAGE = "43008"
+
+do_image_pfr () {
+ bbplain "Generating Intel PFR compliant BMC image"
+
+ bbplain "Build Version = ${build_version}"
+ bbplain "Build Number = ${build_number}"
+ bbplain "Build Hash = ${build_hash}"
+
+ mkdir -p "${PFR_IMAGES_DIR}"
+ cd "${PFR_IMAGES_DIR}"
+
+ # python script that does the creating PFM, BMC compressed and unsigned images from BMC 128MB raw binary file.
+ python ${PFR_STAGING_DIR}/pfr_image.py ${PFR_STAGING_DIR}/pfr_image-manifest.json ${DEPLOY_DIR_IMAGE}/image-mtd ${build_version} ${build_number} ${build_hash}
+
+ # sign the PFM region
+ ${PFR_STAGING_DIR}/blocksign -c ${PFR_STAGING_DIR}/pfm_config.xml -o ${PFR_IMAGES_DIR}/pfm_signed.bin ${PFR_IMAGES_DIR}/pfm.bin
+
+ # Add the signed PFM to rom image
+ dd bs=1k conv=notrunc seek=${PFM_OFFSET_PAGE} if=${PFR_IMAGES_DIR}/pfm_signed.bin of=${PFR_IMAGES_DIR}/image-mtd-pfr
+
+ # Create unsigned BMC update capsule - append with 1. pfm_signed, 2. pbc, 3. bmc compressed
+ dd if=${PFR_IMAGES_DIR}/pfm_signed.bin bs=1k >> ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ dd if=${PFR_IMAGES_DIR}/pbc.bin bs=1k >> ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ dd if=${PFR_IMAGES_DIR}/bmc_compressed.bin bs=1k >> ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ # Sign the BMC update capsule
+ ${PFR_STAGING_DIR}/blocksign -c ${PFR_STAGING_DIR}/bmc_config.xml -o ${PFR_IMAGES_DIR}/bmc_signed_cap.bin ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ # Add the signed bmc update capsule to full rom image @ 0x2a00000
+ dd bs=1k conv=notrunc seek=${RC_IMAGE_PAGE} if=${PFR_IMAGES_DIR}/bmc_signed_cap.bin of=${PFR_IMAGES_DIR}/image-mtd-pfr
+
+ # Append date and time to all the PFR images
+ mv ${PFR_IMAGES_DIR}/pfm_signed.bin ${PFR_IMAGES_DIR}/pfm_signed-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/pfm.bin ${PFR_IMAGES_DIR}/pfm-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/pbc.bin ${PFR_IMAGES_DIR}/pbc-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/bmc_compressed.bin ${PFR_IMAGES_DIR}/bmc_compressed-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin ${PFR_IMAGES_DIR}/bmc_unsigned-cap_${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/bmc_signed_cap.bin ${PFR_IMAGES_DIR}/bmc_signed_cap-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/image-mtd-pfr ${PFR_IMAGES_DIR}/image-mtd-pfr-${DATETIME}
+}
+
+do_image_pfr[vardepsexclude] += "DATETIME"
+do_image_pfr[vardeps] += "IPMI_MAJOR IPMI_MINOR IPMI_AUX13 IPMI_AUX14 IPMI_AUX15 IPMI_AUX16"
+
+python() {
+ types = d.getVar('IMAGE_FSTYPES', True).split()
+
+ if 'intel-pfr' in types:
+
+ bld_ver1 = d.getVar('IPMI_MAJOR', True)
+ bld_ver1 = int(bld_ver1) << 8
+
+ bld_ver2 = d.getVar('IPMI_MINOR', True)
+ bld_ver2 = int(bld_ver2)
+
+ bld_ver = bld_ver1 | bld_ver2
+ d.setVar('build_version', str(bld_ver))
+
+ bld_num = d.getVar('IPMI_AUX13', True)
+
+ d.setVar('build_number', bld_num)
+
+ bld_hash1 = d.getVar('IPMI_AUX14', True)
+ bld_hash2 = d.getVar('IPMI_AUX15', True)
+ bld_hash3 = d.getVar('IPMI_AUX16', True)
+
+ bld_hash1 = int(bld_hash1, 16)
+ bld_hash2 = int(bld_hash2, 16)
+ bld_hash3 = int(bld_hash3, 16)
+
+ bld_hash = bld_hash3 << 16
+ bld_hash |= bld_hash2 << 8
+ bld_hash |= bld_hash1
+
+ d.setVar('build_hash', str(bld_hash))
+
+ bb.build.addtask(# task, depends_on_task, task_depends_on, d )
+ 'do_image_pfr',
+ 'do_build',
+ 'do_generate_auto', d)
+}
+
diff --git a/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass b/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass index 24469356f..f90a19c4b 100644 --- a/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass +++ b/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass @@ -19,11 +19,13 @@ IMAGE_TYPES_MASKED += "mtd-auto" # Flash characteristics in KB unless otherwise noted python() { + types = d.getVar('IMAGE_FSTYPES', True).split() + # TODO: find partition list in DTS d.setVar('FLASH_UBOOT_OFFSET', str(0)) - if d.getVar('IMAGE_TYPE', True) == 'pfr': + if 'intel-pfr' in types: d.setVar('FLASH_SIZE', str(128*1024)) - DTB_FULL_FIT_IMAGE_OFFSETS = [0x1100000] + DTB_FULL_FIT_IMAGE_OFFSETS = [0xb00000] else: d.setVar('FLASH_SIZE', str(64*1024)) DTB_FULL_FIT_IMAGE_OFFSETS = [0x80000, 0x2480000] @@ -42,7 +44,7 @@ mk_nor_image() { } do_generate_auto() { - bbdebug 1 "do_generate_auto IMAGE_TYPE=${IMAGE_TYPE} size=${FLASH_SIZE}KB (${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.auto.mtd)" + bbdebug 1 "do_generate_auto IMAGE_TYPES=${IMAGE_TYPES} size=${FLASH_SIZE}KB (${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.auto.mtd)" # Assemble the flash image mk_nor_image ${IMGDEPLOYDIR}/${IMAGE_NAME}.auto.mtd ${FLASH_SIZE} dd bs=1k conv=notrunc seek=${FLASH_UBOOT_OFFSET} \ diff --git a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass index fefa65569..26c895951 100644 --- a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass +++ b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass @@ -10,14 +10,6 @@ DEPS = " ${PN}:do_image_${@d.getVar('IMAGE_BASETYPE', True).replace('-', '_')} \ virtual/kernel:do_deploy \ u-boot:do_populate_sysroot " -python() { - if d.getVar('IMAGE_TYPE', True) == 'pfr': - d.appendVar('DEPS', ' openssl-native:do_populate_sysroot \ - ${SIGNING_KEY_DEPENDS} \ - ${PN}:do_copy_signing_pubkey') -} - - # Options for the device tree compiler passed to mkimage '-D' feature: UBOOT_MKIMAGE_DTCOPTS ??= "" @@ -478,14 +470,6 @@ python do_generate_phosphor_manifest() { fd.write('HashType=RSA-SHA256\n') } -make_signatures() { - signature_files="" - for file in "$@"; do - openssl dgst -sha256 -sign ${SIGNING_KEY} -out "${file}.sig" $file - signature_files="${signature_files} ${file}.sig" - done -} - def get_pubkey_type(d): return os.listdir(get_pubkey_basedir(d))[0] @@ -534,14 +518,7 @@ do_image_fitimage_rootfs() { # touch the required files to minimize change touch image-kernel image-rofs image-rwfs - if [ "${IMAGE_TYPE}" = "pfr" ]; then - ln -sf ${S}/publickey publickey - make_signatures image-u-boot image-kernel image-rofs image-rwfs image-runtime MANIFEST publickey - # tar up the update package - tar -h -cvf "${DEPLOY_DIR_IMAGE}/${PN}-image-update-${MACHINE}-${DATETIME}.tar" image-u-boot image-runtime image-kernel image-rofs image-rwfs MANIFEST publickey ${signature_files} - else - tar -h -cvf "${DEPLOY_DIR_IMAGE}/${PN}-image-update-${MACHINE}-${DATETIME}.tar" MANIFEST image-u-boot image-runtime image-kernel image-rofs image-rwfs - fi + tar -h -cvf "${DEPLOY_DIR_IMAGE}/${PN}-image-update-${MACHINE}-${DATETIME}.tar" MANIFEST image-u-boot image-runtime image-kernel image-rofs image-rwfs # make a symlink ln -sf "${PN}-image-update-${MACHINE}-${DATETIME}.tar" "${DEPLOY_DIR_IMAGE}/image-update-${MACHINE}" ln -sf "image-update-${MACHINE}" "${DEPLOY_DIR_IMAGE}/image-update" diff --git a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass index 4ad3b2b92..a495b76fa 100644 --- a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass +++ b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass @@ -1,7 +1,6 @@ inherit obmc-phosphor-image IMAGE_INSTALL_append = " \ - fan-default-speed \ bmcweb \ dbus-broker \ dtc \ @@ -19,7 +18,6 @@ IMAGE_INSTALL_append = " \ smbios-mdrv1 \ phosphor-certificate-manager \ phosphor-sel-logger \ - gpiodaemon \ smbios-mdrv2 \ obmc-ikvm \ system-watchdog \ @@ -31,8 +29,10 @@ IMAGE_INSTALL_append = " \ mtd-utils-ubifs \ special-mode-mgr \ rsyslog \ - rsyslog-policy \ static-mac-addr \ + phosphor-u-boot-mgr \ + prov-mode-mgr \ + ac-boot-check \ " # this package was flagged as a security risk |