Skip to content
Snippets Groups Projects
Commit 236a1f38 authored by Martyn Welch's avatar Martyn Welch
Browse files

Add image for installing U-Boot on SABRE Lite


We are moving to installing U-Boot in the SPI NOR on the SABRE Lite board.
Provide an image to make it trivial to get U-Boot installed without
needing to follow a list of error prone instructions.

Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
parent fffab36d
No related branches found
No related tags found
1 merge request!92Wip/martyn/u boot installer
{{ $architecture := or .architecture "armhf" }}
{{ $target := or .target "mx6qsabrelite" }}
{{ $mirror := or .mirror "https://repositories.apertis.org/apertis/" }}
{{ $suite := or .suite "v2019dev0" }}
{{ $image := or .image (printf "uboot-%s-installer-%s" $suite $target) }}
architecture: {{ $architecture }}
actions:
- action: image-partition
imagename: {{ $image }}.img
imagesize: 300M
partitiontype: msdos
mountpoints:
- mountpoint: /
partition: data
options: [ ro ]
partitions:
- name: data
fs: ext2
start: 6176s
end: 100%
flags: [ boot ]
- action: overlay
source: overlays/installer-{{ $target }}
- action: filesystem-deploy
description: Deploying filesystem onto image
- action: run
description: Create chdist directory
chroot: false
command: mkdir "./chdist"
- action: run
description: Setup chdist
chroot: false
command: chdist -d "./chdist" create apertis-{{ $suite }} {{ $mirror }} {{ $suite }} target
- action: run
description: Add Apertis gpg key to chdist
chroot: false
command: cp "${RECIPEDIR}/keyring/apertis-archive-keyring.gpg" "./chdist/apertis-{{ $suite }}/etc/apt/trusted.gpg.d"
- action: run
description: Update repo (chdist)
chroot: false
command: chdist -d "./chdist" -a {{ $architecture }} apt apertis-{{ $suite }} update
- action: run
description: Download U-Boot (chdist)
chroot: false
command: chdist -d "./chdist" -a {{ $architecture }} apt apertis-{{ $suite }} download u-boot-imx
- action: run
description: Unpack U-Boot
chroot: false
command: dpkg -x u-boot-imx_*.deb "${ROOTDIR}/deb-binaries"
- action: run
description: Wrapper installation script
chroot: false
command: mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "U-Boot SPI Installation Script" -d "${ROOTDIR}/boot.cmd" "${ROOTDIR}/boot.scr"
- action: raw
description: Install U-Boot
origin: filesystem
source: /deb-binaries/usr/lib/u-boot/{{ $target }}/u-boot.imx
offset: {{ sector 2 }}
- action: run
description: Create block map for {{ $image }}.img
postprocess: true
command: bmaptool create {{ $image }}.img > {{ $image }}.img.bmap
- action: run
description: Compress {{ $image }}.img
postprocess: true
command: gzip -f {{ $image }}.img
- action: run
description: Checksum for {{ $image }}.img.gz
postprocess: true
command: sha256sum {{ $image }}.img.gz > {{ $image }}.img.gz.sha256
echo "Copying U-Boot to RAM"
load mmc 0:1 0x12000000 /deb-binaries/usr/lib/u-boot/mx6qsabrelite/u-boot.imx
echo "Probing SPI-NOR"
sf probe 0
echo "Erasing SPI_NOR"
sf erase 0x0 0xc0000
echo "Writing U-Boot to SPI-NOR"
sf write 0x12000000 0x400 0xc0000
echo ""
echo '+-----------------------------------------------------------------+'
echo '| U-Boot installation complete |'
echo '| |'
echo '| Please remove the SD Card and power cycle the board to continue |'
echo '+-----------------------------------------------------------------+'
loop 0 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment