Files in this folder will be compiled by
chromeos-base/chromeos-installer package into few programs, including:
chromeos-install: A shell script for manual installation from USB.
chromeos-recovery: The main command for recovery shim to install image.
chromeos-postinst: The script executed by auto update or recovery shim after image installation is completed, being the symbolic link of
cros_installer: A program meant to be the backend of above commands (but it currently only supports post-install).
When installing manually from USB or from recovery shim, the procedure is:
chromeos-installis invoked by either manually or
/postinstof new rootfs.
Auto update (via
update_engine) is slightly different. After the payload is downloaded,
update_engine will try to apply the payload (may be full or partial), then invoke the post-install from new rootfs.
After the new image is written to disk storage, there may be several steps to activate the new partition. This is done by
/usr/sbin/board-postinstif it exists. The script is usually installed by
chromeos-base/chromeos-firmware-$BOARDin board overlays.
/usr/sbin/chromeos-firmwareupdate --mode=autoupdateif the signing signature (
/root/.force_update_firmware) is available. The special signature is needed to prevent unexpected firmware updates from self-built USB images.
ChromeosChrootPostinstfor further details.
To make sure the new kernel and rootfs is bootable, the GPT boot priority may be set with few “try” attempts so the system will revert to the old partition when running out of “tries”.
If the new kernel and rootfs boots, the
update_engine will wait for 60 seconds and then:
chromeos-setgoodkernel, to update partition records and mark current kernel as “good” for future reboots.
chromeos-setgoodfirmwareto mark active firmware as “good” as well. At the end of
chromeos-setgoodfirmware, it will also invoke
/usr/sbin/board-setgoodfirmwarefor board specific configuration if available. The
board-setgoodfirmwareis usually provided by
In summary, if you want to add some board specific task: