From e355fb13160dd81e681aaca78f29be1172b05a7b Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 13 Jan 2020 16:48:00 -0700 Subject: [PATCH] Use UUIDs instead of labels in build-ufd * Addresses issue #138 --- scripts/wk/kit/ufd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/wk/kit/ufd.py b/scripts/wk/kit/ufd.py index f432a3f3..dcbd572b 100644 --- a/scripts/wk/kit/ufd.py +++ b/scripts/wk/kit/ufd.py @@ -15,6 +15,7 @@ from wk import io, log, std from wk.cfg.main import KIT_NAME_FULL, KIT_NAME_SHORT from wk.cfg.ufd import BOOT_ENTRIES, BOOT_FILES, ITEMS, ITEMS_HIDDEN, SOURCES from wk.exe import run_program +from wk.hw.obj import Disk from wk.os import linux @@ -391,6 +392,8 @@ def show_selections(args, sources, ufd_dev, ufd_sources): def update_boot_entries(): """Update boot files for UFD usage""" configs = [] + ufd = Disk('/mnt/UFD') + uuid = ufd.details.get('uuid') # Find config files for c_path, c_ext in BOOT_FILES.items(): @@ -399,12 +402,12 @@ def update_boot_entries(): if item.name.lower().endswith(c_ext.lower()): configs.append(item.path) - # Update Linux labels + # Use UUID instead of label cmd = [ 'sed', '--in-place', '--regexp-extended', - f's/{ISO_LABEL}/{UFD_LABEL}/', + f's#archisolabel={ISO_LABEL}#archisodevice=/dev/disk/by-uuid/{uuid}#', *configs, ] run_program(cmd)