Prepare SD card - FrankBau/meta-marsboard-bsp GitHub Wiki
Prerequisites:
- Build a Linux image say core-image-minimal (the first "hello world" image you have built)
- a microSD card: 2 GB minimum for tiny images, 4 GB or more recommended
- MarS Board with a boot loader (U-Boot) that is configured to boot Linux from microSD card, see Build the U-Boot boot loader and Update U-Boot in SPI Flash
Build a Linux image builds the image in the subfolder $(BSPDIR)/build/tmp/deploy/images/marsboard
.
The core-image-minimal-marsboard.wic.gz
file is a compressed sector by sector copy of a bootable microSD card containing two partitions:
- a boot (FAT) partition containing the Linux Kernel (zImage) and Device Tree Blob (*.dtb)
- a root (ext) partition containing the root file system.
The partition sizes are as small as possible to fit on any microSD card. You may increase the rootfs partition size by setting
IMAGE_ROOTFS_EXTRA_SPACE
see Configure the image.
Insert a microSD card into the Linux host.
Note: all content (files, file systems, partition table,...) on that card will be overwritten!
Make sure that you use the correct device, e.g. by checking all disks by entering lsblk
or ls -l /dev/disk/by-label/
or blkid
.
Locate the microSD card device by using the above commands like lsblk
Lets say, on your system the microSD card is device /dev/sdx
(x
stands for the letter on your system)
Individual partitions like /dev/sdx1
or /dev/sdx2
of the microSD card should not be mounted because this might confuse you (resp. Linux) when you make changes like overwriting the partition table etc.. If a partition, say /dev/sdX1
is already mounted (lsblk
will show the mountpoint), use umount /dev/sdX1
to get rid of that.
Uncompress and copy the .wic.gz
image to the microSD card device (change /dev/sdX
to the correct device name!):
gunzip -c '.../pyro/build/tmp/deploy/images/marsboard/core-image-minimal-marsboard.wic.gz' | sudo dd of=/dev/sdX bs=1M iflag=fullblock oflag=direct conv=fsync status=progress
Note: Your version of dd
might support the status=progress
option (Ubuntu 16.04).
Be patient until the dd
command finishes, otherwise, the sd card might get damaged.
Remove the card from the host. You may re-insert it on the build host for checking or better on the MarS board and watch it booting, see Boot Linux.