summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--locale/en_US.sh1
-rw-r--r--src/profile.sh14
-rw-r--r--src/profile/proteanos.sh12
3 files changed, 27 insertions, 0 deletions
diff --git a/locale/en_US.sh b/locale/en_US.sh
index 056e72b..1cd4695 100644
--- a/locale/en_US.sh
+++ b/locale/en_US.sh
@@ -115,6 +115,7 @@ msg_prokit_cmd_mkinitramfs_kernel_not_found='No Linux image found'
# src/profile.sh
msg_prokit_profile_not_found='Profile "%s" not found'
+msg_prokit_profile_not_detected='No installed system found at "%s"'
# src/package.sh
msg_prokit_package_format_unknown='Unable to detect package format'
diff --git a/src/profile.sh b/src/profile.sh
index 9bbd9ce..44e3022 100644
--- a/src/profile.sh
+++ b/src/profile.sh
@@ -50,6 +50,20 @@ profile_set()
return 0
}
+profile_detect()
+{
+ local root="${1}"
+
+ for prof in ${profiles}; do
+ if "prof_${prof}_detect_root" "${root}"; then
+ profile="${prof}"
+ return 0
+ fi
+ done
+
+ error 1 "$(get_msg 'profile_not_detected')" "${root}"
+}
+
profile_normalize_suite()
{
local suite="${1}"
diff --git a/src/profile/proteanos.sh b/src/profile/proteanos.sh
index 46c0e69..ef578f0 100644
--- a/src/profile/proteanos.sh
+++ b/src/profile/proteanos.sh
@@ -37,6 +37,18 @@ start()
}
'
+prof_proteanos_detect_root()
+{
+ local root="${1}"
+
+ if grep "^ID='proteanos'\$" "${root}/etc/os-release" >/dev/null 2>&1
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
prof_proteanos_normalize_suite()
{
local suite="${1}"