From 7f1a1fb43250f92d9d302195fb75068374459fde Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Dalleau?=
 <frederic.dalleau@collabora.com>
Date: Wed, 13 Feb 2019 11:29:42 +0000
Subject: [PATCH] Add an empty u-boot environment to mx6qsabrelite images
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The Apertis update manager needs a valid u-boot environment to handle
the rollback. Do it an image generation so that every image
distributed already have a valid env.

Signed-off-by: Frédéric Dalleau <frederic.dalleau@collabora.com>
---
 apertis-image-mx6qsabrelite.yaml                 |   6 ++++++
 apertis-ospack-minimal.yaml                      |   3 +++
 .../usr/share/u-boot-env-imx6/u-boot-env.txt     |   1 +
 .../usr/share/u-boot-env-imx6/u-boot.env         | Bin 0 -> 8192 bytes
 4 files changed, 10 insertions(+)
 create mode 100644 overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot-env.txt
 create mode 100644 overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot.env

diff --git a/apertis-image-mx6qsabrelite.yaml b/apertis-image-mx6qsabrelite.yaml
index b6b64c83..7034aaba 100644
--- a/apertis-image-mx6qsabrelite.yaml
+++ b/apertis-image-mx6qsabrelite.yaml
@@ -100,6 +100,12 @@ actions:
     source: /usr/lib/u-boot/mx6qsabrelite/u-boot.imx
     offset: {{ sector 2 }}
 
+  - action: raw
+    description: Install U-Boot environment
+    origin: filesystem
+    source: /usr/share/u-boot-env-imx6/u-boot.env
+    offset: 0xC0000
+
   - action: run
     description: "Save installed package status"
     chroot: false
diff --git a/apertis-ospack-minimal.yaml b/apertis-ospack-minimal.yaml
index fac28a3a..803e3290 100644
--- a/apertis-ospack-minimal.yaml
+++ b/apertis-ospack-minimal.yaml
@@ -93,6 +93,9 @@ actions:
 {{ if eq $architecture "armhf" }}
   - action: overlay
     source: overlays/initramfs-modules-imx6
+
+  - action: overlay
+    source: overlays/u-boot-env-imx6
 {{ end }}
 
   - action: overlay
diff --git a/overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot-env.txt b/overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot-env.txt
new file mode 100644
index 00000000..dd2e9006
--- /dev/null
+++ b/overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot-env.txt
@@ -0,0 +1 @@
+bootcount=0
diff --git a/overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot.env b/overlays/u-boot-env-imx6/usr/share/u-boot-env-imx6/u-boot.env
new file mode 100644
index 0000000000000000000000000000000000000000..005b4768b595a3bb7f8cfd68db9fcd13183efa31
GIT binary patch
literal 8192
zcmeIuK@|WI6aYYB1W-T>1-Sbc?pu3L<nZ21gvnp~d&C;C=c*;8g8>5u3>YwAz<>b*
d1`HT5V8DO@0|pEjFkrxd0RsjM7%=eKzy;qA*B<}?

literal 0
HcmV?d00001

-- 
GitLab