Open main menu

DAVE Developer's Wiki β

Changes

Update SD card section for DESK-MX6UL-L v4.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:#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" |23.0.0
| 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" |Mar 2022
| 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 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:#edf8fb; padding:5px; color:#000000" |4.0.0
| 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" |Apr 2023
| 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 4.0.0 release
|-
|}
'''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>
The procedure has been tested on a MVM released with '''DESK-MX6-L 34.0.0''' release with *a 16 32 GB microSD card [1]
*a USB SD card reader
*the binary files delivered along with the [[DESK-MX6UL-L/General/Release_Notes#Downloadable_binary_images_2Downloadable_binary_images_3|DESK-MX6UL-L 34.0.0]]
The resulting card is partitioned as depicted here below:
The script - named <code>mksd.sh</code> - can be realized with the following code:
<pre>
#!/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!" exitfi
if ! [[ -e $2 ]]
then echo "Incorrect u-boot.img location!" exit fi if ! [[ -e $3 ]] then echo "Incorrect SPL location!" exit
fi
 if ! [[ -e $3 ]]then echo "Incorrect SPL location!" exitfi
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
if [ "$?" -eq "0" ]
then
{ echo 40,1380,0x0c,* echo 1420,,83,- } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
else
{
</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_2Downloadable_binary_images_3|DESK-MX6UL-L 34.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:
* bootscript: <code>boot.scr</code>
* splash image: <code>splash_image.bmp</code>
* Linux kernel: <code>desk-mx6ul-l-34.0.0_uImage</code>* Device tree blob: <code>desk-mx6ul-l-34.0.0_imx6ul-axelulite-cb003a.dtb</code>.
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:
<pre>
dvdk@vagrant:~$ ll /tftpboot/desk-mx-l/
total 12180drwxr-xr-x 2 dvdk root 4096 Feb 27 18:54 ./drwxr-xr-x 3 dvdk root 4096 Feb 27 18:52 ../11352-rw-r--r-- 1 dvdk root 32441 Feb 27 1832964 Mar 31 11:54 01 desk-mx6ul-l-34.0.0_imx6ul0-imx6ul-axelulite-cb003a.dtb-rw-r--r-- 1 dvdk root 31479 Feb 27 1832002 Mar 31 11:54 01 desk-mx6ul-l-34.0.0_imx6ul0-imx6ul-axelulite-cb006c.dtb-rw-r--r-- 1 dvdk root 32518 Feb 27 1833028 Mar 31 11:54 01 desk-mx6ul-l-34.0.0_imx6ul0-imx6ul-lynx-som0013-cb002f.dtb-rw-r--r-- 1 dvdk root 44032 Feb 27 188017976 Mar 31 11:52 01 desk-mx6ul-l-34.0.0_mx6uldesk_axelulite_spi_SPL0-uImage-rw-r--r-- 1 dvdk root 600280 Feb 27 18 35840 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_axelulite_spi_u0-boot.imgmx6uldesk_axelulite_SPL-rw-r--r-- 1 dvdk root 44032 Feb 27 1848128 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_axelulite_SPL0-mx6uldesk_axelulite_spi_SPL-rw-r--r-- 1 dvdk root 600280 Feb 27 18552184 Mar 31 11:52 00 desk-mx6ul-l-34.0.0_mx6uldesk_axelulite_u0-mx6uldesk_axelulite_spi_u-boot.img-rw-r--r-- 1 dvdk root 44032 Feb 27 18 551704 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_lynx_spi_SPL0-mx6uldesk_axelulite_u-boot.img-rw-r--r-- 1 dvdk root 564844 Feb 27 18 35840 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_lynx_spi_u0-boot.imgmx6uldesk_lynx_SPL-rw-r--r-- 1 dvdk root 44032 Feb 27 1848128 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_lynx_SPL0-mx6uldesk_lynx_spi_SPL-rw-r--r-- 1 dvdk root 564244 Feb 27 18517248 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_lynx_u0-mx6uldesk_lynx_spi_u-boot.img-rw-r--r-- 1 dvdk root 44032 Feb 27 18 516776 Mar 31 10:52 59 desk-mx6ul-l-34.0.0_mx6uldesk_lynx_usb_SPL-rw-r--r0-- 1 dvdk root 457216 Feb 27 18:52 desk-mx6ul-l-3.0.0_mx6uldesk_lynx_usb_umx6uldesk_lynx_u-boot.img-rw-r--r-- 1 dvdk root 8189464 Feb 27 181152054 Mar 31 10:54 desk-mx6ul-l-359 splash_image.0.0_uImagebmpdvdk@vagrant:~$ ll mkdir -p ~/desk-mx-l/desk-mx6ul-l-3.0.0_boot.scr-rw-rw-r-- 1 dvdk dvdk 936 Feb 28 07:36 /home/dvdk/desk-mx-l/desk-mx6ul-l-3.0.0_boot.scrdvdk@vagrant:~$ cp /tftpboot/desk-mx-l/desk-mx6ul-l-34.0.0_uImage ~/desk-mx-l/desk/desk-mx6ul-l-34.0.0_uImagedvdk@vagrant:~$ cp /tftpboot/desk-mx-l/desk-mx6ul-l-34.0.0_imx6ul-axelulite-cb003a.dtb ~/desk-mx-l/desk/desk-mx6ul-l-34.0.0_imx6ul-axelulite-cb003a.dtb
dvdk@vagrant:~$ cp /tftpboot/desk-mx-l/splash_image.bmp ~/desk-mx-l/desk/
dvdk@vagrant:~$ cp ~/desk-mx-l/desk-mx6ul-l-34.0.0_boot.scr ~/desk-mx-l/desk/boot.scr
</pre>
*Archive of the target's root file system (compressed as <code>.tar.bz2</code> file).
<pre>
dvdk@vagrant:~/desk-mx-l$ sudo umount /dev/sdb*dvdk@vagrant:~/desk-mx-l$ sudo ./desk-mx6ul-l-34.0.0_mksd.sh /dev/sdb /tftpboot/desk-mx-l/desk-mx6ul-l-34.0.0_mx6uldesk_axelulite_u-boot.img /tftpboot/desk-mx-l/desk-mx6ul-l-34.0.0_mx6uldesk_axelulite_SPL ~/desk-mx-l/desk ./rfs/desk-mx6ul-l-34.0.0_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, 20.05358 262305 s, 511 kB4.0 MB/sDISK SIZE - 15931539456 31002198016 bytes
Checking that no-one is using this disk right now ... OK
Disk /dev/sdb: 1428.86 89 GiB, 15931539456 31002198016 bytes, 31116288 60551168 sectors
Disk model: Transcend
Units: sectors of 1 * 512 = 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
>>> Created a new DOS disklabel with disk identifier 0x3adbf72f0x937180d6.
/dev/sdb1: 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 620.9 GiB.
/dev/sdb3: Done.
New situation:
Disklabel type: dos
Disk identifier: 0x3adbf72f0x937180d6
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 32768 16777215 16744448 8G c W95 FAT32 (LBA)
/dev/sdb2 16777216 31116287 14339072 660551167 43773952 20.9G 83 Linux
The partition table has been altered.
mkfs.fat 4.1 (2017-01-24)
mke2fs 1.45.5 (07-Jan-2020)
/dev/sdb2 contains a ext3 file system labelled 'ROOTFS' created on Mon Apr 3 10:19:52 2023Creating filesystem with 1792384 5471744 4k blocks and 448800 1368064 inodesFilesystem UUID: 3f65294aa0208180-899d9d1c-417c47e8-9092a8e0-e8bf209ec6b2c92a63a7059aSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000
Allocating group tables: done Writing inode tables: done Creating journal (16384 32768 blocks): doneWriting superblocks and filesystem accounting information: done
[Copying files...]
'/home/dvdk/desk-mx-l/desk/boot.scr' -> '/mnt/boot.scr'
'/home/dvdk/desk-mx-l/desk/desk-mx6ul-l-34.0.0_imx6ul-axelulite-cb003a.dtb' -> '/mnt/desk-mx6ul-l-34.0.0_imx6ul-axelulite-cb003a.dtb''/home/dvdk/desk-mx-l/desk/desk-mx6ul-l-34.0.0_uImage' -> '/mnt/desk-mx6ul-l-34.0.0_uImage'
'/home/dvdk/desk-mx-l/desk/splash_image.bmp' -> '/mnt/splash_image.bmp'
[Extracting rfs (this may take a while...)]
[Programming SPL]
8670+0 records in8670+0 records out44032 35840 bytes (44 36 kB, 43 35 KiB) copied, 0.0930599 0120358 s, 473 kB3.0 MB/s
[Programming u-boot.img]
586538+1 records in586538+1 records out600280 551704 bytes (600 552 kB, 586 539 KiB) copied, 10.64853 164175 s, 364 kB3.4 MB/s
[Done]
</pre>
devwiki_user
120
edits