Changes

Jump to: navigation, search

How to create a bootable microSD card (XELK)

624 bytes added, 08:40, 24 January 2020
no edit summary
{{InfoBoxBottom}}
== History ==
 
{| class="wikitable" border="1"
!Version
!Date
!XELK version
!Notes
|-
|4.0.0
|Jan 2020
|[[Axel_Embedded_Linux_Kit_(XELK)#XELK 4.0.0 | XELK 4.0.0]]
|
|-
|}
 
Please use this [https://wiki.dave.eu/index.php/How_to_create_a_bootable_microSD_card_(XUELK) page] for older releases.
{{ImportantMessage|text=The procedure described here was tested with a physical machine. In case of a virtual machine such as the [[Managed_Virtual_Machine_(MVM)|MVM]], it might not work properly. Also, it is worth remembering that USB controller of the MVM is disabled by default. See also [[MVM_FAQs#Q:_How_to_use_the_USB_devices_connected_to_the_host_machine.3F|this section]].}}
This article shows how to create a bootable microSD for the [[Axel_Embedded_Linux_Kit_(XELK)#XELK_4.0.0|XELK-4.0.0]] kit by using a simple bash script. <br>
'''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. <br>
Please use this [https://wiki.dave.eu/index.php/How_to_create_a_bootable_microSD_card_(XUELK) script] for older releases.
The procedure has been tested on a Linux PC running Ubuntu LTS (>=16.04) distribution with
</pre>
Here is an example that shows how to use this script. Let's assume that the binary files were downloaded in the <code>xuelk-4.0.0</code> 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: <code>boot.scr</code>*Linux kernel: <code>uImage</code>*Device tree blob: <code>imx6ul-sbcx.dtb</code>.
This is the list of the binary files that will be used by the script:
<pre>
total 362M
drwxr-xr-x 2 dave dave 4.0K Jun 25 17:09 binaries
-rw-r--r-- 1 dave dave 362M Jun 8 15:53 davexelk-4.0.0_dave-image-devel.rootfs.tar.bz2
-rwxr-xr-x 1 dave dave 2.0K Jun 21 10:57 mksd.sh
-rw-r--r-- 1 dave dave 47K Jun 25 17:12 SPLxelk-4.mmc0.0_mx6qdlaxel_SPL-rw-r--r-- 1 dave dave 480K Jun 25 17:12 uxelk-4.0.0_mx6qdlaxel_u-boot.img.mmc
</pre>
You can now run the script, by passing the following parameters:
*Archive of the target's root file system (compressed as <code>.tar.bz2</code> file).
<pre>
# ./mksd.sh /dev/sdc uxelk-4.0.0_mx6qdlaxel_u-boot.imgxelk-4.mmc SPL0.mmc 0_mx6qdlaxel_SPL binaries/ davexelk-4.0.0_dave-image-devel.rootfs.tar.bz2
All data on /dev/sdc now will be destroyed! Continue? [y/n]
y
[Copying files...]
‘binaries/boot.scr’ -> ‘/mnt/boot.scr’
‘binaries/imx6dlxelk-4.0.0_imx6dl-sbcx-cb0012.dtb’ -> ‘/mnt/imx6dlxelk-4.0.0_imx6dl-sbcx-cb0012.dtb’‘binaries/imx6dlxelk-4.0.0_imx6dl-sbcx-cb0013.dtb’ -> ‘/mnt/imx6dlxelk-4.0.0_imx6dl-sbcx-cb0013.dtb’‘binaries/imx6dlxelk-4.0.0_imx6dl-xelk-l.dtb’ -> ‘/mnt/imx6dlxelk-4.0.0_imx6dl-xelk-l.dtb’‘binaries/imx6qxelk-4.0.0_imx6q-sbcx-cb0012.dtb’ -> ‘/mnt/imx6qxelk-4.0.0_imx6q-sbcx-cb0012.dtb’‘binaries/imx6qxelk-4.0.0_imx6q-xelk-l-2.0.0.dtb’ -> ‘/mnt/imx6qxelk-4.0.0_imx6q-xelk-l-2.0.0.dtb’‘binaries/SPLxelk-4.mmc’ 0.0_mx6qdlaxel_SPL’ -> ‘/mnt/SPLxelk-4.mmc’0.0_mx6qdlaxel_SPL’‘binaries/SPLxelk-4.0.nand’ 0_mx6qdlaxel_nand_SPL’ -> ‘/mnt/SPLxelk-4.0.nand’0_mx6qdlaxel_nand_SPL’‘binaries/SPLxelk-4.spi’ 0.0_mx6qdlaxel_spi_SPL’ -> ‘/mnt/SPLxelk-4.spi’0.0_mx6qdlaxel_spi_SPL’‘binaries/uxelk-4.0.0_mx6qdlaxel_u-boot.img.mmc’ img’ -> ‘/mnt/uxelk-4.0.0_mx6qdlaxel_u-boot.img.mmc’img’‘binaries/uxelk-4.0.0_mx6qdlaxel_nand_u-boot.img.nand’ img’ -> ‘/mnt/uxelk-4.0.0_mx6qdlaxel_nand_u-boot.img.nand’img’‘binaries/uxelk-4.0.0_mx6qdlaxel_spi_u-boot.img.spi’ img’ -> ‘/mnt/uxelk-4.0.0_mx6qdlaxel_spi_u-boot.img.spi’img’‘binaries/uImage’ xelk-4.0.0_uImage’ -> ‘/mnt/uImage’xelk-4.0.0_uImage’
[Extracting rfs (this may take a while...)]
[Programming SPL]
</pre>
Once created, the SD card can be inserted into the [[Axel_Embedded_Linux_Kit_(XELK) | XELK]] or [[:Category:SBC-AXEL | SBCX]] kit: the <code>boot.scr</code> script will recognize the proper Carrier board and then it will select the related device tree file.
[1] In case you have a different size, you'll need to change the <code>sfdisk</code> parameters accordingly.
8,154
edits

Navigation menu