Include brand code in signer_config.csv signer_config.csv file is used by the singer when generating firmware blobs including images for multiple targets. It is necessary to include the RLZ code (brand code) in the file so that the signer can properly sign RO_GSCVPD sections of the AP firmware images. There are two Pyhton scripts in this directory which generated signer_config.csv during build, the instance generated by ./pack_firmware.py is included in the firmware update self extracting image, and then another one is created by ./local_signer.py and is available along with BIOS images in /build/<board>/firmware. BUG=b:248317123 TEST=after running emege-voteer cromeos-firmware-volteer: $ cat /build/volteer/firmware/signer_config.csv model_name,firmware_image,key_id,ec_image,brand_code chronicler,image-chronicler.bin,VOLTEERG,chronicler/ec.bin,FYSO collis,image-collis.bin,VOLTEERA,collis/ec.bin,WMMD copano,image-copano.bin,VOLTEERA,copano/ec.bin,MRFF delbin,image-delbin.bin,VOLTEERA,delbin/ec.bin,XHVI delbin-delbing,image-delbin.bin,VOLTEERA,delbin/ec.bin,NHYA drobit,image-drobit.bin,VOLTEERA,drobit/ec.bin,QSIM eldrid,image-eldrid.bin,VOLTEERC,eldrid/ec.bin,FCPG elemi,image-elemi.bin,VOLTEERE,elemi/ec.bin,NZRH lillipup,image-lindar.bin,VOLTEERD,lindar/ec.bin,MQUZ lindar,image-lindar.bin,VOLTEERD,lindar/ec.bin,EDFZ terrador,image-terrador.bin,DEFAULT,terrador/ec.bin,ZZCR voema,image-voema.bin,VOLTEERB,voema/ec.bin,DHAS volet,image-volet.bin,VOLTEERF,volet/ec.bin,XIYN volta,image-voxel.bin,VOLTEERB,voxel/ec.bin,OIFF volteer2,image-volteer2.bin,DEFAULT,volteer/ec.bin,ZZCR voxel,image-voxel.bin,VOLTEERB,voxel/ec.bin,GFMQ running ./pack_firmware_functest.py and ./pack_firmware_unittest.py succeeds. Change-Id: I1bff7032f92cd7e15ef2eb6b671d7f061cf0dc65 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/firmware/+/3929547 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
This repository contains the firmware updater (chromeos-firmwareupdate) that will update firmware images related to verified boot, usually host (also known as AP, BIOS or MAIN) and EC (Embedded Controller).
Auto update is one of the most important feature in Chrome OS. Updating firmware is one of the most complicated process, since all Chromebooks come with firmware that implemented verified boot and must be able to update in background silently.
The firmware updater was made as an self-extracting archive with firmware images, updating logic, even utility programs.
In all modes, updater will try to preserve a list of known firmware data, for example the VPD sections (
RO_VPD,RW_VPD), and components inGBBsection likeHWID.
Usually you can find the updater in /usr/sbin/chromeos-firmwareupdate on a Chrome OS device (or the rootfs partition of a disk image).
To look at its contents (firmware images and versions) in machine friendly way:
chromeos-firmwareupdate --manifest
Currently we also support a human readable form:
chromeos-firmwareupdate -V
Usually for people who wants to “update all my firmware to right states”, do:
chromeos-firmwareupdate --mode=recovery
The
recoverymode will try to update RO+RW if your write protection is not enabled, otherwise only RW.
If your are not sure about write protection status but you only want RW to be updated, run:
chromeos-firmwareupdate --mode=recovery --wp=1
The
--wpargument will override you real write protection status.
If your want everything (RO and RW) to be updated and would like the updater to check WP state for you:
chromeos-firmwareupdate --mode=factory
The ChromeOS Auto Update (update_engine) runs updater in a different way - an A/B update.
If you want to simulate and test that, do:
chromeos-firmwareupdate --mode=autoupdate --wp=1
The updater is provided by the virtual/chromeos-firmware package in Chromium OS source tree, which will be replaced and includes the chromeos-base/chromeos-firmware-${BOARD} package in private board overlays.
To build an updater locally, in chroot run:
emerge-${BOARD} chromeos-firmware-${BOARD}
If your board overlay has defined USE flags bootimage or cros_ec, chromeos-firwmare-${BOARD} package will add dependency to firmware and EC source packages (chromeos-bootimage and chromeos-ec), and have the firmware images in /build/${BOARD}/firmware/{image,ec}.bin.
In other words, you can remove
bootimageandcros_ecin branches that you don't need firmware from source, for example the factory branches or ToT, especially if there are external partners who only has access to particular board private overlays. To do that, find themake.confin board overlay and addUSE="-bootimage -cros_ec".
The firmware updater packages lives in private board overlays: src/private-overlays/overlay-${BOARD}-private/chromeos-base/chromeos-firmware-${BOARD}/chromeos-firmware-${BOARD}-9999.ebuild. Find a template here in chromiumos-base/chromeos-firmware-null.
Usually there are few fields you have to fill:
A reference to the Main (AP) firmware image, which usually comes from emerge-${BOARD} chromeos-bootimage then /build/${BOARD}/firmware/image.bin.
Usually this implies both RO and RW. See CROS_FIRMWARE_MAIN_RW_IMAGE below for more information.
You have to run
ebuild-${BOARD} chromeos-firmware-${BOARD}.ebuild manifestwhenever you've changed the image files (CROS_FIRMWARE_*_IMAGE).
A reference to the Main (AP) firmware image and only used for RW sections.
If this value is set, CROS_FIRMWARE_MAIN_IMAGE will be used for RO and this will be used for RW.
A reference to the Embedded Controller (EC) firmware image, which usually comes from emerge-${BOARD} chromeos-ec then /build/${BOARD}/firmware/ec.bin.
The firmware updater is built by running pack_firmware.py, which collects firmware image files, and then archived in ZIP format with a special bootstrap SFX script pack/sfx2.sh.
For details about package format, check pack/README.md.
Here's a detailed list of how each updater mode works:
--mode=autoupdate: Invoked by update_engine when a payload is installed.
update_engine will invoke chromeos-setgoodfirmware after 60 secs, which will update or mark booted RW firmware to active.CROS_FIRMWARE_MAIN_IMAGE. If yes, go 2. Otherwise, do --mode=recovery.--mode=recovery: Invoked by recovery shim after installed.
Note in
recoverymode, theHWIDand flags inGBBare both preserved.
--mode=factory: A special recovery mode for factory initial imaging that always runs as wp=0 and NOT preserving GBB flags.Note in
factorymode, in addition to preserved sections, theHWIDinGBBwill also be preserved. OtherGBBdata (root key, recovery key, flags) will be changed. TheGBBflags must be changed because in factory process we need to overwrite the flags so we can ensure developer mode or other factory friendly settings being turned on in the first boot.
--mode=legacy: A special mode that only updates RW_LEGACY.
--mode=output: A special mode for updater with multiple sets of images.
--output_dir).