Skip to content
Snippets Groups Projects
Commit a9e985f8 authored by Denis Pynkin's avatar Denis Pynkin Committed by Frédéric Dalleau
Browse files

OSTree based image for arm64 uboot


Create a yaml file for use with debos,
Add a script to install boot files in the image to be generated.
A small workaround allows to place arm64 dtbs at the appropriate
location to be found by u-boot.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.co.uk>
Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
Reviewed-by: default avatarHéctor Orón Martínez <hector.oron@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D7600
parent e083a53a
No related branches found
No related tags found
No related merge requests found
{{ $architecture := or .architecture "arm64" }}
{{ $type := or .type "minimal" }}
{{ $suite := or .suite "18.03" }}
{{ $image := or .image (printf "apertis-ostree-%s-%s-%s" $suite $type $architecture) }}
{{ $board := or .board "uboot" }}
{{ $repourl := or .repourl "https://images.apertis.org/ostree/repo" }}
{{ $osname := or .osname "apertis" }}
{{ $branch := or .branch (printf "%s/%s/%s-%s/%s" $osname $suite $architecture $board $type) }}
{{ $ostree := or .ostree "repo" }}
{{ $cmdline := or .cmdline "console=tty0 console=ttyS0,115200n8 rootwait rw quiet splash plymouth.ignore-serial-consoles" }}
architecture: {{ $architecture }}
actions:
- action: image-partition
imagename: {{ $image }}.img
{{ if eq $type "minimal" }}
imagesize: 4G
{{end}}
{{ if eq $type "target" "development" }}
imagesize: 15G
{{end}}
partitiontype: gpt
mountpoints:
- mountpoint: /
partition: system
- mountpoint: /boot
partition: boot
partitions:
- name: boot
fs: ext2
start: 0%
end: 1024M
flags: [ boot ]
options: [ x-systemd.automount ]
- name: system
fs: ext4
start: 1024M
end: 3000M
- name: general_storage
fs: btrfs
start: 3000M
end: 100%
- action: run
description: Install bootloader
chroot: false
script: scripts/setup-uboot-bootloader.sh
- action: ostree-deploy
description: Deploying ostree onto image
repository: {{ $ostree }}
remote_repository: {{ $repourl }}
branch: {{ $branch }}
os: {{ $osname }}
append-kernel-cmdline: {{ $cmdline }}
- 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: md5sum {{ $image }}.img.gz > {{ $image }}.img.gz.md5
......@@ -46,6 +46,10 @@ def setup_boot (rootdir, bootdir):
initrd.replace ("initrd.img", "initramfs") + "-" + csum))
if dtbs != None:
# Workaround the fact that dtbs are stored in /boot/dtbs/version
if os.path.isdir (os.path.join (dtbs, version)):
dtbs = os.path.join (dtbs, version)
shutil.move (dtbs, os.path.join (bootdir, "dtbs-" + version + "-" + csum))
def split_passwd_files (rootdir):
......
#!/bin/bash
set -e
if [ -z "${ROOTDIR}" ] ; then
echo "ROOTDIR not given"
exit 1
fi
mkdir -p ${ROOTDIR}/boot/extlinux
mkdir -p ${ROOTDIR}/boot/loader.0
ln -s loader.0 ${ROOTDIR}/boot/loader
ln -s ../loader/extlinux.conf ${ROOTDIR}/boot/extlinux/extlinux.conf
cat << EOF > ${ROOTDIR}/boot/extlinux/extlinux.conf
menu title Apertis OStree image
timeout 10
EOF
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