* [cip-dev][isar-cip-core][PATCH 0/2] Secureboot fixes
@ 2021-02-01 16:24 Quirin Gylstorff
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 1/2] swupdate: Secure-boot fix paths Quirin Gylstorff
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file Quirin Gylstorff
0 siblings, 2 replies; 6+ messages in thread
From: Quirin Gylstorff @ 2021-02-01 16:24 UTC (permalink / raw)
To: Jan.Kiszka, cip-dev; +Cc: Quirin Gylstorff
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Use correct swu-description.tmpl and use own file for image-uuid
to avoid overwrite by Debian package `base-files`.
Quirin Gylstorff (2):
swupdate: Secure-boot fix paths
secure-boot: Move image-uuid to own file
classes/image_uuid.bbclass | 4 +---
recipes-core/images/secureboot.inc | 2 ++
recipes-core/images/swupdate.inc | 2 --
.../initramfs-config/files/initramfs.image_uuid.hook | 6 +++---
.../initramfs-config/files/secure-boot-debian-local-patch | 4 ++--
5 files changed, 8 insertions(+), 10 deletions(-)
--
2.20.1
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6156): https://lists.cip-project.org/g/cip-dev/message/6156
Mute This Topic: https://lists.cip-project.org/mt/80289767/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 6+ messages in thread
* [cip-dev][isar-cip-core][PATCH 1/2] swupdate: Secure-boot fix paths
2021-02-01 16:24 [cip-dev][isar-cip-core][PATCH 0/2] Secureboot fixes Quirin Gylstorff
@ 2021-02-01 16:24 ` Quirin Gylstorff
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file Quirin Gylstorff
1 sibling, 0 replies; 6+ messages in thread
From: Quirin Gylstorff @ 2021-02-01 16:24 UTC (permalink / raw)
To: Jan.Kiszka, cip-dev; +Cc: Quirin Gylstorff
[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
recipes-core/images/secureboot.inc | 2 ++
recipes-core/images/swupdate.inc | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/recipes-core/images/secureboot.inc b/recipes-core/images/secureboot.inc
index 3e284e0..f048497 100644
--- a/recipes-core/images/secureboot.inc
+++ b/recipes-core/images/secureboot.inc
@@ -9,6 +9,8 @@
# SPDX-License-Identifier: MIT
#
+FILESEXTRAPATHS_prepend := "${THISDIR}/files/secure-boot:"
+
EXTRACT_PARTITIONS = "img4"
ROOTFS_PARTITION_NAME="img4.gz"
diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
index a88ed14..6708a7e 100644
--- a/recipes-core/images/swupdate.inc
+++ b/recipes-core/images/swupdate.inc
@@ -9,8 +9,6 @@
# SPDX-License-Identifier: MIT
#
-FILESEXTRAPATHS_prepend := "${THISDIR}/files/secure-boot:"
-
EXTRACT_PARTITIONS = "img4"
ROOTFS_PARTITION_NAME="img4.gz"
--
2.20.1
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6158): https://lists.cip-project.org/g/cip-dev/message/6158
Mute This Topic: https://lists.cip-project.org/mt/80289769/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file
2021-02-01 16:24 [cip-dev][isar-cip-core][PATCH 0/2] Secureboot fixes Quirin Gylstorff
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 1/2] swupdate: Secure-boot fix paths Quirin Gylstorff
@ 2021-02-01 16:24 ` Quirin Gylstorff
2021-02-01 16:47 ` Jan Kiszka
1 sibling, 1 reply; 6+ messages in thread
From: Quirin Gylstorff @ 2021-02-01 16:24 UTC (permalink / raw)
To: Jan.Kiszka, cip-dev; +Cc: Quirin Gylstorff
[-- Attachment #1: Type: text/plain, Size: 2995 bytes --]
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
/etc/os-release is controlled by the Debian Package base-files
and will be silently overwritten if the package updates the file.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
classes/image_uuid.bbclass | 4 +---
.../initramfs-config/files/initramfs.image_uuid.hook | 6 +++---
.../initramfs-config/files/secure-boot-debian-local-patch | 4 ++--
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/classes/image_uuid.bbclass b/classes/image_uuid.bbclass
index 2813ed9..a0ab202 100644
--- a/classes/image_uuid.bbclass
+++ b/classes/image_uuid.bbclass
@@ -22,9 +22,7 @@ IMAGE_UUID ?= "${@generate_image_uuid(d)}"
do_generate_image_uuid[vardeps] += "IMAGE_UUID"
do_generate_image_uuid[depends] = "buildchroot-target:do_build"
do_generate_image_uuid() {
- sudo sed -i '/^IMAGE_UUID=.*/d' '${IMAGE_ROOTFS}/etc/os-release'
- echo "IMAGE_UUID=\"${IMAGE_UUID}\"" | \
- sudo tee -a '${IMAGE_ROOTFS}/etc/os-release'
+ sudo sh -c 'echo "IMAGE_UUID=\"${IMAGE_UUID}\"" > "${IMAGE_ROOTFS}/etc/secureboot-image-uuid"'
image_do_mounts
# update initramfs to add uuid
diff --git a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
index 910ce84..bf39abb 100644
--- a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
+++ b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
@@ -22,12 +22,12 @@ esac
. /usr/share/initramfs-tools/scripts/functions
. /usr/share/initramfs-tools/hook-functions
-if [ ! -e /etc/os-release ]; then
- echo "Warning: couldn't find /etc/os-release!"
+if [ ! -e /etc/secureboot-image-uuid ]; then
+ echo "Warning: couldn't find /etc/secureboot-image-uuid!"
exit 0
fi
-IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/os-release)
+IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/secureboot-image-uuid)
echo "${IMAGE_UUID}" > "${DESTDIR}/conf/image_uuid"
exit 0
\ No newline at end of file
diff --git a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
index cd2d271..82d325a 100644
--- a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
+++ b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
@@ -58,8 +58,8 @@
+ # Mount root
+ # shellcheck disable=SC2086
+ if mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then
-+ if [ -e "${rootmnt?}"/etc/os-release ]; then
-+ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/os-release | tr -d '"' )
++ if [ -e "${rootmnt?}"/etc/secureboot-image-uuid ]; then
++ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/secureboot-image-uuid | tr -d '"' )
+ if [ "${INITRAMFS_IMAGE_UUID}" = "${image_uuid}" ]; then
+ return 0
+ fi
--
2.20.1
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6157): https://lists.cip-project.org/g/cip-dev/message/6157
Mute This Topic: https://lists.cip-project.org/mt/80289768/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file Quirin Gylstorff
@ 2021-02-01 16:47 ` Jan Kiszka
2021-02-03 8:13 ` Quirin Gylstorff
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2021-02-01 16:47 UTC (permalink / raw)
To: Q. Gylstorff, cip-dev
[-- Attachment #1: Type: text/plain, Size: 3438 bytes --]
On 01.02.21 17:24, Q. Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> /etc/os-release is controlled by the Debian Package base-files
> and will be silently overwritten if the package updates the file.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> classes/image_uuid.bbclass | 4 +---
> .../initramfs-config/files/initramfs.image_uuid.hook | 6 +++---
> .../initramfs-config/files/secure-boot-debian-local-patch | 4 ++--
> 3 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/classes/image_uuid.bbclass b/classes/image_uuid.bbclass
> index 2813ed9..a0ab202 100644
> --- a/classes/image_uuid.bbclass
> +++ b/classes/image_uuid.bbclass
> @@ -22,9 +22,7 @@ IMAGE_UUID ?= "${@generate_image_uuid(d)}"
> do_generate_image_uuid[vardeps] += "IMAGE_UUID"
> do_generate_image_uuid[depends] = "buildchroot-target:do_build"
> do_generate_image_uuid() {
> - sudo sed -i '/^IMAGE_UUID=.*/d' '${IMAGE_ROOTFS}/etc/os-release'
> - echo "IMAGE_UUID=\"${IMAGE_UUID}\"" | \
> - sudo tee -a '${IMAGE_ROOTFS}/etc/os-release'
> + sudo sh -c 'echo "IMAGE_UUID=\"${IMAGE_UUID}\"" > "${IMAGE_ROOTFS}/etc/secureboot-image-uuid"'
> image_do_mounts
>
> # update initramfs to add uuid
> diff --git a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
> index 910ce84..bf39abb 100644
> --- a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
> +++ b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
> @@ -22,12 +22,12 @@ esac
> . /usr/share/initramfs-tools/scripts/functions
> . /usr/share/initramfs-tools/hook-functions
>
> -if [ ! -e /etc/os-release ]; then
> - echo "Warning: couldn't find /etc/os-release!"
> +if [ ! -e /etc/secureboot-image-uuid ]; then
> + echo "Warning: couldn't find /etc/secureboot-image-uuid!"
> exit 0
> fi
>
> -IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/os-release)
> +IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/secureboot-image-uuid)
> echo "${IMAGE_UUID}" > "${DESTDIR}/conf/image_uuid"
>
> exit 0
> \ No newline at end of file
> diff --git a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
> index cd2d271..82d325a 100644
> --- a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
> +++ b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
> @@ -58,8 +58,8 @@
> + # Mount root
> + # shellcheck disable=SC2086
> + if mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then
> -+ if [ -e "${rootmnt?}"/etc/os-release ]; then
> -+ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/os-release | tr -d '"' )
> ++ if [ -e "${rootmnt?}"/etc/secureboot-image-uuid ]; then
> ++ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/secureboot-image-uuid | tr -d '"' )
> + if [ "${INITRAMFS_IMAGE_UUID}" = "${image_uuid}" ]; then
> + return 0
> + fi
>
This one would work, though, if we fixed
https://groups.google.com/d/msgid/isar-users/67e1fac9-5af5-29aa-de57-9a0de0cdd165%40siemens.com
in Isar, right? Should we rather wait for that?
Applied patch 1 for now.
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6159): https://lists.cip-project.org/g/cip-dev/message/6159
Mute This Topic: https://lists.cip-project.org/mt/80289768/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file
2021-02-01 16:47 ` Jan Kiszka
@ 2021-02-03 8:13 ` Quirin Gylstorff
0 siblings, 0 replies; 6+ messages in thread
From: Quirin Gylstorff @ 2021-02-03 8:13 UTC (permalink / raw)
To: Jan Kiszka, cip-dev
[-- Attachment #1: Type: text/plain, Size: 3570 bytes --]
On 2/1/21 5:47 PM, Jan Kiszka wrote:
> On 01.02.21 17:24, Q. Gylstorff wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> /etc/os-release is controlled by the Debian Package base-files
>> and will be silently overwritten if the package updates the file.
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>> classes/image_uuid.bbclass | 4 +---
>> .../initramfs-config/files/initramfs.image_uuid.hook | 6 +++---
>> .../initramfs-config/files/secure-boot-debian-local-patch | 4 ++--
>> 3 files changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/classes/image_uuid.bbclass b/classes/image_uuid.bbclass
>> index 2813ed9..a0ab202 100644
>> --- a/classes/image_uuid.bbclass
>> +++ b/classes/image_uuid.bbclass
>> @@ -22,9 +22,7 @@ IMAGE_UUID ?= "${@generate_image_uuid(d)}"
>> do_generate_image_uuid[vardeps] += "IMAGE_UUID"
>> do_generate_image_uuid[depends] = "buildchroot-target:do_build"
>> do_generate_image_uuid() {
>> - sudo sed -i '/^IMAGE_UUID=.*/d' '${IMAGE_ROOTFS}/etc/os-release'
>> - echo "IMAGE_UUID=\"${IMAGE_UUID}\"" | \
>> - sudo tee -a '${IMAGE_ROOTFS}/etc/os-release'
>> + sudo sh -c 'echo "IMAGE_UUID=\"${IMAGE_UUID}\"" > "${IMAGE_ROOTFS}/etc/secureboot-image-uuid"'
>> image_do_mounts
>>
>> # update initramfs to add uuid
>> diff --git a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
>> index 910ce84..bf39abb 100644
>> --- a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
>> +++ b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook
>> @@ -22,12 +22,12 @@ esac
>> . /usr/share/initramfs-tools/scripts/functions
>> . /usr/share/initramfs-tools/hook-functions
>>
>> -if [ ! -e /etc/os-release ]; then
>> - echo "Warning: couldn't find /etc/os-release!"
>> +if [ ! -e /etc/secureboot-image-uuid ]; then
>> +
echo "Warning: couldn't find /etc/secureboot-image-uuid!"
>> exit 0
>> fi
>>
>> -IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/os-release)
>> +IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/secureboot-image-uuid)
>> echo "${IMAGE_UUID}" > "${DESTDIR}/conf/image_uuid"
>>
>> exit 0
>> \ No newline at end of file
>> diff --git a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
>> index cd2d271..82d325a 100644
>> --- a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
>> +++ b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch
>> @@ -58,8 +58,8 @@
>> + # Mount root
>> + # shellcheck disable=SC2086
>> + if mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then
>> -+ if [ -e "${rootmnt?}"/etc/os-release ]; then
>> -+ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/os-release | tr -d '"' )
>> ++ if [ -e "${rootmnt?}"/etc/secureboot-image-uuid ]; then
>> ++ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/secureboot-image-uuid | tr -d '"' )
>> + if [ "${INITRAMFS_IMAGE_UUID}" = "${image_uuid}" ]; then
>> + return 0
>> + fi
>>
>
> This one would work, though, if we fixed
> https://groups.google.com/d/msgid/isar-users/67e1fac9-5af5-29aa-de57-9a0de0cdd165%40siemens.com
> in Isar, right? Should we rather wait for that?
At the moment I would say yes, wait for it.
Quirin
>
> Applied patch 1 for now.
>
> Jan
>
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6160): https://lists.cip-project.org/g/cip-dev/message/6160
Mute This Topic: https://lists.cip-project.org/mt/80289768/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 6+ messages in thread
* [cip-dev] [isar-cip-core][PATCH 0/2] Secureboot fixes
@ 2020-11-25 8:55 Quirin Gylstorff
0 siblings, 0 replies; 6+ messages in thread
From: Quirin Gylstorff @ 2020-11-25 8:55 UTC (permalink / raw)
To: cip-dev, Jan.Kiszka; +Cc: Quirin Gylstorff
[-- Attachment #1: Type: text/plain, Size: 614 bytes --]
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Adapt OVMF binaries to new upstream names.
Repeat scan for rootfs until udev finished populating /dev or a timeout occurs.
Build at:
https://gitlab.com/Quirin.Gy/isar-cip-core/-/pipelines/220660576
Quirin Gylstorff (2):
start-qemu.sh: Change OVMF binary names
Secureboot: Wait until udev populates /dev
doc/README.secureboot.md | 12 +-
.../files/secure-boot-debian-local-patch | 104 +++++++++++-------
start-qemu.sh | 4 +-
3 files changed, 72 insertions(+), 48 deletions(-)
--
2.20.1
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5875): https://lists.cip-project.org/g/cip-dev/message/5875
Mute This Topic: https://lists.cip-project.org/mt/78496225/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-03 8:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 16:24 [cip-dev][isar-cip-core][PATCH 0/2] Secureboot fixes Quirin Gylstorff
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 1/2] swupdate: Secure-boot fix paths Quirin Gylstorff
2021-02-01 16:24 ` [cip-dev][isar-cip-core][PATCH 2/2] secure-boot: Move image-uuid to own file Quirin Gylstorff
2021-02-01 16:47 ` Jan Kiszka
2021-02-03 8:13 ` Quirin Gylstorff
-- strict thread matches above, loose matches on Subject: below --
2020-11-25 8:55 [cip-dev] [isar-cip-core][PATCH 0/2] Secureboot fixes Quirin Gylstorff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).