From 53a09fa9d57bad1b074d0f72a302ffc4517d4b0f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 7 Aug 2014 17:22:57 +0200 Subject: Added "core" services that are run from scripts on stage 1. - /etc/runit/functions: contains common functions to be used in core-services. - /etc/runit/core-services: directory containing one-time tasks run in stage 1. - Added LXC container detection to disable some core services. This accidentally also fixes the issue of unicode not working in the active TTY from stage 1. --- functions | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 functions (limited to 'functions') diff --git a/functions b/functions new file mode 100755 index 0000000..65d0b78 --- /dev/null +++ b/functions @@ -0,0 +1,35 @@ +# *-*-shell-*-* + +msg() { + # bold + printf "\033[1m=> $@\033[m" +} + +msg_ok() { + # bold/green + printf "\033[1m\033[32m OK\033[m\n" +} + +msg_error() { + # bold/red + printf "\033[1m\033[31mERROR: $@\033[m\n" +} + +msg_warn() { + # bold/yellow + printf "\033[1m\033[33mWARNING: $@\033[m" +} + +emergency_shell() { + echo + echo "Cannot continue due to errors above, starting emergency shell." + echo "When ready type exit to continue booting." + /bin/sh -l +} + +detect_virt() { + # Detect LXC containers + if grep -q lxc /proc/self/environ >/dev/null; then + export VIRTUALIZATION=1 + fi +} -- cgit 1.4.1