summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-01-15 18:02:16 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-01-15 18:02:16 (EST)
commitafac52a2827ef57dd42db321983d5b604221b9ce (patch)
treee8a7615fe6b921e18262e1847852912dc92e1ca2
parent8be3dfebfff85fb6ce7f04bee60a30e2d85485e0 (diff)
profile_find_kernel(): New function
-rw-r--r--src/profile.sh9
-rw-r--r--src/profile/proteanos.sh22
2 files changed, 30 insertions, 1 deletions
diff --git a/src/profile.sh b/src/profile.sh
index 607c1cc..08203d1 100644
--- a/src/profile.sh
+++ b/src/profile.sh
@@ -162,3 +162,12 @@ profile_configure_system_foreign()
"prof_${profile}_configure_system_foreign" "${root}" "${arch}" "${plat}"
}
+
+profile_find_kernel()
+{
+ local root="${1}"
+ local arch="${2}"
+ local plat="${3}"
+
+ "prof_${profile}_find_kernel" "${root}" "${arch}" "${plat}"
+}
diff --git a/src/profile/proteanos.sh b/src/profile/proteanos.sh
index 1936f88..69771a8 100644
--- a/src/profile/proteanos.sh
+++ b/src/profile/proteanos.sh
@@ -1,6 +1,6 @@
# ProteanOS architecture detection and feeds lists.
#
-# Copyright (C) 2013-2015 Patrick "P. J." McDermott
+# Copyright (C) 2013-2016 Patrick "P. J." McDermott
#
# This file is part of the ProteanOS Development Kit.
#
@@ -251,6 +251,26 @@ prof_proteanos_configure_system_foreign()
'root:x:0:\n' >"${root}/etc/group"
}
+prof_proteanos_find_kernel()
+{
+ local root="${1}"
+ local arch="${2}"
+ local plat="${3}"
+ local kernel=
+
+ case "${arch}" in
+ *-linux-*)
+ for kernel in vmlinuz; do
+ if [ -e "${root}/boot/${kernel}" ]; then
+ printf '%s' "/boot/${kernel}"
+ return 0
+ fi
+ done
+ ;;
+ esac
+ return 1
+}
+
prof_proteanos_register()
{
register_profile 'proteanos'