From d7bcf0b7bdbe4cc9883050c223c7412667cc5fd8 Mon Sep 17 00:00:00 2001 From: Yury MonZon Date: Wed, 1 Jul 2026 16:13:24 +0200 Subject: [PATCH] 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. --- overlays/configs/update-motd.d/00-flipperone | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/overlays/configs/update-motd.d/00-flipperone b/overlays/configs/update-motd.d/00-flipperone index f122f30..d783703 100755 --- a/overlays/configs/update-motd.d/00-flipperone +++ b/overlays/configs/update-motd.d/00-flipperone @@ -15,6 +15,12 @@ build_git=${BUILD_GIT:-unknown} total_mem=$(awk '/MemTotal/ {printf "%.1f GB", $2/1024/1024}' /proc/meminfo) +# Currently booted profile = the btrfs subvolume mounted as root (@Desktop, +# @Router, @TV-Media-Box, @Minimal). "/@Foo" -> "Foo"; non-subvolume -> unknown. +profile=$(findmnt -nro FSROOT / 2>/dev/null) +profile=${profile#/} +[ -n "$profile" ] && [ "$profile" != "/" ] || profile=unknown + # Generate MOTD cat <