Skip to content

Commit d7bcf0b

Browse files
committed
Show booted profile name in MOTD
Derive the active profile from the btrfs subvolume mounted as root (@desktop, @router, @TV-Media-Box, @minimal) and show it in the MOTD, so it is obvious which profile a session booted into.
1 parent 396bc93 commit d7bcf0b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

overlays/configs/update-motd.d/00-flipperone

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ build_git=${BUILD_GIT:-unknown}
1515

1616
total_mem=$(awk '/MemTotal/ {printf "%.1f GB", $2/1024/1024}' /proc/meminfo)
1717

18+
# Currently booted profile = the btrfs subvolume mounted as root (@Desktop,
19+
# @Router, @TV-Media-Box, @Minimal). "/@Foo" -> "Foo"; non-subvolume -> unknown.
20+
profile=$(findmnt -nro FSROOT / 2>/dev/null)
21+
profile=${profile#/}
22+
[ -n "$profile" ] && [ "$profile" != "/" ] || profile=unknown
23+
1824
# Generate MOTD
1925
cat <<EOF
2026
2127
Welcome to FlipperOne
2228
2329
Git: $build_git
2430
Board: $board
31+
Profile: $profile
2532
CPU Serial: $serial
2633
Memory: $total_mem
2734
Build ID: $build_id

0 commit comments

Comments
 (0)