summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-19 13:57:17 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-19 13:57:17 (EDT)
commit9eb57210dca480ed851e7f6a988e04438c15e604 (patch)
tree364885eade2f0207850e9f83c3b16c2ed926b731
parent6073bda761d549751a5f305acc1d1429d176f747 (diff)
profile: Generate abstraction layer at run time
-rw-r--r--src/profile.sh148
1 files changed, 7 insertions, 141 deletions
diff --git a/src/profile.sh b/src/profile.sh
index 5cfe5c4..b5e760e 100644
--- a/src/profile.sh
+++ b/src/profile.sh
@@ -68,144 +68,10 @@ profile_detect()
return 1
}
-profile_normalize_suite()
-{
- local suite="${1}"
-
- "prof_${profile}_normalize_suite" "${suite}"
-}
-
-profile_detect_arch()
-{
- "prof_${profile}_detect_arch"
-}
-
-profile_default_plat()
-{
- "prof_${profile}_default_plat"
-}
-
-profile_select_mirror()
-{
- "prof_${profile}_select_mirror"
-}
-
-profile_validate_archplat()
-{
- local mirror="${1}"
- local arch="${2}"
- local plat="${3}"
- local suite="${4}"
-
- "prof_${profile}_validate_archplat" "${mirror}" "${arch}" "${plat}" \
- "${suite}"
-}
-
-profile_feeds()
-{
- local mirror="${1}"
- local arch="${2}"
- local plat="${3}"
- local suite="${4}"
-
- "prof_${profile}_feeds" "${mirror}" "${arch}" "${plat}" "${suite}"
-}
-
-profile_get_cert_url()
-{
- local mirror="${1}"
-
- "prof_${profile}_get_cert_url" "${mirror}"
-}
-
-profile_get_root_key()
-{
- "prof_${profile}_get_root_key"
-}
-
-profile_dep_fields()
-{
- "prof_${profile}_dep_fields"
-}
-
-profile_include_pkg()
-{
- local name="${1}"
- local value="${2}"
-
- "prof_${profile}_include_pkg" "${name}" "${value}"
-}
-
-profile_get_fstab()
-{
- local arch="${1}"
- local plat="${2}"
-
- "prof_${profile}_get_fstab" "${arch}" "${plat}"
-}
-
-profile_file_systems_mounted()
-{
- local root="${1}"
- local arch="${1}"
- local plat="${2}"
-
- "prof_${profile}_file_systems_mounted" "${root}" "${arch}" "${plat}"
-}
-
-profile_bind_mount()
-{
- local arch="${1}"
- local plat="${2}"
- local olddir="${3}"
- local newdir="${4}"
-
- "prof_${profile}_bind_mount" "${arch}" "${plat}" \
- "${olddir}" "${newdir}"
-}
-
-profile_bind_umount()
-{
- local arch="${1}"
- local plat="${2}"
- local olddir="${3}"
- local newdir="${4}"
-
- "prof_${profile}_bind_umount" "${arch}" "${plat}" \
- "${olddir}" "${newdir}"
-}
-
-profile_configure_system_native()
-{
- local root="${1}"
- local arch="${2}"
- local plat="${3}"
-
- "prof_${profile}_configure_system_native" "${root}" "${arch}" "${plat}"
-}
-
-profile_configure_system_foreign()
-{
- local root="${1}"
- local arch="${2}"
- local plat="${3}"
-
- "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}"
-}
-
-profile_make_initramfs()
-{
- local arch="${1}"
- local plat="${2}"
-
- "prof_${profile}_make_initramfs" "${arch}" "${plat}"
-}
+for func in normalize_suite detect_arch default_plat select_mirror \
+ validate_archplat feeds get_cert_url get_root_key dep_fields \
+ include_pkg get_fstab file_systems_mounted bind_mount \
+ bind_umount configure_system_native configure_system_foreign \
+ find_kernel make_initramfs; do
+ eval "profile_${func}() { \"prof_\${profile}_${func}\" \"\${@}\"; }"
+done