summaryrefslogtreecommitdiff
path: root/configs/default/default-config/etc/archiso
diff options
context:
space:
mode:
Diffstat (limited to 'configs/default/default-config/etc/archiso')
-rw-r--r--configs/default/default-config/etc/archiso/functions12
-rw-r--r--configs/default/default-config/etc/archiso/getshell9
2 files changed, 21 insertions, 0 deletions
diff --git a/configs/default/default-config/etc/archiso/functions b/configs/default/default-config/etc/archiso/functions
new file mode 100644
index 0000000..fdd48f4
--- /dev/null
+++ b/configs/default/default-config/etc/archiso/functions
@@ -0,0 +1,12 @@
+# vim: set ft=sh:
+
+cmdline_param ()
+{
+ for param in ${CMDLINE}; do
+ case "${param}" in
+ $1=*) echo "${param##*=}"; return ;;
+ *) continue ;;
+ esac
+ done
+ [ -n "${2}" ] && echo "${2}"
+}
diff --git a/configs/default/default-config/etc/archiso/getshell b/configs/default/default-config/etc/archiso/getshell
new file mode 100644
index 0000000..a6f8775
--- /dev/null
+++ b/configs/default/default-config/etc/archiso/getshell
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /etc/archiso/functions
+
+shell="$(cmdline_param shell)"
+[ -n "${shell}" ] && shell="/bin/bash"
+[ ! -e "${shell}" ] && shell="/bin/sh"
+
+exec ${shell}