Open main menu

DAVE Developer's Wiki β

Changes

no edit summary
[[File:TBD.png|thumb|center|200px|Work in progress]]
 
<section begin=History/>
{| style="border-collapse:collapse; "
!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"|X1.Y0.Z0|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 YearApr 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"|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"|TBDFirst DESK release
|-
|}
'''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''16.04) distribution with
*a 16 GB microSD card [1]
*the binary files delivered along with the [[Axel_Embedded_Linux_Kit_(XELK)#Downloadable_binary_images|DESKMX6ULDESK-MX6UL-L ''1.x0.x''1]].The resulting card is partitioned as depicted [[Axel_Embedded_Linux_Kit_(XELK)#XELK_microSD_Layout|here]].
The script - named <code>mksddesk-mx6ul-l-1.0.0_mksd.sh</code> - looks like this:
<pre>
TBD #!/bin/bash if [[ -z $1 || -z $2 || -z $3 || -z $4 || -z $5 ]]then echo "$0 Usage: cat " 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" exitfi if [ "$(whoami)" != "root" ]then echo "you must be root to run this script!" exitfi if ! [[ -b $1 ]]then echo "$1 is not a valid block device!" exitfi if ! [[ -e $2 ]]then echo "Incorrect u-boot.img location!" exitfi if ! [[ -e $3 ]]then echo "Incorrect SPL location!" exitfi if ! [[ -d $4 ]]then echo "Incorrect Binaries location!" exitfi if ! [[ -f $5 ]]then echo "Incorrect rootfs location!" exitfi DRIVE=$1if [[ "$DRIVE" == *"mmcblk"* ]]then echo "You're using a mmc device, I need to fix partition names" PART="p"else PART=""fiUBOOT=$2SPL=$3BINARIES=$4RFS=$5 echo "All data on "$DRIVE" now will be destroyed! Continue? [y/n]"read ansif ! [ $ans == 'y' ]then exitfi echo "[Partitioning $1...]" dd if=/dev/zero of mksd=$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.sh script2.24.x) sfdisksfdisk --help | grep -- -H if [ "$?" -eq "0" ]then { echo 40,1380,0x0c,* echo 1420,,83,- } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVEelse{ echo 16M,8176M,0x0c,* echo 8192M,,83,-} | sfdisk $DRIVEfi partprobe  echo "[Making filesystems...]"mkfs.vfat -F 32 -n BOOT "$DRIVE$PART"1 #> /dev/nullmkfs.ext3 -F -L ROOTFS "$DRIVE$PART"2 #> /dev/null echo "[Copying files...]" binaries_dir=${BINARIES%/}mount "$DRIVE$PART"1 /mntcp -av --no-preserve=ownership $binaries_dir/* /mnt/umount "$DRIVE$PART"1 echo "[Extracting rfs (this may take a while...)]"mount "$DRIVE$PART"2 /mnttar jxf $RFS -C /mnt > /dev/nullchmod 755 /mntumount "$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]"
</pre>
* bootscript: <code>boot.scr</code>
* Linux kernel: <code>uImage</code>
* Device tree blob: <code>''carrier''imx6ul-lynx-som0013-cb002f.dtb</code>(or <code>imx6ul-axelulite-cb003a.dtb</code> or <code>imx6ul-axelulite-cb006c.dtb</code>)
This is the list of the binary files that will be used by the script:
<pre>
dvdk@vagrant:~/desk-{{{kit}}}mx-l$ ls ll /tftpboot/desk-mx-l/total 10916drwxr-xr-x 2 dvdk root 4096 Apr 14 11:28 ./drwxr-xr-x 3 dvdk root 4096 Apr 14 11:27 ../-rw-r--r-- 1 dvdk root 34095 Apr 14 11:28 desk-mx6ul-l-1.0.0_imx6ul-axelulite-cb003a.dtb-rw-r--r-- 1 dvdk root 33137 Apr 14 11:28 desk-mx6ul-l-1.0.0_imx6ul-axelulite-cb006c.dtb-rw-r--r-- 1 dvdk root 34211 Apr 14 11:28 desk-mx6ul-l-1.0.0_imx6ul-lalynx-som0013-cb002f.dtb-rw-r--r-- 1 dvdk root 56320 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_axelulite_spi_SPL-rw-r--r-- 1 dvdk root 547528 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_axelulite_spi_u-boot.imgTBD directory listing-rw-r--r-- 1 dvdk root 56320 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_axelulite_SPL-rw-r--r-- 1 dvdk root 547200 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_axelulite_u-boot.img-rw-r--r-- 1 dvdk root 56320 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_lynx_spi_SPL-rw-r--r-- 1 dvdk root 512568 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_lynx_spi_u-boot.img-rw-r--r-- 1 dvdk root 56320 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_lynx_SPL-rw-r--r-- 1 dvdk root 512216 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_lynx_u-boot.img-rw-r--r-- 1 dvdk root 52224 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_lynx_usb_SPL-rw-r--r-- 1 dvdk root 431512 Apr 14 11:27 desk-mx6ul-l-1.0.0_mx6uldesk_lynx_usb_u-boot.img-rw-r--r-- 1 dvdk root 7056696 Apr 14 11:28 desk-mx6ul-l-1.0.0_uImage-rw-r--r-- 1 dvdk root 1152054 Apr 14 11:27 splash_image.bmpdvdk@vagrant:~/desk-mx-l$
</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>
dvdk@vagrant:~/desk-{{{kit}}}$ ./mksddesk-mx6ul-l-1.0.0_mksd.sh /dev/sd<x> <u-boot.img> <SPL> <binaries_dir>/ <rfs_filename>
...
...
TBD
...
...
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 MX6UL -d bootscript.txt boot.scr"'
setenv desk_release 'desk-mx6mx6ul-l-1.0.0'
if test 0x${som_configid#} = 0x00000013 && test 0x${cb_configid#} = 0x000000120x0000002f;
then
if test ${cpu} = 6DL; then setenv fdtfile ${desk_release}_imx6dl-sbcx_imx6ul-cb0012.dtb else setenv fdtfile ${desk_release}_imx6qlynx-sbcxsom0013-cb0012cb002f.dtb fielif test 0x${cb_configid#} = 0x00000013;0x0000003a
then
if test ${cpu} = 6DL; then setenv fdtfile ${desk_release}_imx6dl_imx6ul-sbcxaxelulite-cb0013cb003a.dtb else setenv fdtfile ${desk_release}_imx6q-sbcx-cb0013.dtb fielif test 0x${cb_configid#} = 0xffffffff;0x0000006c
then
if test ${cpu} = 6DL; then setenv fdtfile ${desk_release}_imx6dl_imx6ul-deskaxelulite-l-2.0.0.dtb else setenv fdtfile ${desk_release}_imx6q-desk-l-2.0.0cb006c.dtb fi
else
echo Invalid CB! Autoreset ...
setenv mmc_loadfdt 'fatload mmc ${mmcdev}:1 ${fdtaddr} ${fdtfile}'
echo Booting AxelLite-DESK-SBCX MX6UL via mmcboot with ${fdtfile} as device tree
run mmcboot
<pre>
mkimage -A ARM -T script -C none -n AXEL-Lite-DESK-SBCX MX6UL -d bootscript.txt boot.scr
</pre>
8,226
edits