The Container Linux startup process is built on the standard Linux startup process. Since this process is already well documented and generally well understood, this document will focus on aspects specific to booting Container Linux.
First, the GRUB config specifies which
usr partition to use from the two
usr partitions Container Linux uses to provide atomic upgrades and rollbacks.
Second, GRUB checks for a file called
coreos/first_boot in the EFI System Partition to determine if this is the first time a machine has booted. If that file is found, GRUB sets the
coreos.first_boot=detected Linux kernel command line parameter. This parameter is used in later stages of the boot process.
Finally, GRUB searches for the initial disk GUID (00000000-0000-0000-0000-000000000001) built into Container Linux images. This GUID is randomized later in the boot process so that individual disks may be uniquely identified. If GRUB finds this GUID it sets another Linux kernel command line parameter,
After GRUB, the Container Linux startup process moves into the initial RAM file system. The initramfs mounts the root filesystem, randomizes the disk GUID, and runs Ignition.
coreos.randomize_guid kernel parameter is provided, the disk with the specified GUID is given a new, random GUID.
coreos.first_boot kernel parameter is provided and non-zero, Ignition and networkd are started. networkd will use DHCP to set up temporary IP addresses and routes so that Ignition can fetch its configuration from the network.
When Ignition runs on Container Linux, it reads the Linux command line, looking for
coreos.oem.id. Ignition uses this identifier to determine where to read the user-provided configuration and which provider-specific configuration to combine with the user's. This provider-specific configuration performs basic machine setup, and may include enabling
coreos-metadata-sshkeys@.service (covered in more detail below).
After Ignition runs successfully, if
coreos.first_boot was set to the special value
detected, Ignition mounts the EFI System Partition and deletes the
After all of the tasks in the initramfs complete, the machine pivots into user space. It is at this point that systemd begins starting units, including, if it was enabled,
email@example.com is responsible for fetching SSH keys from the machine's environment. The keys are written to
update-ssh-keys is run to update
~core/.ssh/authorized_keys. On cloud platforms, the keys are read from the provider's metadata service. This service is not supported on all platforms and is enabled by Ignition only on those which are supported.