Changes

Jump to: navigation, search
Created page with "{{subst:How to create a bootable SD card | nome-som=AXEL ULite | kit-code=MX6UL | kit = mx6ul | kit-repo = desk-mx-l}}"
<section begin=History/>
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
|-
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|X.Y.Z
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Month Year
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD
|-
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|[TBD_link X.Y.Z]
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Month Year
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD
|-
|}
<section end=History/>
__FORCETOC__
<section begin=Body/>

==How to create a bootable SD card==

{{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 [[DESK-MX6UL-L/General/Release_Notes_(DESK-MX6UL-L)|DESK-MX6UL-L Release Notes] 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>

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 [[Axel_Embedded_Linux_Kit_(XELK)#Downloadable_binary_images|DESKMX6UL-L ''1.x.x'']].
The resulting card is partitioned as depicted [[Axel_Embedded_Linux_Kit_(XELK)#XELK_microSD_Layout|here]].

The script - named <code>mksd.sh</code> - looks like this:
<pre>
TBD : cat of mksd.sh script
</pre>


Here is an example that shows how to use this script. Let's assume that the binary files were downloaded in the <code>desk</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>''carrier''.dtb</code>.

This is the list of the binary files that will be used by the script:
<pre>
dvdk@vagrant:~/desk-{{{kit}}}$ ls -la
...
TBD directory listing
...
</pre>
You can now run the script, by passing the following parameters:
*Device file of the microSD card (<code>/dev/sdc</code> 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 <code>.tar.bz2</code> file).
<pre>
dvdk@vagrant:~/desk-{{{kit}}}$ ./mksd.sh /dev/sd<x> <u-boot.img> <SPL> <binaries_dir>/ <rfs_filename>
...
...
TBD
...
...
</pre>


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

===bootscr ===

Once you got the new binaries compiled from your modified sources, they have to be installed on first SD partition preserving the original file names used into <i>boot.scr</i> u-boot bootscript.

Here below there is an example on how to create a <code>boot.scr</code> file from the '''bootscript.txt''' for booting from SD card:

''TBD: bootscript.txt dump''

<pre>
echo 'bootscript generated with command "mkimage -A ARM -T script -C none -n AXEL-Lite-DESK-SBCX -d bootscript.txt boot.scr"'

setenv desk_release 'desk-mx6-l-1.0.0'

if test 0x${cb_configid#} = 0x00000012;
then
if test ${cpu} = 6DL; then
setenv fdtfile ${desk_release}_imx6dl-sbcx-cb0012.dtb
else
setenv fdtfile ${desk_release}_imx6q-sbcx-cb0012.dtb
fi
elif test 0x${cb_configid#} = 0x00000013;
then
if test ${cpu} = 6DL; then
setenv fdtfile ${desk_release}_imx6dl-sbcx-cb0013.dtb
else
setenv fdtfile ${desk_release}_imx6q-sbcx-cb0013.dtb
fi
elif test 0x${cb_configid#} = 0xffffffff;
then
if test ${cpu} = 6DL; then
setenv fdtfile ${desk_release}_imx6dl-desk-l-2.0.0.dtb
else
setenv fdtfile ${desk_release}_imx6q-desk-l-2.0.0.dtb
fi
else
echo Invalid CB! Autoreset ...
sleep 30
reset
fi

setenv bootfile ${desk_release}_uImage

setenv mmc_loadk 'fatload mmc ${mmcdev}:1 ${loadaddr} ${bootfile}'
setenv mmc_loadfdt 'fatload mmc ${mmcdev}:1 ${fdtaddr} ${fdtfile}'

echo Booting AxelLite-DESK-SBCX via mmcboot with ${fdtfile} as device tree

run mmcboot

echo mmcboot FAILURE
</pre>

and compile it using:

<pre>
mkimage -A ARM -T script -C none -n AXEL-Lite-DESK-SBCX -d bootscript.txt boot.scr
</pre>

Then copy the ''boot.scr'' into the <code><binaries_dir></code> directories used by the script to create the SD card.

----

[[Category:AXEL ULite]]
8,226
edits

Navigation menu