Skip to content

Commit e8ff81a

Browse files
committed
tui: add dts-extensions.sh
Signed-off-by: Michał Iwanicki <[email protected]>
1 parent 0e4c693 commit e8ff81a

File tree

15 files changed

+22
-1
lines changed

15 files changed

+22
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ install:
2727

2828
install -d $(DESTDIR)$(SYSCONFDIR)/profile.d $(DESTDIR)$(SYSCONFDIR)/dts
2929
install -m 0755 dts-profile.sh $(DESTDIR)$(SYSCONFDIR)/profile.d
30-
install -m 0644 tui/dts-tui.yaml $(DESTDIR)$(SYSCONFDIR)/dts/dts-tui.yaml
30+
install -m 0644 tui/*.yaml tui/*.yml $(DESTDIR)$(SYSCONFDIR)/dts/

tui/header.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
header:
3+
title: " Dasharo Tools Suite Script ${DTS_VERSION} "
4+
subtitle: " (c) Dasharo <[email protected]> "
5+
link: "https://github.com/Dasharo/dasharo-issues"

tui/tui_callbacks/dasharo-firmware.sh

100644100755
File mode changed.

tui/tui_callbacks/dpp-keys.sh

100644100755
File mode changed.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# shellcheck source=../../include/dts-environment.sh
4+
source "$DTS_ENV"
5+
6+
extensions_yaml="/tmp/extensions.yaml"
7+
cat "${CONF_DIR}/header.yaml" >"${extensions_yaml}"
8+
yq -i '. += {"menu": [], "footer": [{"key": "Q", "label": "go back"}]}' "${extensions_yaml}"
9+
10+
while IFS=$'\t' read -r file_name file_position _; do
11+
export file_name file_position callback
12+
callback="${DPP_PACKAGES_SCRIPTS_PATH}/${file_name}"
13+
yq -i '.menu += {"key": strenv(file_position), "label": strenv(file_name), "callback": strenv(callback)}' "$extensions_yaml"
14+
done < <(yq -p=json '.[] | [.file_name, .file_menu_position] | @tsv' "${DPP_SUBMENU_JSON}")
15+
16+
tui_run "${extensions_yaml}"

tui/tui_callbacks/fuse.sh

100644100755
File mode changed.

tui/tui_callbacks/hcl-report.sh

100644100755
File mode changed.

tui/tui_callbacks/poweroff.sh

100644100755
File mode changed.

tui/tui_callbacks/reboot.sh

100644100755
File mode changed.

tui/tui_callbacks/restore-firmware.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)