import cinit from unix.schottelius.org

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-09-16 12:53:45 +02:00
commit 423ba10303
13396 changed files with 269468 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/bin/sh
# Nico Schottelius
# cinit: build environment to be used in scripts
# * Should be sourced by using scripts
# 2006-10-26
#
. $(dirname $0)/cinit.read-conf
export BASEDIR=${DESTDIR}${CINIT_DIR}
export SERVICES=${BASEDIR}/${SVCDIR}
export CONFIG=${BASEDIR}/${CONFDIR}

View file

@ -0,0 +1,17 @@
#!/bin/sh
# Nico Schottelius
# cinit: read configuration into variables
# Date: 2005-05-24 (Last Changed: 2005-08-08)
# try environment first
if [ "$CINIT_CONF_DIR" ]; then
CONFDIR=$CINIT_CONF_DIR
elif [ -d $(dirname $0)/../conf/ ]; then
CONFDIR=$(dirname $0)/../conf/
else
echo 'Did not find cinit configuration!' >&2
echo "Please set the variable CINIT_CONF_DIR" >&2
exit 1
fi
echo $CONFDIR

View file

@ -0,0 +1,13 @@
#!/bin/sh
# Nico Schottelius
# cinit: install standard sub-configuration directories
# Date: 2005-08-07
#
. $(dirname $0)/cinit.build-env
for svc in $SERVICE_CATEGORIES; do
"$INSTALL_PROG" "$INSTALL_DIRECTORY" "${SERVICES}/${svc}"
done
exit 0

View file

@ -0,0 +1,32 @@
#!/bin/sh
# Nico Schottelius
# cinit: create header file
#
CONFS=$($(dirname $0)/cinit.get-confdir)/../conf/*
echo "/* Warning: Autogenerated by $0, do not edit. */"
for conf in $CONFS; do
NAME="$(basename $conf | tr a-z A-Z)"
value=$(head -n 1 $conf)
# check if numeric: no quotes needed
is_numeric=$(echo $value | awk '/^((0[xX])[0-9a-fA-F]+)|([0-9]+)$/ { print }')
is_string="$(echo $value | grep '^"')"
#
# Check for quote type
#
if [ ! "$is_numeric" -a ! "$is_string" ]; then
one_char=$(echo -n $value | wc -c)
if [ "$one_char" -eq 1 ]; then
value="'$value'"
else
# is a string
value="\"$value\""
fi
fi
echo "#define" "$NAME" "$value"
done

View file

@ -0,0 +1,18 @@
#!/bin/sh
# Nico Schottelius
# cinit: read configuration into variables
# ~ 2005
#
CONFS=$($(dirname $0)/cinit.get-confdir)/*
set -e
for conf in $CONFS; do
NAME="$(basename $conf | tr a-z A-Z)"
if eval test -z \$$NAME; then
eval $NAME=\"$(head -n 1 $conf)\"
eval export $NAME
fi
# eval echo $NAME = \$$NAME
done

View file

@ -0,0 +1,15 @@
#!/bin/sh
# Nico Schottelius
# 2006-10-23
# cLinux/cinit
. $(dirname $0)/cinit.build-env
set -e
mkdir -p "${BASEDIR}"
mkdir -p "${SERVICES}"
mkdir -p "${SERVICES}/${C_INIT}"
mkdir -p "${CONFIG}"