Difference between revisions of "DESK-MX6UL-L/Development/How to create a bootable microSD card"

From DAVE Developer's Wiki
Jump to: navigation, search
(How to create a bootable SD card)
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<section begin="History" />
+
<section begin=History/>
 
{| style="border-collapse:collapse; "
 
{| style="border-collapse:collapse; "
! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History
+
!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" |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"|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" |Notes
+
!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" |{{oldid|14312|2021/07/20}}
+
|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"|1.0.1
| 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" |First DESK-MX6UL-L release
+
|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"|Jun 2021
|-
+
|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"|First DESK release
| 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" |{{oldid|16327|2022/03/16}}
 
| 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" |DESK-MX6UL-L 3.0.0 release
 
|-
 
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |2023/05/05
 
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX6UL-L 4.0.0 release
 
 
|-
 
|-
 
|}
 
|}
<section end="History" />
+
<section end=History/>
 
__FORCETOC__
 
__FORCETOC__
<section begin="Body" />
+
<section begin=Body/>
  
 
==How to create a bootable SD card==
 
==How to create a bootable SD card==
  
{{ImportantMessage|text=The procedure described here was tested with a virtual machine such as the [[Managed_Virtual_Machine_(MVM)|MVM]]. The USB controller of the MVM should be enabled by default. If you are using Linux-based distribution and are having trouble detecting a USB device in virtual machine, please make sure your user belongs to the ''vboxusers'' group.}}
+
{{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 Release Notes]] kit by using a simple bash script. <br>
+
This article shows how to create a bootable microSD for the [[DESK-MX6UL-L/General/Release_Notes|DESK-MX6UL-L Release Notes] kit by using a simple bash script. <br>
'''Note:''' Note: Starting from '''DESK-MX6UL-L 1.0.1''' release the support for the SPL has been introduced in U-Boot. Previous versions of this script will no longer produce a fully functional and bootable microSD card. <br>
+
'''Note:''' Starting from this release the support for the SPL has been introduced in U-Boot. Previous versions of this script will no longer produce a fully functional and bootable microSD card. <br>
 
   
 
   
The procedure has been tested on a MVM released with '''DESK-MX6UL-L 4.0.1''' release with  
+
The procedure has been tested on a Linux PC running Ubuntu LTS 16.04 distribution with  
*a 32 GB microSD card [1]
+
*a 16 GB microSD card [1]
*a USB SD card reader
+
*the binary files delivered along with the [[AXEL_ULite_SOM/DESK-MX6UL-L/General/Release_Notes#Downloadable_binary_images|DESK-MX6UL-L 1.0.1]]
*the binary files delivered along with the [[DESK-MX6UL-L/General/Release_Notes#Downloadable_binary_images_3|DESK-MX6UL-L 4.0.0]]
 
 
The resulting card is partitioned as depicted here below:
 
The resulting card is partitioned as depicted here below:
  
 
* bootable partition (mmcblk0p1, vfat) containing:
 
* bootable partition (mmcblk0p1, vfat) containing:
** binary images (U-Boot and kernel images)
+
** binary images (u-boot and kernel images)
 
* root file system partition (mmcblk0p2, ext3)
 
* root file system partition (mmcblk0p2, ext3)
 
** root file system binaries and init scripts
 
** root file system binaries and init scripts
Line 41: Line 36:
 
The script - named <code>mksd.sh</code> - can be realized with the following code:
 
The script - named <code>mksd.sh</code> - can be realized with the following code:
 
<pre>
 
<pre>
#!/bin/bash                                                                                                                                                                                                      
+
#!/bin/bash
                                                                                                                                                                                                                 
+
 
if [[ -z $1 || -z $2 || -z $3 || -z $4 || -z $5 ]]                                                                                                                                                                
+
if [[ -z $1 || -z $2 || -z $3 || -z $4 || -z $5 ]]
then                                                                                                                                                                                                              
+
then
        echo "$0 Usage:"                                                                                                                                                                                          
+
echo "$0 Usage:"
        echo " $0 <device> <u-boot.img> <SPL> <binaries directory> <rootfs tar.bz2>"                                                                                                                            
+
echo " $0 <device> <u-boot.img> <SPL> <binaries directory> <rootfs tar.bz2>"
        echo " Example: $0 /dev/sdc u-boot.img SPL binaries/ rootfs.tar.bz2"                                                                                                                                    
+
echo " Example: $0 /dev/sdc u-boot.img SPL binaries/ rootfs.tar.bz2"
        exit                                                                                                                                                                                                      
+
exit
 
fi
 
fi
  
 
if [ "$(whoami)" != "root" ]
 
if [ "$(whoami)" != "root" ]
then                                                                                                    
+
then
        echo "you must be root to run this script!"
+
echo "you must be root to run this script!"
        exit              
+
exit
 
fi
 
fi
                                                   
+
 
 
if ! [[ -b $1 ]]
 
if ! [[ -b $1 ]]
then                                                                                                    
+
then
        echo "$1 is not a valid block device!"
+
echo "$1 is not a valid block device!"
        exit
+
exit
fi                
+
fi
                                                   
+
 
 
if ! [[ -e $2 ]]
 
if ! [[ -e $2 ]]
then                              
+
then
        echo "Incorrect u-boot.img location!"
+
echo "Incorrect u-boot.img location!"
        exit                                                                                           
+
exit
fi 
 
                                                   
 
if ! [[ -e $3 ]]       
 
then               
 
        echo "Incorrect SPL location!"
 
        exit
 
 
fi
 
fi
                                                   
+
 
 +
if ! [[ -e $3 ]]
 +
then
 +
echo "Incorrect SPL location!"
 +
exit
 +
fi
 +
 
 
if ! [[ -d $4 ]]
 
if ! [[ -d $4 ]]
 
then
 
then
        echo "Incorrect Binaries location!"
+
echo "Incorrect Binaries location!"
        exit                                      
+
exit
fi                                              
+
fi
  
if ! [[ -f $5 ]]        
+
if ! [[ -f $5 ]]
 
then
 
then
        echo "Incorrect rootfs location!"
+
echo "Incorrect rootfs location!"
        exit            
+
exit
fi                                                                                                      
+
fi
                                                   
+
 
 
DRIVE=$1
 
DRIVE=$1
if [[ "$DRIVE" == *"mmcblk"* ]]                  
+
if [[ "$DRIVE" == *"mmcblk"* ]]
then                    
+
then
        echo "You're using a mmc device, I need to fix partition names"
+
echo "You're using a mmc device, I need to fix partition names"
        PART="p"
+
PART="p"
else                
+
else
        PART=""
+
PART=""
fi                    
+
fi
UBOOT=$2                                    
+
UBOOT=$2
 
SPL=$3
 
SPL=$3
BINARIES=$4                  
+
BINARIES=$4
RFS=$5                                        
+
RFS=$5
  
 
echo "All data on "$DRIVE" now will be destroyed! Continue? [y/n]"
 
echo "All data on "$DRIVE" now will be destroyed! Continue? [y/n]"
read ans                
+
read ans
 
if ! [ $ans == 'y' ]
 
if ! [ $ans == 'y' ]
 
then
 
then
        exit
+
exit
 
fi
 
fi
  
Line 122: Line 117:
 
if [ "$?" -eq "0" ]
 
if [ "$?" -eq "0" ]
 
then
 
then
        {
+
{
                echo 40,1380,0x0c,*
+
echo 40,1380,0x0c,*
                echo 1420,,83,-
+
echo 1420,,83,-
        } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
+
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
 
else
 
else
 
{
 
{
Line 139: Line 134:
 
mkfs.vfat -F 32 -n BOOT "$DRIVE$PART"1 #> /dev/null
 
mkfs.vfat -F 32 -n BOOT "$DRIVE$PART"1 #> /dev/null
 
mkfs.ext3 -F -L ROOTFS "$DRIVE$PART"2 #> /dev/null
 
mkfs.ext3 -F -L ROOTFS "$DRIVE$PART"2 #> /dev/null
 
# wait for the VM to recognize the uSD
 
sleep 60
 
  
 
echo "[Copying files...]"
 
echo "[Copying files...]"
Line 165: Line 157:
 
</pre>
 
</pre>
  
Here is an example that shows how to use this script. We use here files delivered with [[DESK-MX6UL-L/General/Release_Notes#Downloadable_binary_images_3|DESK-MX6UL-L 4.0.0]] release. Before invoking the script, the following files has to be renamed in order to make them compatible with the default U-Boot environment variables:
+
 
 +
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>
 
* bootscript: <code>boot.scr</code>
* splash image: <code>splash_image.bmp</code>
+
* Linux kernel: <code>uImage</code>
* Linux kernel: <code>desk-mx6ul-l-4.0.0_uImage</code>
+
* Device tree blob: <code>imx6ul-lynx-som0013-cb002f.dtb</code> (or <code>imx6ul-axelulite-cb003a.dtb</code> or <code>imx6ul-axelulite-cb006c.dtb</code>)
* Device tree blob: <code>desk-mx6ul-l-4.0.0_imx6ul-axelulite-cb003a.dtb</code>.
 
 
 
In the case of you don't have some file on MVM, please download it from [https://mirror.dave.eu/desk-mx-l mirro.dave.eu].
 
 
 
We will copy them into <code>~/desk-mx-l/desk</code> directory. Needed binary files can be found on <code>MVM</code> in the following location:
 
  
 +
This is the list of the binary files that will be used by the script:
 
<pre>
 
<pre>
dvdk@vagrant:~$ ll /tftpboot/desk-mx6ul-l/
+
dvdk@vagrant:~/desk-mx-l$ ll /tftpboot/desk-mx-l/
total 11352
+
total 10916
-rw-r--r-- 1 dvdk root  32964 Mar 31 11:01 desk-mx6ul-l-4.0.0-imx6ul-axelulite-cb003a.dtb
+
drwxr-xr-x 2 dvdk root    4096 Jul  1 11:42 ./
-rw-r--r-- 1 dvdk root  32002 Mar 31 11:01 desk-mx6ul-l-4.0.0-imx6ul-axelulite-cb006c.dtb
+
drwxr-xr-x 3 dvdk root    4096 Jun 24 10:01 ../
-rw-r--r-- 1 dvdk root  33028 Mar 31 11:01 desk-mx6ul-l-4.0.0-imx6ul-lynx-som0013-cb002f.dtb
+
-rw-r--r-- 1 dvdk root  34095 Jun 24 10:03 desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb003a.dtb
-rw-r--r-- 1 dvdk root 8017976 Mar 31 11:01 desk-mx6ul-l-4.0.0-uImage
+
-rw-r--r-- 1 dvdk root  33137 Jun 24 10:03 desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb006c.dtb
-rw-r--r-- 1 dvdk root   35840 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_axelulite_SPL
+
-rw-r--r-- 1 dvdk root  34211 Jun 24 10:03 desk-mx6ul-l-1.0.1_imx6ul-lynx-som0013-cb002f.dtb
-rw-r--r-- 1 dvdk root  48128 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_axelulite_spi_SPL
+
-rw-r--r-- 1 dvdk root   56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPL
-rw-r--r-- 1 dvdk root  552184 Mar 31 11:00 desk-mx6ul-l-4.0.0-mx6uldesk_axelulite_spi_u-boot.img
+
-rw-r--r-- 1 dvdk root 547528 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_u-boot.img
-rw-r--r-- 1 dvdk root 551704 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_axelulite_u-boot.img
+
-rw-r--r-- 1 dvdk root  56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL
-rw-r--r-- 1 dvdk root   35840 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_lynx_SPL
+
-rw-r--r-- 1 dvdk root  547200 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img
-rw-r--r-- 1 dvdk root  48128 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_lynx_spi_SPL
+
-rw-r--r-- 1 dvdk root   56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_SPL
-rw-r--r-- 1 dvdk root  517248 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_lynx_spi_u-boot.img
+
-rw-r--r-- 1 dvdk root 512568 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_u-boot.img
-rw-r--r-- 1 dvdk root 516776 Mar 31 10:59 desk-mx6ul-l-4.0.0-mx6uldesk_lynx_u-boot.img
+
-rw-r--r-- 1 dvdk root  56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_SPL
-rw-r--r-- 1 dvdk root 1152054 Mar 31 10:59 splash_image.bmp
+
-rw-r--r-- 1 dvdk root  512216 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_u-boot.img
dvdk@vagrant:~$ mkdir -p ~/desk-mx-l/desk
+
-rw-r--r-- 1 dvdk root   52224 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_SPL
dvdk@vagrant:~$ cp /tftpboot/desk-mx6ul-l/desk-mx6ul-l-4.0.0_uImage ~/desk-mx-l/desk/desk-mx6ul-l-4.0.0_uImage
+
-rw-r--r-- 1 dvdk root 431512 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_u-boot.img
dvdk@vagrant:~$ cp /tftpboot/desk-mx6ul-l/desk-mx6ul-l-4.0.0_imx6ul-axelulite-cb003a.dtb ~/desk-mx-l/desk/desk-mx6ul-l-4.0.0_imx6ul-axelulite-cb003a.dtb
+
-rw-r--r-- 1 dvdk root 7056696 Jun 24 10:03 desk-mx6ul-l-1.0.1_uImage
dvdk@vagrant:~$ cp /tftpboot/desk-mx6ul-l/splash_image.bmp ~/desk-mx-l/desk/
+
-rw-r--r-- 1 dvdk root 1152054 Jun 24 10:01 splash_image.bmp
dvdk@vagrant:~$ cp ~/desk-mx-l/boot.scr ~/desk-mx-l/desk/boot.scr
+
dvdk@vagrant:~/desk-mx-l$  
dvdk@vagrant:~$ cp ~/desk-mx-l/rfs/desk-mx6ul-l-4.0.0_modules.tar.gz ~/desk-mx-l/desk/
 
 
</pre>
 
</pre>
  
Line 206: Line 194:
 
*Archive of the target's root file system (compressed as <code>.tar.bz2</code> file).
 
*Archive of the target's root file system (compressed as <code>.tar.bz2</code> file).
 
<pre>
 
<pre>
dvdk@vagrant:~/desk-mx-l$ sudo umount /dev/sdb*
+
dvdk@vagrant:~/desk-mx-l$ sudo ./mksd.sh /dev/sdb /tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img /tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL /tftpboot/desk-mx-l/ ./rfs/desk-mx6ul-l-1.0.1_dave-image-devel-desk-mx6ul.tar.bz2  
dvdk@vagrant:~/desk-mx-l$ sudo ./desk-mx6ul-l-4.0.1_mksd.sh /dev/sdb /tftpboot/desk-mx6ul-l/desk-mx6ul-l-4.0.0_mx6uldesk_axelulite_u-boot.img /tftpboot/desk-mx6ul-l/desk-mx6ul-l-4.0.0_mx6uldesk_axelulite_SPL ~/desk-mx-l/desk ./rfs/desk-mx6ul-l-4.0.1_dave-image-devel-desk-mx6ul.tar.bz2  
 
 
All data on /dev/sdb now will be destroyed! Continue? [y/n]
 
All data on /dev/sdb now will be destroyed! Continue? [y/n]
y              
+
y
 
[Partitioning /dev/sdb...]
 
[Partitioning /dev/sdb...]
1024+0 records in                                                                                      
+
1024+0 records in
 
1024+0 records out
 
1024+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.262305 s, 4.0 MB/s
+
1048576 bytes (1.0 MB, 1.0 MiB) copied, 3.14558 s, 333 kB/s
DISK SIZE - 31002198016 bytes
+
DISK SIZE - 15931539456 bytes
 
Checking that no-one is using this disk right now ... OK
 
Checking that no-one is using this disk right now ... OK
  
Disk /dev/sdb: 28.89 GiB, 31002198016 bytes, 60551168 sectors
+
Disk /dev/sdb: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Disk model: Transcend     
 
 
Units: sectors of 1 * 512 = 512 bytes
 
Units: sectors of 1 * 512 = 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
  
>>> Created a new DOS disklabel with disk identifier 0x937180d6.
+
>>> Created a new DOS disklabel with disk identifier 0x81b8796c.
/dev/sdb1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 8 GiB.
+
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 8 GiB.
/dev/sdb2: Created a new partition 2 of type 'Linux' and of size 20.9 GiB.
+
/dev/sdb2: Created a new partition 2 of type 'Linux' and of size 6.9 GiB.
/dev/sdb3: Done.
+
/dev/sdb3:  
 
 
 
New situation:
 
New situation:
Disklabel type: dos
 
Disk identifier: 0x937180d6
 
  
 
Device    Boot    Start      End  Sectors  Size Id Type
 
Device    Boot    Start      End  Sectors  Size Id Type
 
/dev/sdb1  *      32768 16777215 16744448    8G  c W95 FAT32 (LBA)
 
/dev/sdb1  *      32768 16777215 16744448    8G  c W95 FAT32 (LBA)
/dev/sdb2      16777216 60551167 43773952 20.9G 83 Linux
+
/dev/sdb2      16777216 31116287 14339072  6.9G 83 Linux
  
 
The partition table has been altered.
 
The partition table has been altered.
Line 240: Line 223:
 
Syncing disks.
 
Syncing disks.
 
[Making filesystems...]
 
[Making filesystems...]
mkfs.fat 4.1 (2017-01-24)
+
mkfs.fat 3.0.28 (2015-05-16)
mke2fs 1.45.5 (07-Jan-2020)
+
mke2fs 1.42.13 (17-May-2015)
 
/dev/sdb2 contains a ext3 file system labelled 'ROOTFS'
 
/dev/sdb2 contains a ext3 file system labelled 'ROOTFS'
        created on Mon Apr  3 10:19:52 2023
+
last mounted on /mnt on Thu Sep 17 16:27:41 2020
Creating filesystem with 5471744 4k blocks and 1368064 inodes
+
Creating filesystem with 1792384 4k blocks and 448800 inodes
Filesystem UUID: a0208180-9d1c-47e8-a8e0-c92a63a7059a
+
Filesystem UUID: 97e6964b-f60c-4f1f-b5e9-33569c976f4b
Superblock backups stored on blocks:
+
Superblock backups stored on blocks:  
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
+
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
        4096000
 
  
Allocating group tables: done
+
Allocating group tables: done                          
Writing inode tables: done
+
Writing inode tables: done                          
 
Creating journal (32768 blocks): done
 
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
+
Writing superblocks and filesystem accounting information: done  
  
 
[Copying files...]
 
[Copying files...]
'/home/dvdk/desk-mx-l/desk/boot.scr' -> '/mnt/boot.scr'
+
'/tftpboot/desk-mx-l/boot.scr' -> '/mnt/boot.scr'
'/home/dvdk/desk-mx-l/desk/desk-mx6ul-l-4.0.0_imx6ul-axelulite-cb003a.dtb' -> '/mnt/desk-mx6ul-l-4.0.0_imx6ul-axelulite-cb003a.dtb'
+
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb003a.dtb' -> '/mnt/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb003a.dtb'
'/home/dvdk/desk-mx-l/desk/desk-mx6ul-l-4.0.0_uImage' -> '/mnt/desk-mx6ul-l-4.0.0_uImage'
+
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb006c.dtb' -> '/mnt/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb006c.dtb'
'/home/dvdk/desk-mx-l/desk/splash_image.bmp' -> '/mnt/splash_image.bmp'
+
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_imx6ul-lynx-som0013-cb002f.dtb' -> '/mnt/desk-mx6ul-l-1.0.1_imx6ul-lynx-som0013-cb002f.dtb'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPL'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_u-boot.img'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_SPL'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_u-boot.img'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_SPL'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_u-boot.img'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_SPL'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_u-boot.img'
 +
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_uImage' -> '/mnt/desk-mx6ul-l-1.0.1_uImage'
 +
'/tftpboot/desk-mx-l/splash_image.bmp' -> '/mnt/splash_image.bmp'
 
[Extracting rfs (this may take a while...)]
 
[Extracting rfs (this may take a while...)]
 
[Programming SPL]
 
[Programming SPL]
70+0 records in
+
110+0 records in
70+0 records out
+
110+0 records out
35840 bytes (36 kB, 35 KiB) copied, 0.0120358 s, 3.0 MB/s
+
56320 bytes (56 kB, 55 KiB) copied, 0.263141 s, 214 kB/s
 
[Programming u-boot.img]
 
[Programming u-boot.img]
538+1 records in
+
534+1 records in
538+1 records out
+
534+1 records out
551704 bytes (552 kB, 539 KiB) copied, 0.164175 s, 3.4 MB/s
+
547200 bytes (547 kB, 534 KiB) copied, 2.26831 s, 241 kB/s
 
[Done]
 
[Done]
 
</pre>
 
</pre>
 +
  
 
[1] In case you have a different size, you'll need to change the <code>sfdisk</code> parameters accordingly.
 
[1] In case you have a different size, you'll need to change the <code>sfdisk</code> parameters accordingly.
Line 276: Line 271:
 
===bootscr ===
 
===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.
+
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:
 
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:
Line 283: Line 278:
 
echo 'bootscript generated with command "mkimage -A ARM -T script -C none -n DESK-MX6UL -d bootscript.txt boot.scr"'
 
echo 'bootscript generated with command "mkimage -A ARM -T script -C none -n DESK-MX6UL -d bootscript.txt boot.scr"'
  
setenv desk_release 'desk-mx6ul-l-4.0.0'
+
setenv desk_release 'desk-mx6ul-l-1.0.1'
  
 
if test 0x${som_configid#} = 0x00000013 && test 0x${cb_configid#} = 0x0000002f;
 
if test 0x${som_configid#} = 0x00000013 && test 0x${cb_configid#} = 0x0000002f;
Line 319: Line 314:
  
 
Then copy the ''boot.scr'' into the <code><binaries_dir></code> directories used by the script to create the SD card.
 
Then copy the ''boot.scr'' into the <code><binaries_dir></code> directories used by the script to create the SD card.
 
===Install Module===
 
 
To install kernel modules, follow the steps below.
 
 
<pre>
 
root@desk-mx6ul-axelulite:~# sudo mount /dev/mmcblk0p1 /media                   
 
root@desk-mx6ul-axelulite:~# tar xvzf /media/desk-mx6ul-l-4.0.0_modules.tar.gz -C /
 
</pre>
 
 
After installation, run the following command to verify that the installation was successful:
 
 
<pre>
 
root@desk-mx6ul-axelulite:~# ls -l /lib/modules/$(uname -r)
 
total 300
 
lrwxrwxrwx 1 541 502    65 Apr  3  2023 build -> /home/jenkins/workspace/workspace/DESK-MX6UL-L-4.x.x_Linux-kernel
 
drwxr-xr-x 6 541 502  4096 Apr  3  2023 kernel
 
-rw-r--r-- 1 541 502  2718 Apr  3  2023 modules.alias
 
-rw-r--r-- 1 541 502  4768 Apr  3  2023 modules.alias.bin
 
-rw-r--r-- 1 541 502  14878 Apr  3  2023 modules.builtin
 
-rw-r--r-- 1 541 502  34704 Apr  3  2023 modules.builtin.alias.bin
 
-rw-r--r-- 1 541 502  17778 Apr  3  2023 modules.builtin.bin
 
-rw-r--r-- 1 541 502 105373 Apr  3  2023 modules.builtin.modinfo
 
-rw-r--r-- 1 541 502  10689 Apr  3  2023 modules.dep
 
-rw-r--r-- 1 541 502  21666 Apr  3  2023 modules.dep.bin
 
-rw-r--r-- 1 541 502      0 Apr  3  2023 modules.devname
 
-rw-r--r-- 1 541 502  8657 Apr  3  2023 modules.order
 
-rw-r--r-- 1 541 502    85 Apr  3  2023 modules.softdep
 
-rw-r--r-- 1 541 502  16970 Apr  3  2023 modules.symbols
 
-rw-r--r-- 1 541 502  23964 Apr  3  2023 modules.symbols.bin
 
lrwxrwxrwx 1 541 502    65 Apr  3  2023 source -> /home/jenkins/workspace/workspace/DESK-MX6UL-L-4.x.x_Linux-kernel
 
</pre>
 
  
 
----
 
----
  
 
[[Category:AXEL ULite]]
 
[[Category:AXEL ULite]]

Revision as of 13:24, 15 July 2021

History
Version Issue Date Notes
1.0.1 Jun 2021 First DESK release



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-MX6UL-L/General/Release_Notes|DESK-MX6UL-L Release Notes] kit by using a simple bash script.
Note: Starting from this release the support for the SPL has been introduced in U-Boot. 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 16.04 distribution with

The resulting card is partitioned as depicted here below:

  • bootable partition (mmcblk0p1, vfat) containing:
    • binary images (u-boot and kernel images)
  • root file system partition (mmcblk0p2, ext3)
    • root file system binaries and init scripts

The script - named mksd.sh - can be realized with the following code:

#!/bin/bash

if [[ -z $1 || -z $2 || -z $3 || -z $4 || -z $5 ]]
then
	echo "$0 Usage:"
	echo "	$0 <device> <u-boot.img> <SPL> <binaries directory> <rootfs tar.bz2>"
	echo "	Example: $0 /dev/sdc u-boot.img SPL binaries/ rootfs.tar.bz2"
	exit
fi

if [ "$(whoami)" != "root" ]
then
	echo "you must be root to run this script!"
	exit
fi

if ! [[ -b $1 ]]
then
	echo "$1 is not a valid block device!"
	exit
fi

if ! [[ -e $2 ]]
then
	echo "Incorrect u-boot.img location!"
	exit
fi

if ! [[ -e $3 ]]
then
	echo "Incorrect SPL location!"
	exit
fi

if ! [[ -d $4 ]]
then
	echo "Incorrect Binaries location!"
	exit
fi

if ! [[ -f $5 ]]
then
	echo "Incorrect rootfs location!"
	exit
fi

DRIVE=$1
if [[ "$DRIVE" == *"mmcblk"* ]]
then
	echo "You're using a mmc device, I need to fix partition names"
	PART="p"
else
	PART=""
fi
UBOOT=$2
SPL=$3
BINARIES=$4
RFS=$5

echo "All data on "$DRIVE" now will be destroyed! Continue? [y/n]"
read ans
if ! [ $ans == 'y' ]
then
	exit
fi

echo "[Partitioning $1...]"

dd if=/dev/zero of=$DRIVE bs=1024 count=1024

SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`

echo DISK SIZE - $SIZE bytes

CYLINDERS=`echo $SIZE/255/63/512 | bc`

# check if we're running an old (e.g. 2.20.x) or new (e.g. 2.24.x) sfdisk
sfdisk --help | grep -- -H

if [ "$?" -eq "0" ]
then
	{
		echo 40,1380,0x0c,*
		echo 1420,,83,-
	} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
else
{
    echo 16M,8176M,0x0c,*
    echo 8192M,,83,-
} | sfdisk $DRIVE
fi

partprobe


echo "[Making filesystems...]"
mkfs.vfat -F 32 -n BOOT "$DRIVE$PART"1 #> /dev/null
mkfs.ext3 -F -L ROOTFS "$DRIVE$PART"2 #> /dev/null

echo "[Copying files...]"

binaries_dir=${BINARIES%/}
mount "$DRIVE$PART"1 /mnt
cp -av --no-preserve=ownership $binaries_dir/* /mnt/
umount "$DRIVE$PART"1

echo "[Extracting rfs (this may take a while...)]"
mount "$DRIVE$PART"2 /mnt
tar jxf $RFS -C /mnt > /dev/null
chmod 755 /mnt
umount "$DRIVE$PART"2

echo "[Programming SPL]"
dd if=$SPL of=$DRIVE bs=512 seek=2 conv=fsync

echo "[Programming u-boot.img]"
dd if=$UBOOT of=$DRIVE bs=1k seek=69 conv=fsync

echo "[Done]"


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: imx6ul-lynx-som0013-cb002f.dtb (or imx6ul-axelulite-cb003a.dtb or imx6ul-axelulite-cb006c.dtb)

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

dvdk@vagrant:~/desk-mx-l$ ll /tftpboot/desk-mx-l/
total 10916
drwxr-xr-x 2 dvdk root    4096 Jul  1 11:42 ./
drwxr-xr-x 3 dvdk root    4096 Jun 24 10:01 ../
-rw-r--r-- 1 dvdk root   34095 Jun 24 10:03 desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb003a.dtb
-rw-r--r-- 1 dvdk root   33137 Jun 24 10:03 desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb006c.dtb
-rw-r--r-- 1 dvdk root   34211 Jun 24 10:03 desk-mx6ul-l-1.0.1_imx6ul-lynx-som0013-cb002f.dtb
-rw-r--r-- 1 dvdk root   56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPL
-rw-r--r-- 1 dvdk root  547528 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_u-boot.img
-rw-r--r-- 1 dvdk root   56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL
-rw-r--r-- 1 dvdk root  547200 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img
-rw-r--r-- 1 dvdk root   56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_SPL
-rw-r--r-- 1 dvdk root  512568 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_u-boot.img
-rw-r--r-- 1 dvdk root   56320 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_SPL
-rw-r--r-- 1 dvdk root  512216 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_u-boot.img
-rw-r--r-- 1 dvdk root   52224 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_SPL
-rw-r--r-- 1 dvdk root  431512 Jun 24 10:01 desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_u-boot.img
-rw-r--r-- 1 dvdk root 7056696 Jun 24 10:03 desk-mx6ul-l-1.0.1_uImage
-rw-r--r-- 1 dvdk root 1152054 Jun 24 10:01 splash_image.bmp
dvdk@vagrant:~/desk-mx-l$ 

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

  • Device file of the microSD card (/dev/sdb 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-mx-l$ sudo ./mksd.sh /dev/sdb /tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img /tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL /tftpboot/desk-mx-l/ ./rfs/desk-mx6ul-l-1.0.1_dave-image-devel-desk-mx6ul.tar.bz2 
All data on /dev/sdb now will be destroyed! Continue? [y/n]
y
[Partitioning /dev/sdb...]
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 3.14558 s, 333 kB/s
DISK SIZE - 15931539456 bytes
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

>>> Created a new DOS disklabel with disk identifier 0x81b8796c.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 8 GiB.
/dev/sdb2: Created a new partition 2 of type 'Linux' and of size 6.9 GiB.
/dev/sdb3: 
New situation:

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdb1  *       32768 16777215 16744448    8G  c W95 FAT32 (LBA)
/dev/sdb2       16777216 31116287 14339072  6.9G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[Making filesystems...]
mkfs.fat 3.0.28 (2015-05-16)
mke2fs 1.42.13 (17-May-2015)
/dev/sdb2 contains a ext3 file system labelled 'ROOTFS'
	last mounted on /mnt on Thu Sep 17 16:27:41 2020
Creating filesystem with 1792384 4k blocks and 448800 inodes
Filesystem UUID: 97e6964b-f60c-4f1f-b5e9-33569c976f4b
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

[Copying files...]
'/tftpboot/desk-mx-l/boot.scr' -> '/mnt/boot.scr'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb003a.dtb' -> '/mnt/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb003a.dtb'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb006c.dtb' -> '/mnt/desk-mx6ul-l-1.0.1_imx6ul-axelulite-cb006c.dtb'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_imx6ul-lynx-som0013-cb002f.dtb' -> '/mnt/desk-mx6ul-l-1.0.1_imx6ul-lynx-som0013-cb002f.dtb'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_SPL'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_spi_u-boot.img'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_SPL'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_axelulite_u-boot.img'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_SPL'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_spi_u-boot.img'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_SPL'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_u-boot.img'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_SPL' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_SPL'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_u-boot.img' -> '/mnt/desk-mx6ul-l-1.0.1_mx6uldesk_lynx_usb_u-boot.img'
'/tftpboot/desk-mx-l/desk-mx6ul-l-1.0.1_uImage' -> '/mnt/desk-mx6ul-l-1.0.1_uImage'
'/tftpboot/desk-mx-l/splash_image.bmp' -> '/mnt/splash_image.bmp'
[Extracting rfs (this may take a while...)]
[Programming SPL]
110+0 records in
110+0 records out
56320 bytes (56 kB, 55 KiB) copied, 0.263141 s, 214 kB/s
[Programming u-boot.img]
534+1 records in
534+1 records out
547200 bytes (547 kB, 534 KiB) copied, 2.26831 s, 241 kB/s
[Done]


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

bootscr[edit | edit source]

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 boot.scr u-boot bootscript.

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

echo 'bootscript generated with command "mkimage -A ARM -T script -C none -n DESK-MX6UL -d bootscript.txt boot.scr"'

setenv desk_release 'desk-mx6ul-l-1.0.1'

if test 0x${som_configid#} = 0x00000013 && test 0x${cb_configid#} = 0x0000002f;
then
    setenv fdtfile ${desk_release}_imx6ul-lynx-som0013-cb002f.dtb
elif test 0x${cb_configid#} = 0x0000003a
then
	setenv fdtfile ${desk_release}_imx6ul-axelulite-cb003a.dtb
elif test 0x${cb_configid#} = 0x0000006c
then
	setenv fdtfile ${desk_release}_imx6ul-axelulite-cb006c.dtb
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 DESK-MX6UL via mmcboot with ${fdtfile} as device tree

run mmcboot

echo mmcboot FAILURE

and compile it using:

mkimage -A ARM -T script -C none -n DESK-MX6UL -d bootscript.txt boot.scr

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