Merge branch 'project-overhaul' into dev
This commit is contained in:
commit
7b77946afe
1 changed files with 17 additions and 3 deletions
|
|
@ -15,7 +15,6 @@ from wk import io, log, std
|
||||||
from wk.cfg.main import KIT_NAME_FULL, KIT_NAME_SHORT
|
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.cfg.ufd import BOOT_ENTRIES, BOOT_FILES, ITEMS, ITEMS_HIDDEN, SOURCES
|
||||||
from wk.exe import run_program
|
from wk.exe import run_program
|
||||||
from wk.hw.obj import Disk
|
|
||||||
from wk.os import linux
|
from wk.os import linux
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -219,6 +218,22 @@ def find_first_partition(dev_path):
|
||||||
return part_path
|
return part_path
|
||||||
|
|
||||||
|
|
||||||
|
def get_uuid(path):
|
||||||
|
"""Get filesystem UUID via findmnt, returns str."""
|
||||||
|
cmd = [
|
||||||
|
'findmnt',
|
||||||
|
'--noheadings',
|
||||||
|
'--target', path,
|
||||||
|
'--output', 'uuid'
|
||||||
|
]
|
||||||
|
|
||||||
|
# Run findmnt
|
||||||
|
proc = run_program(cmd, check=False)
|
||||||
|
|
||||||
|
# Done
|
||||||
|
return proc.stdout.strip()
|
||||||
|
|
||||||
|
|
||||||
def hide_items(ufd_dev, items):
|
def hide_items(ufd_dev, items):
|
||||||
"""Set FAT32 hidden flag for items."""
|
"""Set FAT32 hidden flag for items."""
|
||||||
first_partition = find_first_partition(ufd_dev)
|
first_partition = find_first_partition(ufd_dev)
|
||||||
|
|
@ -392,8 +407,7 @@ def show_selections(args, sources, ufd_dev, ufd_sources):
|
||||||
def update_boot_entries():
|
def update_boot_entries():
|
||||||
"""Update boot files for UFD usage"""
|
"""Update boot files for UFD usage"""
|
||||||
configs = []
|
configs = []
|
||||||
ufd = Disk('/mnt/UFD')
|
uuid = get_uuid('/mnt/UFD')
|
||||||
uuid = ufd.details.get('uuid')
|
|
||||||
|
|
||||||
# Find config files
|
# Find config files
|
||||||
for c_path, c_ext in BOOT_FILES.items():
|
for c_path, c_ext in BOOT_FILES.items():
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue