Skip to content

Commit

Permalink
Use commit SHA for partition UUIDs
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 1fc2090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions meta-dts-distro/conf/distro/dts-distro.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ ROOT_PASSWORD = "jlz9IbDJscvTcTjpDkk1xVoPZnxIm1K5"
WKS_FILES = "usb-stick-dts.wks.in"
IMAGE_FSTYPES = "cpio.gz wic.gz wic.bmap iso"

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)'}"

# installing GRUB in EFI/DTS helps in adding custom label in Boot Menu when
# Dasharo firmware is installed
IMAGE_EFI_BOOT_FILES += "grub-efi-bootx64.efi;EFI/DTS/grubx64.efi"
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 1fc2090

Please sign in to comment.