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,51 @@
#!/bin/sh
# Nico Schottelius
# Build release tar
# Date: Sat Oct 15 21:38:29 CEST 2005
# Last Changed: Fr Okt 28 01:24:58 CEST 2005
if [ $# -ne 2 ]; then
echo "This is a maintainer-only script to release cinit"
echo $(basename $0): source-dir version
exit 1
fi
cat << eof
Erinnerung:
- Version in conf/version angepasst?
- CHANGES angepasst?
Nein? Strg+C bitte...
eof
read a
DIR=$1
VERSION=$2
OUT_NAME=cinit-${VERSION}.tar.bz2
D_HOST=home.schottelius.org
D_BASE=www/org/schottelius/unix/www/cinit
D_DIR=${D_BASE}/archives/
D_SOURCE=${D_BASE}/browse_source/
LINK=current
if [ ! -d "$DIR" ]; then
echo "$DIR is not a directory"
exit 1
fi
( cd "$DIR" && make dist ) || exit 1
echo "Creating bzip2 compressed tar"
tar cj -X $DIR/.exclude -f "$OUT_NAME" "$DIR"
chmod 0644 "$OUT_NAME"
echo "Transfering to $D_HOST"
scp "$OUT_NAME" "$D_HOST:$D_DIR"
echo "Extracting to $D_SOURCE"
ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE"
echo "Correcting paranoid permissions"
ssh "$D_HOST" "find \"$D_SOURCE/$DIR\" -type f -exec chmod 0644 {} \\;"
ssh "$D_HOST" "find \"$D_SOURCE/$DIR\" -type d -exec chmod 0755 {} \\;"
ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$DIR\" \"$LINK\""
echo "Please do not forget to update the website..."

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}"

View file

@ -0,0 +1 @@
Only to be used by Nico Schottelius.

View file

@ -0,0 +1,15 @@
#!/bin/sh
# yah - yet another hack
host="$1"
hier=$(dirname $0)
$hier/compile_test.sh "$1"
if [ $? -ne 0 ]; then
echo "aborting, did not compile on $1"
exit 1
fi
ssh "${host}" './cinit/src/cinit & (sleep 30; kill -9 $(pgrep cinit))'

View file

@ -0,0 +1,24 @@
# just a hack
dir=$(dirname $0)
sys=$(uname -s)
sys_small=$(echo $sys | tr '[A-Z]' '[a-z]')
case $(uname -s) in
NetBSD|OpenBSD)
make=gmake
;;
*)
make=make
;;
esac
cd "${dir}/../../"
echo $sys_small > conf/os
# automatically called by make..
#./bin/cinit.configure.os
cd "src"
$make clean
$make cinit

View file

@ -0,0 +1,8 @@
#!/bin/sh
# yah - yet another hack
host="$1"
what=$(dirname $0)/../../
rsync --exclude .git --exclude \*.o -av "${what}" "${host}:cinit"
ssh "${host}" "./cinit/scripts/internal/compile_local.sh"

View file

@ -0,0 +1,18 @@
hier=$(dirname $0)
set -e
${hier}/../cinit.install.standard.dirs
cat > /etc/cinit/svc/init/on << eof
#!/bin/sh
echo test1
sleep 4
echo test2 - \$@
eof
chmod 0755 /etc/cinit/svc/init/on
cat > /etc/cinit/svc/init/on.params << eof
es
scheint
zu
gehen
eof

View file

@ -0,0 +1,24 @@
#!/bin/sh
src="$(dirname $0)/../../"
src_abs=$(cd "$src" && pwd -P)
for commit in $( git log --pretty=short | awk '/^commit/ { print $2 }'); do
set -e
cd "$src_abs"
temp=$(mktemp -d /tmp/cinit.XXXXXXXXXX)
git-archive --format=tar "$commit" | ( cd "$temp"; tar x )
cd "${temp}/src"
set +e
make clean && make cinit && ./cinit
if [ "$?" -eq 0 ]; then
echo "Commit $commit is ok"
exit 0
fi
echo "Broken $commit"
sleep 1
set -e
rm -rf "$temp"
done
exit 1

View file

@ -0,0 +1,12 @@
#!/bin/sh
# yah
hosts="penrose.bsdprojects.net bot.unixkiste.org suckz.eu"
set -e
for host in $hosts; do
echo "$1 on $host"
"$1" "$host" | sed "s/^/${host}: /"
echo "==> Finished $host"
done

View file

@ -0,0 +1 @@
valgrind -v --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes --leak-resolution=high ./cinit

View file

@ -0,0 +1,18 @@
#!/bin/sh
# Nico Schottelius
# 2006-12-08
# Report compile success
#
echo "cinit compile success report"
echo "----------------------------"
"$(dirname $0)/cinit.mkheader"
echo "----------------------------"
uname -a
echo "----------------------------"
. "$(dirname $0)/cinit.read-conf"
echo '$CC'
"$CC" -v
echo "----------------------------"
echo -n "Size: "
ls -l "$(dirname $0)/../src/cinit"