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 /postinst
.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-install
is invoked by either manually or chromeos-recovery
./postinst
of 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 cros_installer
as:
syslinux
entries./usr/sbin/board-postinst
if it exists. The script is usually installed by chromeos-base/chromeos-bsp-$BOARD
or chromeos-base/chromeos-firmware-$BOARD
in board overlays./usr/sbin/chromeos-firmwareupdate --mode=autoupdate
if the signing signature (/root/.force_update_firmware
) is available. The special signature is needed to prevent unexpected firmware updates from self-built USB images.ChromeosChrootPostinst
for 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-setgoodfirmware
to mark active firmware as “good” as well. At the end of chromeos-setgoodfirmware
, it will also invoke /usr/sbin/board-setgoodfirmware
for board specific configuration if available. The board-setgoodfirmware
is usually provided by chromeos-base/chromeos-firmware-$BOARD
package.In summary, if you want to add some board specific task:
/usr/sbin/board-setgoodfirmware
./usr/sbin/board-postinst
.