diff options
| author | Frieder Paape <frieder@konvera.io> | 2023-06-05 09:00:33 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-07-12 05:11:38 -1000 |
| commit | b954f15d660f6faff59960ebb660d8d8b7b57e64 (patch) | |
| tree | 86df497484fb7c8840c3628862be348da83c101d /meta/classes | |
| parent | 6646aadd71fdf473ff242abee385c0e5297d1513 (diff) | |
| download | poky-b954f15d660f6faff59960ebb660d8d8b7b57e64.tar.gz | |
image_types: Fix reproducible builds for initramfs and UKI img
I've encountered issues reproducing initramfs and UKI image builds,
which will be fixed with this patch.
1. initramfs
There's a symbolic link to /sbin/init, which is appended to the cpio archive after creation.
The links timestamp needs to be static and the cpio append command needs the '--reproducible' flag to produce deterministic outcomes.
2. Unified Kernel Image
'--preserve-dates' is required for a static 'Time/Date' entry.
I've added '--enable-deterministic-archives' although in my case this
didn't change anything.
(From OE-Core rev: 0d8890f7c1fbea5036acefa3031dcd442b316725)
Signed-off-by: Frieder Paape <frieder@konvera.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit fd027729bafb4e085ba0949e38e724f3a8cad102)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/image_types.bbclass | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 79081d9f98..9d5f8c68a4 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass | |||
| @@ -130,10 +130,11 @@ IMAGE_CMD:cpio () { | |||
| 130 | if [ ! -L ${IMAGE_ROOTFS}/init ] && [ ! -e ${IMAGE_ROOTFS}/init ]; then | 130 | if [ ! -L ${IMAGE_ROOTFS}/init ] && [ ! -e ${IMAGE_ROOTFS}/init ]; then |
| 131 | if [ -L ${IMAGE_ROOTFS}/sbin/init ] || [ -e ${IMAGE_ROOTFS}/sbin/init ]; then | 131 | if [ -L ${IMAGE_ROOTFS}/sbin/init ] || [ -e ${IMAGE_ROOTFS}/sbin/init ]; then |
| 132 | ln -sf /sbin/init ${WORKDIR}/cpio_append/init | 132 | ln -sf /sbin/init ${WORKDIR}/cpio_append/init |
| 133 | touch -h -r ${IMAGE_ROOTFS}/sbin/init ${WORKDIR}/cpio_append/init | ||
| 133 | else | 134 | else |
| 134 | touch ${WORKDIR}/cpio_append/init | 135 | touch -r ${IMAGE_ROOTFS} ${WORKDIR}/cpio_append/init |
| 135 | fi | 136 | fi |
| 136 | (cd ${WORKDIR}/cpio_append && echo ./init | cpio -oA -H newc -F ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio) | 137 | (cd ${WORKDIR}/cpio_append && echo ./init | cpio --reproducible -oA -H newc -F ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio) |
| 137 | fi | 138 | fi |
| 138 | fi | 139 | fi |
| 139 | } | 140 | } |
