Create SD Card Steps - eaglelinuxplatform/meta-calixto-nxp GitHub Wiki

1. Preparing the SD Card:

Insert the SD Card in your Linux host machine.

Note

An SD/MMC card reader, such as a USB card reader, is required. It is used to transfer the bootloader and kernel images to initialize the partition table and copy the root file system and minimum 8 GB SD/MMC Card is required.

To identify the list block devices assigned to the SD/MMC card, carry out the following command:

 lsblk

The example, the device node assigned is /dev/sdb (a block is 1024 Bytes).

Note

Make sure that the device node is correct for the SD/MMC card. Otherwise, it may damage your operating system or data on your computer.

1.1 Partitioning the SD/MMC card:

Start by running fdisk with root permissions. We are using sdx here as an example.

sudo fdisk /dev/sdx

Type the following parameters (each followed by <ENTER>):

p		- [Lists the current partitions.]   

d 		- [To delete existing partitions. Repeat this until no unnecessary partitions are reported by the 'p' command to start fresh.]   

n 	        - [Create a new partition.]  

p 		- [Create a primary partition - use for both partitions.]   

1 		- [The first partition.]  

20480           - [Starting at offset sector.]         

1024000         - [Ending position of the first partition to be used for the boot images.]
 
p               - [To check the partitions.]
           
n

p

2

1228800         - [Starting at offset sector, which leaves enough space for the kernel, the bootloader and its configuration data] <enter> [using the default value will create a partition that extends to the last sector of the media.]
    
p 	        - [To check the partitions.]	  

w 	        - [This writes the partition table to the media and fdisk exits.]

Important

After creating the partitions, remove the SD card from your computer and reinsert it to verify that the partitions were created successfully. Then, follow the steps below to copy the images.

1.2 Copying the Kernel image and DTB file

For keeping DTB and Kernel image we need a fat partition Format partition 1 on the card as VFAT with this command:

sudo mkfs.vfat -n "boot" /dev/sdx1

Mount the formatted partition with this command:

mkdir mountpoint
sudo mount /dev/sdx1 mountpoint

Copy the zImage and *.dtb files to the mountpoint by using cp command. The device tree names should match the one used by the variable specified by U-Boot. Unmount the partition with this command:

sudo umount mountpoint

1.3 Copying the root file system (rootfs)

The file system format ext3 or ext4 is a good option for the removable media due to the built-in journaling

sudo mkfs.ext3 -L "rootfs" /dev/sdx2

Or

sudo mkfs.ext4 -L "rootfs" /dev/sdx2

Copy the target file system to the partition:

mkdir /home/user/mountpoint
sudo mount /dev/sdx2 /home/user/mountpoint

Extract a rootfs package to a directory: for example, extract calixto-image-minimal-imx93-calixto-versa_1gb.rootfs-20250201124256.tar.zst to /home/user/rootfs:

 cd /home/user/rootfs
 tar xvf calixto-image-minimal-imx93-calixto-versa_1gb.rootfs-20250201124256.tar.zst

The rootfs directory needs to be created manually. Assume that the root file system files are located in /home/user/rootfs as in the previous step:

cd /home/user/rootfs
sudo cp -a * /home/user/mountpoint
sudo umount /home/user/mountpoint
sync

Note

Copying the file system takes several minutes depending on the size of your rootfs.

1.4 Copying a bootloader image:

Execute the following command to copy the U-Boot image to the SD/MMC card.

 sudo dd if=<U-Boot image> of=/dev/sdx bs=1k seek=32 conv=fsync
⚠️ **GitHub.com Fallback** ⚠️