Skip to content

Commit

Permalink
wip: use commit sha for uuid
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Langowski <pawel.langowski@3mdeb.com>
  • Loading branch information
PLangowski committed Feb 21, 2025
1 parent 8e6f8b6 commit d66533a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions meta-dts-distro/recipes-dts/images/dts-base-image.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ IMAGE_INSTALL:append = " \
lshw \
"

LAYER_COMMIT_SHA = "${@'$(cd ${LAYERDIR} && git rev-parse HEAD)'}"

ROOT_UUID="${@'$(echo ${LAYER_COMMIT_SHA} | sha256sum | cut -c1-8)-$(echo ${LAYER_COMMIT_SHA} | sha256sum | cut -c9-12)-4$(echo ${LAYER_COMMIT_SHA} | sha256sum | cut -c13-15)-$(echo ${LAYER_COMMIT_SHA} | sha256sum | cut -c16-19)-$(echo ${LAYER_COMMIT_SHA} | sha256sum | cut -c20-31)'}"
BOOT_UUID="${@'$(echo "boot-${LAYER_COMMIT_SHA}" | sha256sum | cut -c1-8)-$(echo "boot-${LAYER_COMMIT_SHA}" | sha256sum | cut -c9-12)-4$(echo "boot-${LAYER_COMMIT_SHA}" | sha256sum | cut -c13-15)-$(echo "boot-${LAYER_COMMIT_SHA}" | sha256sum | cut -c16-19)-$(echo "boot-${LAYER_COMMIT_SHA}" | sha256sum | cut -c20-31)'}"

WICVARS += "ROOT_UUID BOOT_UUID"

# Enable local auto-login of the root user (local = serial port and
# virtual console)
DTS_LOCAL_GETTY ?= " \
Expand Down
4 changes: 2 additions & 2 deletions meta-dts-distro/wic/usb-stick-dts.wks.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bootloader --timeout=0 --append=" rootwait"

part /boot --source bootimg-biosplusefi --sourceparams="loader=grub-efi" --ondisk sda --label dts-boot --align 1024 --use-uuid --active --system-id 0xef
part / --source rootfs --fstype=ext4 --ondisk sda --label dts-root --align 1024 --use-uuid --fixed-size 1024
part /boot --source bootimg-biosplusefi --sourceparams="loader=grub-efi" --ondisk sda --label dts-boot --align 1024 --uuid ${BOOT_UUID} --active --system-id 0xef
part / --source rootfs --fstype=ext4 --ondisk sda --label dts-root --align 1024 --uuid ${ROOT_UUID} --fixed-size 1024

0 comments on commit d66533a

Please sign in to comment.