add cinit-0.3pre15

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-09-23 08:01:33 +02:00
commit 440caeb555
1013 changed files with 99995 additions and 0 deletions

View file

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

View file

@ -0,0 +1,80 @@
#!/bin/sh
# Nico Schottelius
# Build release tar
# Date: Sat Oct 15 21:38:29 CEST 2005
# Last Changed: ls -l
if [ $# -ne 1 ]; then
echo "This is a maintainer-only script to release cinit"
echo $(basename $0): version
exit 1
fi
# paths
D_BASE="/home/users/nico/privat/computer/net/netzseiten/www.nico.schottelius.org/src/software/cinit"
D_DIR=${D_BASE}/archives/
D_SOURCE=${D_BASE}/browse_source/
# versions to check
VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')"
VERSION_ARGV="$1"
VERSION_GIT="$(git describe)"
echo "=> Version commandline: $VERSION_ARGV"
echo "=> Version conf/version: $VERSION_CONF"
echo "=> Version git: $VERSION_GIT"
if [ "$VERSION_ARGV" = "$VERSION_CONF" -a "$VERSION_ARGV" = "$VERSION_GIT" ]; then
echo "=> Version confirmed."
else
echo "*** VERSION MISMATCH ***"
exit 42
fi
# Finally, accept the right version
VERSION="$VERSION_GIT"
NAME="cinit-${VERSION}"
TARNAME="cinit-${VERSION}.tar.bz2"
TARPATH="$D_DIR/$TARNAME"
echo -n "=> Continue to release $NAME? "
read yes
git archive $VERSION --prefix="${NAME}/" --output="${TARPATH}"
( cd "$D_SOURCE" && tar xvf "$TARPATH" )
echo "Please do not forget to update the website..."
################################################################################
# Unused, but interesting
# make sure the examples are not executed anymore
exit 0
# match cinit-$version as directory name
VERSION_DIR="$(cd "$DIR"; pwd -P | sed 's;.*/cinit-;;')"
# grep version string from CHANGES file (often used, obsoleted here)
VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):.*/\1/')"
# Correct umask 077 results
echo "Correcting paranoid permissions"
ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;"
ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;"
ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\""
# Create archive
echo "Creating bzip2 compressed tar"
cd $DDIR
tar cj -X $DIR/.exclude -f "$OUT_NAME" "$RDIR"
chmod 0644 "$OUT_NAME"
# Transfer to a remote host
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"

View file

@ -0,0 +1,20 @@
#!/bin/sh
# yah - yet another hack
if [ ! "$1" ]; then
echo "HOSTNAME"
exit 23
fi
host="$1"
hier=$(dirname $0)
$hier/compile_test.sh "$host"
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,14 @@
what=$(dirname $0)/../../
what_real=$(cd "$what" && pwd -P)
dest=~compiler/cinit-test
set -e
sudo rsync -av "${what_real}/" "$dest"
sudo chown -R compiler "$dest"
sudo -u compiler "${dest}/scripts/internal/compile_local.sh"
sudo -u compiler "${dest}/src/cinit" &
sleep 13
sudo -u compiler "${dest}/scripts/internal/stop_cinit.sh"
# exit 0 for make
exit 0

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,67 @@
#!/bin/sh
# Nico Schottelius (nico-linux at schottelius.org)
# indents like kr with a little bit more beauty look
# 13-May-2004
# written for the monotone project, adapted for all my projects
#
# Copying: GPLv3
if [ $# -lt 1 ]; then
echo "$0: <files to indent>"
exit 1
fi
opts=""
opts="${opts} -bap" # --blank-lines-after-procedures
opts="${opts} -bbb" # --blank-lines-before-block-comments
opts="${opts} -bad" # --blank-lines-after-declarations
opts="${opts} -bbo" # --break-before-boolean-operator
opts="${opts} -br" # --braces-on-if-line
opts="${opts} -brs" # --braces-on-struct-decl-line
opts="${opts} -cdb" # --comment-delimiters-on-blank-lines
opts="${opts} -cbi0" # --case-brace-indentation
opts="${opts} -cdw" # --cuddle-do-while
opts="${opts} -ce" # --cuddle-else, see -br
opts="${opts} -ci0" # --continuation-indentation (see -lp)
opts="${opts} -cli3" # --case-indentation
opts="${opts} -cp33" # --else-endif-columnn
opts="${opts} -cs" # --space-after-cast
opts="${opts} -d0" # --line-comments-indentationn
opts="${opts} -di0" # --declaration-indentation
opts="${opts} -fca" # --format-all-comments
opts="${opts} -hnl" # --honour-newlines
opts="${opts} -i3" # --indent-level
opts="${opts} -ip0" # --parameter-indentation
opts="${opts} -l80" # --line-length
opts="${opts} -lc80" # --line-length
opts="${opts} -lp" # --continue-at-parentheses
opts="${opts} -lps" # --leave-preprocessor-space
opts="${opts} -nbc" # --no-blank-lines-after-commas
opts="${opts} -nbfda" # --dont-break-function-decl-args
opts="${opts} -nbfde" # NOT --break-function-decl-args
opts="${opts} -nfc1" # --dont-format-first-column-comments
opts="${opts} -npcs" # --no-space-after-function-call-names
opts="${opts} -nprs" # --no-space-after-parentheses
opts="${opts} -npsl" # --dont-break-procedure-type
opts="${opts} -nsaf" # --no-space-after-for
opts="${opts} -nsai" # --no-space-after-if
opts="${opts} -nsaw" # --no-space-after-while
opts="${opts} -npsl" # --dont-break-procedure-type
opts="${opts} -nut" # --no-tabs
opts="${opts} -nv" # --no-verbosity
opts="${opts} -npro" # --ignore-profile
opts="${opts} -pi0" # --paren-indentationn
opts="${opts} -ppi3" # preprocessor indent
opts="${opts} -sbi0" # --struct-brace-indentation
opts="${opts} -sc" # --start-left-side-of-comments
opts="${opts} -sob" # --swallow-optional-blank-lines
opts="${opts} -ss" # --space-special-semicolon
for file in "$@"; do
indent $opts "$file"
done
# old:
# -ad \
# -ts3 -nut -sc -ce -cdw -cli0 -nbc lp -ppi3 -di1 -c33 -cd33 -ncdb -ci3 -cp33 -cs -d0 -di0 -l75 -nfc1 -nfca -hnl -ip0 -nprs -saf -sai -saw -nsob -nss -npsl "$file"

View file

@ -0,0 +1,57 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux@schottelius.org>
# Date: 21-Aug-2005
# Last Modified: -
#
set -e
[ $# -ne 1 ] && exit 23
SRC=$1
cd "$SRC"
#
# Title heading
#
echo .TH $(cat "meta/name" "meta/man_section" "meta/date")
#
# Name
#
echo .SH NAME
echo $(cat meta/name) - $(cat meta/short_description)
#
# Synopsis
#
echo .SH SYNOPSIS
echo $(cat path) $(cat parameters)
#
# description
#
echo .SH DESCRIPTION
echo $(cat long_description)
#
# availability
#
for section in availability examples "see also" author; do
if [ -f "$section" ]; then
echo .SH $section | tr '[a-z]' '[A-Z]'
cat "$section"
fi
done
#
# files
#
if [ -f files ]; then
echo .SH FILES
cat files | sed 's/\(.*\)/.IP "\1" /'
fi
exit 0

View file

@ -0,0 +1,22 @@
#!/bin/sh
# Nico Schottelius
# 2007-09-03: For testing cinit in qemu
#
emud="${HOME}/emu"
img="${emud}/debian-hd.img"
ddir="${emud}/mount"
loop=/dev/loop1
fsck="/sbin/fsck.jfs"
# my jfs is on the first partition, 512*63 bytes offset
offset="32256"
set -e
set -x
sudo losetup -o "${offset}" "${loop}" "${img}"
sudo "${fsck}" "${loop}"
sudo mount "${loop}" "${ddir}"
sudo umount "${loop}"
sudo losetup -d "${loop}"

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Linux specific, but don't care, I am the only person that should use it
killall -TERM cinit

View file

@ -0,0 +1,11 @@
#!/bin/sh
# Nico Schottelius
# 2007-09-27: Test cmd
#
echo "Testing cmd..."
sudo /sbin/cmd -s /etc/cinit/svc/init
sudo /sbin/cmd -p /etc/cinit/svc/init
sudo /sbin/cmd -v
sudo /sbin/cmd -V

View file

@ -0,0 +1,40 @@
#!/bin/sh
# Nico Schottelius
# build, install and test cinit in an uml image
set -e
set -x
###################### Params ########################################
# where the cinit source can be found
CINIT=/root/cinit-0.1
# the image you want to put cinit on (I am using gentoo stage3)
IMG=stage3-p4.img
# where to mount the image
MNT=/mnt/uml
# what fsck to use
FSCK=fsck.jfs
# the uml-linux-kernel
LINUX=./linux-2.6.11.11
# parameters to kernel - should not needed to be changed
LINUX_PARAM="ubd0=$IMG umid=cinit$$ init=/sbin/cinit"
######################################################################
HIER=$(pwd)
"$FSCK" "$IMG"
mount "$IMG" "$MNT" -o loop
echo "$MNT" > "$CINIT/conf/destdir"
make -C "$CINIT" clean all install
umount "$MNT"
"$FSCK" "$IMG"
"$LINUX" $LINUX_PARAM
# restore console, if broken
#reset

View file

@ -0,0 +1,12 @@
#!/bin/sh
# yah
hosts="penrose.bsdprojects.net jiffies.forkbomb.ch ddna044.netstream.ch"
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