- Prepare the SD card by flashing it with
efi.binandrootfs.img. - Insert the prepared SD card into the SD card slot of the development kit.
Supported platforms
To prepare a bootable SD card, do the following:
Prerequisites
Use a Linux desktop system to perform steps 1 through 5 and prepare a bootable SD card.
Procedure
- Verify the device node for the inserted SD card on any Linux system, for example,
/dev/mmcblk1or/dev/mmcblk2. - To format the SD card, run the
mkfs.ext4 <sdcard slot>command on the Linux terminal. In the following example, the dev node for the SD card is/dev/mmcblk1.Output: - Use the
fdiskcommand to create two partitions on the SD card to copyefi.binandrootfs.img.- Create the first partition with the
vfatfile system to copyefi.bin. To create the partition, run the following command (for example, the dev node is/dev/mmcblk1): In this example, leave theFirst sectorfield empty and ensure thatLast sectoris large enough to copyefi.bin.Output:To convert the partition to thevfatfile system, run the following command:Output: - Create the second partition with the
ext4file system to copyrootfs.imgas follows: To create the partition, run the following command (for example, the dev node is/dev/mmcblk1): In this example, leave theFirst sectorfield empty and ensure thatLast sectoris large enough to copyrootfs.img.Output:To convert the partition to theext4file system, run the following command:Output:
- Create the first partition with the
- Verify the partitions were created:
Output:
- Copy
efi.binandrootfs.imgfrom the successfully built Qualcomm Linux image on the host computer to the partitions on the SD card. Run the following commands on the host computer:dd if=<path>/efi.bin of=<sdcard slot> bs=4Mdd if=<path>/rootfs.img of=<sdcard slot> bs=4MTo copy both images from the/tmppath, following is an example of how to copy them to the SD card: In this command, the dev node for the SD card is/dev/mmcblk1.
Simulate an unbootable condition
To verify that the SD card is used as fallback boot media, you can force the primary flash storage (UFS or eMMC) into an unbootable state by erasing its EFI partition. Perform the following steps on the development kit while it’s still running from the primary storage, before inserting the SD card:- Log in to the development kit over the UART console or SSH.
- Confirm the EFI partition is exposed as
/dev/disk/by-partlabel/efi. This partition name comes from the--name=efientry in thepartitions.conffile for your platform. For more information, see Manage partitions in Qualcomm Linux. - Erase the EFI partition by overwriting it with zeros:
- Insert the prepared SD card into the SD card slot and reboot the development kit. Because the EFI partition on the primary storage is now erased, the bootloader falls back to booting from the SD card.
Erasing the EFI partition makes the primary storage unbootable until the EFI partition is reflashed. To restore the original boot configuration, reflash the device using the steps in Flash Prebuilt Images or by rebuilding and reflashing the
efi.bin image.
