DESK-MX6-L/Development/How to create a bootable microSD card

From DAVE Developer's Wiki
< DESK-MX6-L
Revision as of 14:19, 9 October 2020 by U0007 (talk | contribs) (Created page with "{{subst:How to create a bootable SD card  | nome-som=AXEL Lite | kit-code=MX6 | kit = mx6 | kit-repo = desk-mx-l}}")

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
History
Version Issue Date Notes
X.Y.Z Month Year TBD
[TBD_link X.Y.Z] Month Year TBD


How to create a bootable SD card[edit | edit source]

200px-Emblem-important.svg.png

The procedure described here was tested with a physical machine. In case of a virtual machine such as the MVM, it might not work properly. Also, it is worth remembering that USB controller of the MVM is disabled by default. See also this section.


This article shows how to create a bootable microSD for the [[DESK-MX6-L/General/Release_Notes_(DESK-MX6-L)|DESK-MX6-L Release Notes] kit by using a simple bash script.
Note: Starting from this release the support for the SPL has been introduced in Uboot. Previous versions of this script will no longer produce a fully functional and bootable microSD card.

The procedure has been tested on a Linux PC running Ubuntu LTS (>=TBD) distribution with

  • a 16 GB microSD card [1]
  • the binary files delivered along with the DESKMX6-L 1.x.x.

The resulting card is partitioned as depicted here.

The script - named mksd.sh - looks like this:

TBD : cat of mksd.sh script


Here is an example that shows how to use this script. Let's assume that the binary files were downloaded in the desk subdirectory of the working directory. Before invoking the script, the following files has to be renamed in order to make them compatible with the default U-Boot environment variables:

  • bootscript: boot.scr
  • Linux kernel: uImage
  • Device tree blob: carrier.dtb.

This is the list of the binary files that will be used by the script:

dvdk@vagrant:~/desk-{{{kit}}}$ ls -la
...
TBD directory listing
...

You can now run the script, by passing the following parameters:

  • Device file of the microSD card (/dev/sdc in the example)
  • U-Boot image
  • SPL
  • Path of the directory containing the bootscript file, the Linux kernel image, and the device tree blob files
  • Archive of the target's root file system (compressed as .tar.bz2 file).
dvdk@vagrant:~/desk-{{{kit}}}$ ./mksd.sh /dev/sd<x> <u-boot.img> <SPL> <binaries_dir>/ <rfs_filename>
...
...
TBD 
...
...


[1] In case you have a different size, you'll need to change the sfdisk parameters accordingly.