How to: Create Bootable SD card
Contents
Requirement
A SD Card of size at least 2 Gb is recommended.
The table below indicates the size of the bootable Sample image files.
File Name | Approximate Size |
---|---|
u-boot | 350 Kb |
uImage.bin | 6.5 Mb |
uImage.dtb | 50 Kb |
Compressed rootfs File | |
Hio-image-minimal | 46 Mb |
Hio-image-fb | 162 Mb |
Hio-image-x11 | 203 Mb |
Hio-image-xfce | 366 Mb |
Automatically Create Bootable SD Card
Obtain the .rootfs.sdcard File
For this tutorial, we will need the SD card file (*.rootfs.sdcard). It contains all the necessary deployed information including boot loader, kernel tree data structure files, hardware information, and the Hio Image file system.
There are 2 ways to get the files.
- Generated by compiling the image from scratch. By setting up the Yocto Building Environment and building an HIO Image.
- After compiling, the files are located in build-xxx/tmp/deploy/images/hio-imx6dl-board/
- Or Download the Pre-compile Image here
Linux : dd Command
After obtaining the .rootfs.sdcard files. We will need a SD card with at least 2G size to boot the image. The steps are as follow:
- 1. Change the current directory into where the *.rootfs.sdcard is located by using the cd command
- 2. Obtain the name of the SDCard by using the lsblk command
- 3. Flash SD Card image into SD Card .
- Caution: execute the following command will delete all the content of the card.
$sudo dd if=hio-image-xxx-hio-imx6dl-board-xxx.rootfs.sdcard of=/dev/<your-sd-card> bs=1M conv=fsync
- 4. Insert the SD card into the core computer board HIO-EMB-1200. Make sure to change the switch (number 1 down, number 2 up) to choose which drive to boot from.
Note: Quick Start Up Guide
Windows: Win32DiskImager
For Microsoft Windows users, there is an open sourced program called Win32DiskImager. It lets users write a raw disk image to a removable device or backup a removable device to a raw image file. Instead of using dd command, we will use this program to write the image file.
- Obtain the *.rootfs.sdcard file and put it into the Windows operating system.
- Download Win32DiskImager
- Start Win32DiskImager.
- In Image File field, Select hio-image-xxx-hio-imx6dl-board-xxx.rootfs.sdcard
- For Device, select the SD card drive. (To find the name of the drive. Click Start > Computer)
- Click Write
- Insert the SD card into the core computer board HIO-EMB-1200. Make sure to change the switch (number 1 down, number 2 up) to choose to boot from SD Card (Figure 2).
Manually Create Bootable SD Card
Before we create the Image, we need to prepare the SD Card into 2 partitions. One is for u-boot, kernel, and the second one for rootfs files. Building image this way provide users the freedom to modify the .rootfs files.
Obtains the Image Files
We will need 4 files, U-boot, Kernel ( *.dtb and *.bin), and Root files (*.rootfs.tar.bz2). After compiling, the files are located in build-xxx/tmp/deploy/images/hio-imx6dl-board/.
Otherwise, Download the Files here.
Create Image
1. Change the directory using cd command to where the 4 files are stored in.
2. Flash U-boot Images into SD Card.
$dd if=u-boot-hio-imx6dl-board-2014.01-r0.imx of=/dev/<your-sd-card> bs=1k seek=1 $sync
Note: use command lsblk to find the name of <your-sd-card> and partition parts.
3. creating a folder called /temp and mount the SD Card partition
$mkdir /temp $sudo mount /dev/<your-sd-card first partition> /temp
4. Copy Kernel Images into SD Card.
$cp uImage--3.10.17-r0-hio-imx6dl-board-YYYYmmddHHMMSS.bin /temp/uImage $cp uImage--3.10.17-r0-hio-imx6dl-board-YYYYmmddHHMMSS.dtb /temp/hio-imx6dl-board.dtb $sync
Note: the .bin file will be renamed to uImage. The .dtb file will be renamed to hio-imx6dl-board.dtb
5. Un-mount the SD Card first partition and Mount the second Partition into /temp
$sudo umount /temp $sudo mount /dev/<your-sd-card second partition> /temp
6. Copy and Extract Files System Images into SD Card.
$cp hio-image-xxx-hio-imx6dl-board-YYYYmmddHHMMSS.rootfs.tar.bz2 /temp $cd /temp $tar -xf hio-image-xxx-hio-imx6dl-board-YYYYmmddHHMMSS.rootfs.tar.bz2 $sync
7. Un-mount the SD Card
$sudo umount /temp
8. Insert the SD card into the core computer board HIO-EMB-1200. Make sure to change the switch (number 1 down, number 2 up) to choose to boot from SD Card (Figure 2).