diff options
40 files changed, 1454 insertions, 0 deletions
@@ -0,0 +1 @@ +0.0.0.1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..439b7e5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +internet-kiosk (0.0.0.1) UNRELEASED; urgency=low + + * First upstream version: + - Project start... + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Fri, 17 Aug 2012 14:43:12 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..550d342 --- /dev/null +++ b/debian/control @@ -0,0 +1,75 @@ +Source: internet-kiosk +Section: admin +Priority: extra +Maintainer: Debian Edu Packaging Team <debian-edu-pkg-team@lists.alioth.debian.org> +Uploaders: + Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +Build-Depends: + debhelper (>= 7.0.50~), + cdbs, +Standards-Version: 3.9.3 +Homepage: http://wiki.it-zukunft-schule.de +Vcs-Git: git://code.it-zukunft-schule.de/upstream/internet-kiosk.git +Vcs-Browser: http://code.it-zukunft-schule.de/gitweb?p=upstream/internet-kiosk.git;a=summary + +Package: internet-kiosk-management +Architecture: all +Depends: + ${misc:Depends}, + debootstrap +Recommends: + atftpd | tftpd | tftpd-hpa, + syslinux, + syslinux-themes-debian-squeeze, + nfs-kernel-server, +Suggests: + dhcp3-server | dnsmasq | isc-dhcp-server, +Description: Management tools for diskless Internet Kiosk installations + Internet Kiosk is a simple tool that provides an internet-cafe-like + terminal. It starts up a web browser with restricted functionality (kiosk mode) + in full screen mode and launches a pre-configured start page. + . + Internet Kiosk can be provided on top of a minimal system installation + as well as within a diskless chroot environment on multiple machines + that boot over the network. + . + internet-kiosk-management: + -------------------------- + This package contains tools to administrate a diskless boot environment + of Internet Kiosk terminals. + . + Install this package on the chroot server that provides multiple + Internet Kiosk terminals over PXE/Etherboot. + +Package: internet-kiosk +Architecture: all +Depends: + ${misc:Depends}, + ${perl:Depends}, + psmisc, + iceweasel | firefox, + xinit, + locales, +Recommends: + vim, + mc, + acpid, + memtest86, + memtest86+, +Description: Internet Kiosk daemon + Internet Kiosk is a simple tool that provides an internet-cafe-like + terminal. It starts up a web browser with restricted functionality (kiosk mode) + in full screen mode and launches a pre-configured start page. + . + Internet Kiosk can be provided on top of a minimal system installation + as well as within a diskless chroot environment on multiple machines + that boot over the network. + . + internet-kiosk: + --------------- + This package provides a daemon for Internet Kiosk terminals that launches + a mozilla-based web browser in fullscreen mode and restricted functionality. + . + Either install this package on top of a minimal system installation or + let the Internet Kiosk management scripts install it within the diskless + Internet Kiosk chroot environment. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..58a3b20 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,52 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: internet-kiosk +Upstream-Contact: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +Source: http://code.it-zukunft-schule.de/gitweb?p=upstream/internet-kiosk.git;a=summary + +Files: * +Copyright: 2012, Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. + +Files: debian/* +Copyright: 2012, Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. diff --git a/debian/internet-kiosk-management.dirs b/debian/internet-kiosk-management.dirs new file mode 100644 index 0000000..e1e55ea --- /dev/null +++ b/debian/internet-kiosk-management.dirs @@ -0,0 +1,4 @@ +usr/share/internet-kiosk/tce +etc/internet-kiosk/ + + diff --git a/debian/internet-kiosk-management.docs b/debian/internet-kiosk-management.docs new file mode 100644 index 0000000..855d733 --- /dev/null +++ b/debian/internet-kiosk-management.docs @@ -0,0 +1 @@ +internet-kiosk-management/README
\ No newline at end of file diff --git a/debian/internet-kiosk-management.install b/debian/internet-kiosk-management.install new file mode 100644 index 0000000..3212f48 --- /dev/null +++ b/debian/internet-kiosk-management.install @@ -0,0 +1,4 @@ +internet-kiosk-management/sbin/ik_* usr/sbin/ +internet-kiosk-management/etc/ik_* etc/internet-kiosk +internet-kiosk-management/share/ik_* usr/share/internet-kiosk/ +internet-kiosk-management/share/tftpboot usr/share/internet-kiosk/ diff --git a/debian/internet-kiosk-management.manpages b/debian/internet-kiosk-management.manpages new file mode 100644 index 0000000..677b8dd --- /dev/null +++ b/debian/internet-kiosk-management.manpages @@ -0,0 +1,6 @@ +internet-kiosk-management/man/ik_cleanup.8 +internet-kiosk-management/man/ik_create.8 +internet-kiosk-management/man/ik_preptftpboot.8 +internet-kiosk-management/man/ik_shell.8 +internet-kiosk-management/man/ik_update.8 +internet-kiosk-management/man/ik_upgrade.8 diff --git a/debian/internet-kiosk.dirs b/debian/internet-kiosk.dirs new file mode 100644 index 0000000..67e7c90 --- /dev/null +++ b/debian/internet-kiosk.dirs @@ -0,0 +1,2 @@ +usr/sbin/ +etc/internet-kiosk diff --git a/debian/internet-kiosk.examples b/debian/internet-kiosk.examples new file mode 100644 index 0000000..c41f891 --- /dev/null +++ b/debian/internet-kiosk.examples @@ -0,0 +1 @@ +internet-kiosk-management/share/ik_* diff --git a/debian/internet-kiosk.init b/debian/internet-kiosk.init new file mode 100644 index 0000000..8aaf6ec --- /dev/null +++ b/debian/internet-kiosk.init @@ -0,0 +1,96 @@ +#! /bin/sh + +# Copyright (C) 2010-2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +### BEGIN INIT INFO +# Provides: internet-kiosk-daemon +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start and stop the Internet Kiosk daemon +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +export HOSTNAME +DAEMON=/usr/sbin/internet-kiosk-daemon +NAME=internet-kiosk-daemon +DESC="Internet Kiosk Daemon" + +test -x $DAEMON || exit 0 +if [ ! -x /etc/internet-kiosk/ik_init ] || [ ! -x /etc/internet-kiosk/ik_start ]; then + echo "The Internet Kiosk system will not start as it is not configured, yet." + exit 0 +fi + +# pre-init Internet Kiosk Diskless Terminal through init script... +test -x /etc/internet-kiosk/ik_init && . /etc/internet-kiosk/ik_init + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid && echo "$NAME." || echo "not running" + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart" except that it does nothing if the + # daemon isn't already running. + # check wether $DAEMON is running. If so, restart + start-stop-daemon --stop --test --quiet --pidfile \ + /var/run/$NAME.pid \ + && $0 restart \ + || exit 0 + ;; + restart) + echo -n "Restarting $DESC: " + $0 stop + sleep 1 + $0 start + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/internet-kiosk.install b/debian/internet-kiosk.install new file mode 100644 index 0000000..6a1a541 --- /dev/null +++ b/debian/internet-kiosk.install @@ -0,0 +1 @@ +internet-kiosk/sbin/internet-kiosk-daemon usr/sbin/ diff --git a/debian/internet-kiosk.manpages b/debian/internet-kiosk.manpages new file mode 100644 index 0000000..d324701 --- /dev/null +++ b/debian/internet-kiosk.manpages @@ -0,0 +1 @@ +internet-kiosk/man/internet-kiosk-daemon.8
\ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..e6192f6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,3 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)
\ No newline at end of file diff --git a/internet-kiosk-management/README b/internet-kiosk-management/README new file mode 100644 index 0000000..b687bf2 --- /dev/null +++ b/internet-kiosk-management/README @@ -0,0 +1,34 @@ +ik_create +===================== +Create a new Internet Kiosk Diskless Terminal chroot image + +Check ik_settings before doing so. + + +ik_shell +=================== +Start a $SHELL in the Internet Kiosk Diskless Terminal chroot. + + +ik_settings +======================= +This is where the settings for the Internet Kiosk Diskless +Terminal can be made. + + +ik_update +===================== +Update the configuration of the Internet Kiosk Diskless Terminal. + +See files + + +ik_upgrade +====================== +Do apt-get upgrade in the Internet Kiosk Diskless Terminal chroot. + + +files +===== +Files needed to adjust the runtime system. + diff --git a/internet-kiosk-management/etc/ik_settings b/internet-kiosk-management/etc/ik_settings new file mode 100644 index 0000000..1b33fe9 --- /dev/null +++ b/internet-kiosk-management/etc/ik_settings @@ -0,0 +1,70 @@ +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +# base path for Internet Kiosk diskless machine files +IK_BASE="/opt/internet-kiosk" + +# path to Internet Kiosk chroot +IK_CHROOT="$IK_BASE/chroot" + +# path to the Internet Kiosk configuration +IK_CONFIG="$IK_BASE/etc" + +# shell to use when maintaining the Internet Kiosk diskless terminal chroot +IK_SHELL="bash" + +# Debian package mirror to use... +IK_DEBMIRROR_URL="http://ftp.debian.org/debian" + +# Retrieve extra packages from this URL +IK_EXTRA_DEBURL="deb http://packages.it-zukunft-schule.de/debian squeeze main" + +# Use a http/ftp proxy during debootstrap (leave empty if direct connections to http/ftp are allowed) +# IK_HTTP_PROXY="http://webcache.intern:3128" +# IK_HTTPS_PROXY="http://webcache.intern:3128" +# IK_FTP_PROXY="http://webcache.intern:3128" +IK_HTTP_PROXY="" +IK_HTTPS_PROXY="" +IK_FTP_PROXY="" + +# module blacklist (used during Internet Kiosk chroot creation) +IK_MODULE_BLACKLIST="pcspkr" + +# tftp boot environment (PXE/syslinux files delivered via tftpd) +IK_TFTP_BOOT="/srv/tftp" + +echo +echo "Internet Kiosk Diskless Terminal Environment:" +echo "=============================================" +echo "The Internet Kiosk Diskless Terminal Environment is using the following" +echo "settings:" +echo +echo "IK_BASE=$IK_BASE" +echo "IK_CONFIG=$IK_CONFIG" +echo "IK_CHROOT=$IK_CHROOT" +echo "IK_SHELL=$IK_SHELL" +echo "IK_DEBMIRROR_URL=$IK_DEBMIRROR_URL" +echo "IK_EXTRA_DEBURL=$IK_EXTRA_DEBURL" +echo "IK_HTTP_PROXY=$IK_HTTP_PROXY" +echo "IK_HTTPS_PROXY=$IK_HTTPS_PROXY" +echo "IK_FTP_PROXY=$IK_FTP_PROXY" +echo "IK_MODULE_BLACKLIST=$IK_MODULE_BLACKLIST" +echo "IK_TFTP_BOOT=$IK_TFTP_BOOT" +echo +echo "Edit /etc/internet-kiosk/internet-kiosk_settings to change this." +echo diff --git a/internet-kiosk-management/man/ik_cleanup.8 b/internet-kiosk-management/man/ik_cleanup.8 new file mode 100644 index 0000000..602eabd --- /dev/null +++ b/internet-kiosk-management/man/ik_cleanup.8 @@ -0,0 +1,33 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH ik_cleanup 8 "17 Aug 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +ik_cleanup \- Removes the Internet Kiosk Diskless Terminal environment from the PXE server. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBik_cleanup\fR + +.SH DESCRIPTION +This helper script removes the complete Internet Kiosk Diskless Terminal from your system. The script will +ask you to confirm the removal action. + +Use with care!!! +.PP +.SH OPTIONS +\fBik_cleanup\fR has no known options. +.PP +.SH FILES +/etc/internet-kiosk/ik_settings + Configuration file for ik_* scripts. + +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the +Debian Edu project (http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk-management/man/ik_create.8 b/internet-kiosk-management/man/ik_create.8 new file mode 100644 index 0000000..7f6d97b --- /dev/null +++ b/internet-kiosk-management/man/ik_create.8 @@ -0,0 +1,35 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH ik_create 8 "17 Aug 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +ik_create \- Create an Internet Kiosk Diskless Terminal chroot Environment. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBik_create\fR + +.SH DESCRIPTION +This helper script creates a bootable system for Internet Kiosk Diskless Terminals. +.PP +\fBNOTE:\fR Use this script for +building your own Internet Kiosk Diskless Terminal environment. +.PP +Run this script on a dedicated PXE/Etherboot server that shall provide bootable Internet Kiosk terminals +over your local area network. +.PP +.SH OPTIONS +\fBik_create\fR has no known options. +.PP +.SH FILES +/etc/internet-kiosk/ik_settings + Configuration file for ik_* scripts. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu project +(http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk-management/man/ik_preptftpboot.8 b/internet-kiosk-management/man/ik_preptftpboot.8 new file mode 100644 index 0000000..f45caff --- /dev/null +++ b/internet-kiosk-management/man/ik_preptftpboot.8 @@ -0,0 +1,58 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH ik_preptftpboot 8 "17 Aug 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +ik_preptftpboot \- Prepare PXE/Syslinux Boot Environment (delivered via tftpd) on a Internet Kiosk PXE Server. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBik_preptftpboot\fR + +.SH DESCRIPTION +This helper script prepares Internet Kiosk's PXE/Syslinux boot environment. +.PP +Please run the \fBik_create\fR helper script first before you run this script. After that +return back to this script. +.PP +This script can only be called if the PXE boot dir (default: /srv/tftp) does not already +contain any other PXE/Syslinux boot environment. + +.SH MANUAL STEPS AFTER SCRIPT HAS RUN +At the end of \fBik_preptftpboot\fR 2-3 manual steps are still needed (as displayed by +the script itself when run)... The $IK_* variables mentioned in the text below have to be +obtained from \fI/etc/internet-kiosk/ik_settings\fR. +.TP +1. Make sure your DHCP server's configuration points to: + +next-server <IP-or-hostname-of-this-server>; + +filename '/pxelinux.0'; +.TP +2. Export the Internet Kiosk chroot environment via NFSv3: +Add the line below to /etc/exports and then restart your NFS server with: +/etc/init.d/nfs-kernel-server restart. + +$IK_CHROOT <network>(ro,async,no_root_squash,no_subtree_check) +.TP +3. Customize PXE/Syslinux files in $IK_TFTP_BOOT/ (optional): +Customize PXE boot menu, take a look at $IK_TFTP_BOOT/default.cfg +and proceed from there on... + +Use your own boot loader background image: 640x480px, +16bit colour depth, file: $IK_TFTP_BOOT/ik-dte.png +.SH OPTIONS +\fBik_pretftpboot\fR has no known options. +.PP +.SH FILES +/etc/internet-kiosk/ik_settings + Configuration file for ik_* scripts. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu project +(http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk-management/man/ik_shell.8 b/internet-kiosk-management/man/ik_shell.8 new file mode 100644 index 0000000..30457d2 --- /dev/null +++ b/internet-kiosk-management/man/ik_shell.8 @@ -0,0 +1,31 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH ik_shell 8 "17 Aug 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +ik_shell \- Opens a shell within the Internet Kiosk Diskless Terminal chroot Environment. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBik_shell\fR + +.SH DESCRIPTION +This helper script opens a shell within the Internet Kiosk Diskless Terminal chroot environment. +.PP +\fBNOTE:\fR Use this script to perform maintenance work within your Internet Kiosk Diskless Terminal chroot. +.PP +.SH OPTIONS +\fBik_shell\fR has no known options. +.PP +.SH FILES +/etc/internet-kiosk/ik_settings + Configuration file for ik_* scripts. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu project +(http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk-management/man/ik_update.8 b/internet-kiosk-management/man/ik_update.8 new file mode 100644 index 0000000..a1445a0 --- /dev/null +++ b/internet-kiosk-management/man/ik_update.8 @@ -0,0 +1,37 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH ik_update 8 "17 Aug 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +ik_update \- Updates the Internet Kiosk Diskless Terminal configuration. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBik_update\fR + +.SH DESCRIPTION +This helper script updates the configuration of your Internet Kiosk Diskless Terminal environment (browser profile, etc.). +.PP +.SH OPTIONS +\fBik_update\fR has no known options. +.PP +.SH FILES +.TP +/etc/internet-kiosk/ik_settings +Configuration file for ik_* scripts. +.TP +/usr/share/internet-kiosk/ik_init +Script that prepares tmpfs filespace within the Internet Kiosk Diskless Terminal on startup. +.TP +/usr/share/internet-kiosk/ik_start +Script that launches and configures the web browser within Internet Kiosk. + +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu project +(http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk-management/man/ik_upgrade.8 b/internet-kiosk-management/man/ik_upgrade.8 new file mode 100644 index 0000000..d13fd88 --- /dev/null +++ b/internet-kiosk-management/man/ik_upgrade.8 @@ -0,0 +1,30 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH ik_upgrade 8 "17 Aug 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +ik_upgrade \- Upgrade the Internet Kiosk Diskless Terminal software. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBik_upgrade\fR + +.SH DESCRIPTION +This helper script performs a package upgrade within the Internet Kiosk Diskless Terminal chroot. Use this script to update/upgrade your +Internet Kiosk terminal's software. +.PP +.SH OPTIONS +\fBik_upgrade\fR has no known options. +.PP +.SH FILES +/etc/internet-kiosk/ik_settings + Configuration file for ik_* scripts. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu project +(http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk-management/sbin/ik_cleanup b/internet-kiosk-management/sbin/ik_cleanup new file mode 100755 index 0000000..8be800b --- /dev/null +++ b/internet-kiosk-management/sbin/ik_cleanup @@ -0,0 +1,74 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +if echo $0 | egrep "^./bin/.*$" >/dev/null; then + ETCDIR="etc/" +elif echo $0 | egrep "^./ik_.*$" >/dev/null; then + ETCDIR="../etc" +else + ETCDIR=/etc/internet-kiosk +fi + +source $ETCDIR/ik_settings + +IK_BASE="${IK_BASE:-/opt/internet-kiosk}" +IK_CHROOT="${IK_CHROOT:-$IK_BASE/chroot}" +IK_CONFIG="${IK_CONFIG:-$IK_BASE/etc}" +IK_TFTP_BOOT="${IK_TFTP_BOOT:-/srv/tftp}" + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Internet Kiosk Diskless Terminal management scripts have to run as super-user root." + exit -2 +} + +echo "Internet Kiosk Diskless Terminal cleanup..." +echo "-------------------------------------------" + +echo "Hit <RETURN> to purge all Internet Kiosk Diskless Terminal related files (chroot, config, PXE boot env)..." +echo "Alternatively, hit STRG-C to cancel the operation now!!!" +read + +# CHROOT + DTE config +test -e "$IK_CHROOT" && { + echo "Removing $IK_CHROOT..." + rm -Rf "${IK_CHROOT}" +} || { + echo "WARNING: Internet Kiosk Diskless Terminal chroot does not exist at $IK_CHROOT. No cleanup necessary..." +} +test -e "$IK_CONFIG" && { + echo "Removing $IK_CONFIG..." + rm -Rf "${IK_CONFIG}" +} || { + echo "WARNING: Internet Kiosk Diskless Terminal config does not exist at $IK_CONFIG. No cleanup necessary..." +} + +### PXE/Syslinux +test -e "$IK_TFTP_BOOT/pxelinux.cfg" && { + echo "Emptying $IK_TFTP_BOOT..." + rm -Rf "${IK_TFTP_BOOT}"/* +} || { + echo "WARNING: Internet Kiosk PXE/Syslinux boot environment does not exist at $IK_TFTP_BOOT. No cleanup necessary..." +} + +echo +echo "Internet Kiosk Diskless Terminal cleanup is DONE." +echo diff --git a/internet-kiosk-management/sbin/ik_create b/internet-kiosk-management/sbin/ik_create new file mode 100755 index 0000000..3546228 --- /dev/null +++ b/internet-kiosk-management/sbin/ik_create @@ -0,0 +1,174 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +if echo $0 | egrep "^./bin/.*$" >/dev/null; then + ETCDIR="etc/" + SHAREDIR="share/" +elif echo $0 | egrep "^./ik_.*$" >/dev/null; then + ETCDIR="../etc" + SHAREDIR="../share/" +else + ETCDIR=/etc/internet-kiosk + SHAREDIR="/usr/share/internet-kiosk/" +fi + +source $ETCDIR/ik_settings + +IK_BASE="${IK_BASE:-/opt/internet-kiosk}" +IK_CHROOT="${IK_CHROOT:-$IK_BASE/chroot}" +IK_CONFIG="${IK_CONFIG:-$IK_BASE/etc}" +IK_DEBMIRROR_URL="${IK_DEBMIRROR_URL:-'http://ftp.debian.org/debian'}" +IK_EXTRA_DEBURL="${IK_EXTRA_DEBURL:-'deb http://packages.it-zukunft-schule.de squeeze main'}" +IK_MODULE_BLACKLIST="${IK_MODULE_BLACKLIST:-'pcspkr'}" + +test -e "$IK_CHROOT" && { + echo "ERROR: Internet Kiosk Terminal chroot already exists at $IK_CHROOT." + echo "Clear $IK_BASE/ and then run $(basename $0) again..." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Internet Kiosk Diskless Terminal management scripts have to run as super-user root." + exit -2 +} + +echo "Hit <RETURN> to continue with the Internet Kiosk Terminal's chroot creation using the above parameters..." +echo "Alternatively, hit STRG-C to cancel the operation now!!!" +read + +export LANG=C + +mkdir -p $IK_CONFIG +test -f $IK_CONFIG/ik_init || cp $SHAREDIR/ik_init $IK_CONFIG +test -f $IK_CONFIG/ik_start || cp $SHAREDIR/ik_start $IK_CONFIG + +apt-get install debootstrap +mkdir -p $IK_CHROOT + +# use a proxy server for APT (if any is configured) +export http_proxy="$IK_HTTP_PROXY" +export https_proxy="$IK_HTTPS_PROXY" +export ftp_proxy="$IK_FTP_PROXY" + +debootstrap --arch i386 stable $IK_CHROOT/ $IK_DEBMIRROR_URL +cp /etc/resolv.conf $IK_CHROOT/etc/resolv.conf +echo "auto lo" >> $IK_CHROOT/etc/network/interfaces +echo "iface lo inet loopback" >> $IK_CHROOT/etc/network/interfaces +echo "localhost" > $IK_CHROOT/etc/hostname +echo "127.0.0.1 localhost" >> $IK_CHROOT/etc/hosts +cat > $IK_CHROOT/etc/fstab <<EOF +#proc /proc proc defaults 0 0 +none /dev/pts devpts gid=5,mode=620 0 0 +none /tmp tmpfs size=50M,mode=1777 0 0 +none /root tmpfs size=100M,mode=700 0 0 +none /etc/udev/rules.d tmpfs size=50M 0 0 +none /var/run tmpfs size=50M 0 0 +none /var/log tmpfs size=50M 0 0 +none /var/lock tmpfs size=50M 0 0 +none /home tmpfs size=50M 0 0 +none /media tmpfs size=50M 0 0 +none /var/lib/nfs tmpfs size=50M 0 0 +none /var/lib/xkb tmpfs size=50M 0 0 +none /var/lib/dbus tmpfs size=50M 0 0 +none /var/lib/alsa tmpfs size=50M 0 0 +EOF + + +cat > $IK_CHROOT/ikdt_install.sh <<EOF +#!/bin/bash + +export LANG=C +mount /proc +mount /dev/pts +export HOME=/root +export http_proxy=$IK_HTTP_PROXY +export https_proxy=$IK_HTTPS_PROXY +export ftp_proxy=$IK_FTP_PROXY + +mkdir -p /tmp/user/0 +mkdir -p /var/lib/xkb +mkdir -p /var/lib/nfs +mkdir -p /var/lib/dbus +mkdir -p /etc/network +ln -sf /dev/shm /etc/network/run + +# disable service restarts +test -e /sbin/start-stop-daemon.keep || mv /sbin/start-stop-daemon /sbin/start-stop-daemon.keep +echo '#!/bin/sh' > /sbin/start-stop-daemon +echo 'exit 0' >> /sbin/start-stop-daemon +chmod +x /sbin/start-stop-daemon + +[ \$? -eq 0 ] && test -n "$IK_EXTRA_DEBURL" && echo "$IK_EXTRA_DEBURL" > /etc/apt/sources.list.d/itzks.list +[ \$? -eq 0 ] && test -n "$IK_EXTRA_DEBURL" && apt-get update +[ \$? -eq 0 ] && test -n "$IK_EXTRA_DEBURL" && apt-get install itzks-keyring -y --force-yes +[ \$? -eq 0 ] && apt-get update +[ \$? -eq 0 ] && apt-get install $IK_SHELL -y +[ \$? -eq 0 ] && apt-get install syslinux locales -y +[ \$? -eq 0 ] && dpkg-reconfigure locales +[ \$? -eq 0 ] && apt-get install linux-image-486 -y +[ \$? -eq 0 ] && mv /vmlinuz /vmlinuz.486 +[ \$? -eq 0 ] && mv /initrd.img /initrd.img.486 +[ \$? -eq 0 ] && apt-get install linux-image-686 -y +[ \$? -eq 0 ] && mv /vmlinuz /vmlinuz.686 +[ \$? -eq 0 ] && mv /initrd.img /initrd.img.686 +[ \$? -eq 0 ] && apt-get install internet-kiosk -y + +# blacklist kernel modules +[ \$? -eq 0 ] && echo && echo "# modules blacklisted on Internet Kiosk Diskless Terminals..." >> /etc/modprobe.d/blacklist.conf +[ \$? -eq 0 ] && for mod in $IK_MODULE_BLACKLIST; do echo "blacklist \$mod" >> /etc/modprobe.d/blacklist.conf; done + +# Pulsaudio must come afterwards +[ \$? -eq 0 ] && apt-get install alsa-base pulseaudio -y +[ \$? -eq 0 ] && apt-get install patch -y +[ \$? -eq 0 ] && patch /etc/initramfs-tools/initramfs.conf <<PATCH +39c39 +< BOOT=local +--- +> BOOT=nfs +PATCH +[ \$? -eq 0 ] && rm -f /etc/udev/rules.d/*-persistent-*.rules +[ \$? -eq 0 ] && useradd internet-kiosk +[ \$? -eq 0 ] && adduser internet-kiosk audio +[ \$? -eq 0 ] && adduser internet-kiosk pulse +[ \$? -eq 0 ] && adduser pulse audio +[ \$? -eq 0 ] && update-initramfs -u -v +[ \$? -eq 0 ] && passwd -l root + +# tweak mtab diversion +[ \$? -eq 0 ] && rm -f /etc/mtab +[ \$? -eq 0 ] && ln -sf /proc/mounts /etc/mtab + +# restore start-stop-daemon +[ \$(stat --format '%s' /sbin/start-stop-daemon) -lt 200 ] && mv /sbin/start-stop-daemon.keep /sbin/start-stop-daemon + +umount -l /proc &>/dev/null +umount -l /dev/pts &>/dev/null +EOF +chmod u+x $IK_CHROOT/ikdt_install.sh +chroot $IK_CHROOT /ikdt_install.sh + +rm -f $IK_CHROOT/etc/udev/rules.d/*-persistent-*.rules + +ik_update + +echo "Internet Kiosk Diskless Terminal creation has finished successfully." +echo diff --git a/internet-kiosk-management/sbin/ik_preptftpboot b/internet-kiosk-management/sbin/ik_preptftpboot new file mode 100755 index 0000000..db0c28a --- /dev/null +++ b/internet-kiosk-management/sbin/ik_preptftpboot @@ -0,0 +1,103 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +if echo $0 | egrep "^./bin/.*$" >/dev/null; then + ETCDIR="etc/" + SHAREDIR="share/" +elif echo $0 | egrep "^./ik_.*$" >/dev/null; then + ETCDIR="../etc" + SHAREDIR="../share/" +else + ETCDIR=/etc/internet-kiosk + SHAREDIR="/usr/share/internet-kiosk" +fi + +source $ETCDIR/ik_settings + +IK_BASE="${IK_BASE:-/opt/internet-kiosk}" +IK_CHROOT="${IK_CHROOT:-$IK_BASE/chroot}" +IK_TFTP_FILES="${IK_TFTP_FILES:-$SHAREDIR/tftpboot}" +IK_TFTP_BOOT="${IK_TFTP_BOOT:-/srv/tftp}" + +mkdir -p "$IK_TFTP_BOOT" + +test -e "$IK_TFTP_BOOT/pxelinux.cfg" && { + echo "PXE boot files already found at $IK_TFTP_BOOT." + echo "Clear $IK_TFTP_BOOT/ and then run $(basename $0) again..." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Internet Kiosk Diskless Terminal management scripts have to run as super-user root." + exit -2 +} + +echo "Preparing PXE boot configuration for Internet Kiosk Terminals..." +echo "----------------------------------------------------------------" +echo + +echo "Copying the Internet Kiosk Terminal's TFTP (syslinux) template files..." +cp -av "$IK_TFTP_FILES"/* "$IK_TFTP_BOOT" +echo + +echo "Linking files for the Internet Kiosk Terminal's TFTP (syslinux) boot environment..." +cd "$IK_TFTP_BOOT" + +# 486 kernel image +ln -sfv "$IK_CHROOT/vmlinuz.486" "$IK_TFTP_BOOT/vmlinuz.486" +ln -sfv "$IK_CHROOT/initrd.img.486" "$IK_TFTP_BOOT/initrd.img.486" +# 686 kernel image +ln -sfv "$IK_CHROOT/vmlinuz.686" "$IK_TFTP_BOOT/vmlinuz.686" +ln -sfv "$IK_CHROOT/initrd.img.686" "$IK_TFTP_BOOT/initrd.img.686" +# memtest86+ +ln -sfv "$IK_CHROOT/boot/memtest86+.bin" "$IK_TFTP_BOOT/memtest86+.bin" +# syslinux components +ln -sfv "/usr/lib/syslinux/pxelinux.0" "$IK_TFTP_BOOT/pxelinux.0" +ln -sfv "/usr/lib/syslinux/vesamenu.c32" "$IK_TFTP_BOOT/vesamenu.c32" + +cd - > /dev/null + +echo +echo "DONE with Internet Kiosk Terminal PXE/Syslinux environment setup." +echo "However, 2-3 manual steps are still needed..." + +echo +echo "1. Make sure your DHCP server's configuration points to:" +echo +echo " next-server <IP-or-hostname-of-this-server>;" +echo " filename '/pxelinux.0';" +echo +echo "2. Export the Internet Kiosk Terminal's chroot environment via NFSv3:" +echo +echo " Add this line to /etc/exports..." +echo " $IK_CHROOT <your-network>/<netmask>(ro,async,no_root_squash,no_subtree_check)" +echo +echo " ... and then restart your NFS server with:" +echo " /etc/init.d/nfs-kernel-server restart" +echo +echo "3. Customize PXE/Syslinux files in $IK_TFTP_BOOT/ (optional):" +echo +echo " - customize PXE boot menu, take a look at $IK_TFTP_BOOT/default.cfg" +echo " and proceed from there on..." +echo " - use your own boot loader background image: 640x480px, 16bit colour depth," +echo " file: $IK_TFTP_BOOT/ik-dte.png" +echo diff --git a/internet-kiosk-management/sbin/ik_shell b/internet-kiosk-management/sbin/ik_shell new file mode 100755 index 0000000..270a7f1 --- /dev/null +++ b/internet-kiosk-management/sbin/ik_shell @@ -0,0 +1,87 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +if echo $0 | egrep "^./bin/.*$" >/dev/null; then + ETCDIR="etc/" +elif echo $0 | egrep "^./ik_.*$" >/dev/null; then + ETCDIR="../etc/" +else + ETCDIR=/etc/internet-kiosk/ +fi + +source $ETCDIR/ik_settings + +IK_SHELL="${IK_SHELL:-bash}" +IK_CHROOT="${IK_CHROOT:-/opt/internet-kiosk}" + +test -e "$IK_CHROOT" || { + echo "ERROR: Internet Kiosk Terminal chroot does not exist at $IK_CHROOT." + echo "Run ik_create to create it..." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Internet Kiosk Diskless Terminal management scripts have to run as super-user root." + exit -2 +} + +cat > "$IK_CHROOT/ik_dte_shell.sh" <<EOF +#!/bin/bash +mount /proc &> /dev/null +mount /dev/pts &> /dev/null +export HOME=/root + +# export the proxy server (if any) to the shell. +export http_proxy=$IK_HTTP_PROXY +export https_proxy=$IK_HTTPS_PROXY +export ftp_proxy=$IK_FTP_PROXY + +echo 'This shell has been started in your Internet Kiosk Terminal's chroot environment.' +echo 'All changes performed here will take effect on your Internet Kiosk Terminals' +echo 'after their next (re)boot. So be careful!!!' +echo +echo "To return from this chroot shell hit STRG+D or type ,,exit'' on the" +echo 'command line...' +echo +echo 'Note: Service restarts have been disabled in the Internet Kiosk Terminal's chroot.' +echo + +# disable service restarts +test -e /sbin/start-stop-daemon.keep || mv /sbin/start-stop-daemon /sbin/start-stop-daemon.keep +echo '#!/bin/sh' > /sbin/start-stop-daemon +echo 'exit 0' >> /sbin/start-stop-daemon +chmod +x /sbin/start-stop-daemon + +/bin/$IK_SHELL + +# restore start-stop-daemon +[ \$(stat --format '%s' /sbin/start-stop-daemon) -lt 200 ] && mv /sbin/start-stop-daemon.keep /sbin/start-stop-daemon + +umount -l /proc &> /dev/null +umount -l /dev/pts &> /dev/null + +echo +echo "Internet Kiosk Terminal Shell has exited." +echo +EOF +chmod u+x "$IK_CHROOT/ik_dte_shell.sh" +chroot "$IK_CHROOT" /ik_dte_shell.sh diff --git a/internet-kiosk-management/sbin/ik_update b/internet-kiosk-management/sbin/ik_update new file mode 100755 index 0000000..0a3eac6 --- /dev/null +++ b/internet-kiosk-management/sbin/ik_update @@ -0,0 +1,74 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +if echo $0 | egrep "^./bin/.*$" >/dev/null; then + ETCDIR="etc/" +elif echo $0 | egrep "^./ik_.*$" >/dev/null; then + ETCDIR="../etc" +else + ETCDIR=/etc/internet-kiosk +fi + +source $ETCDIR/ik_settings + +IK_BASE="${IK_BASE:-/opt/internet-kiosk}" +IK_CHROOT="${IK_CHROOT:-$IK_BASE/chroot}" +IK_CONFIG="${IK_CONFIG:-$IK_BASE/etc}" + +test -e "$IK_CHROOT" || { + echo "ERROR: Internet Kiosk Diskless Terminal chroot does not exist at $IK_CHROOT." + echo "Run ik_create to create it..." + exit -1 +} + +test -e "$IK_CONFIG" || { + echo "ERROR: No Internet Kiosk Diskless Terminal configuration found at $IK_CONFIG. Please check..." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Internet Kiosk Diskless Terminal management scripts have to run as super-user root." + exit -2 +} + +mkdir -p "$IK_CHROOT/etc/internet-kiosk" + +echo "Installing Internet Kiosk configuration into chroot environment..." +echo "------------------------------------------------------------------" + +if test -f $IK_CONFIG/ik_init; then + cp -v "$IK_CONFIG/ik_init" "$IK_CHROOT/etc/internet-kiosk/ik_init" + chmod a+rx $IK_CHROOT/etc/internet-kiosk/ik_init +fi + +if test -f $IK_CONFIG/ik_start; then + cp -v "$IK_CONFIG/ik_start" "$IK_CHROOT/etc/internet-kiosk/ik_start" + chmod a+rx "$IK_CHROOT/etc/internet-kiosk/ik_start" +fi + +if test -f $IK_CONFIG/ik_sessions; then + cp -v "$IK_CONFIG/ik_sessions" "$IK_CHROOT/etc/internet-kiosk/ik_sessions" + chmod a+rx "$IK_CHROOT/etc/internet-kiosk/ik_sessions" +fi + +echo + diff --git a/internet-kiosk-management/sbin/ik_upgrade b/internet-kiosk-management/sbin/ik_upgrade new file mode 100755 index 0000000..e203ca0 --- /dev/null +++ b/internet-kiosk-management/sbin/ik_upgrade @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +if echo $0 | egrep "^./bin/.*$" >/dev/null; then + ETCDIR="etc/" +elif echo $0 | egrep "^./ik_.*$" >/dev/null; then + ETCDIR="../etc" +else + ETCDIR=/etc/internet-kiosk +fi + +source $ETCDIR/ik_settings + +IK_CHROOT="${IK_CHROOT:-/opt/internet-kiosk}" + +test -e "$IK_CHROOT" || { + echo "ERROR: Internet Kiosk Diskless Terminal chroot does not exist at $IK_CHROOT." + echo "Run ik_create to create it..." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Internet Kiosk Diskless Terminal management scripts have to run as super-user root." + exit -2 +} + +cat > "$IK_CHROOT/ik_dte_upgrade.sh" <<EOF +#!/bin/bash +mount /proc &> /dev/null +mount /dev/pts &> /dev/null +export HOME=/root + +export http_proxy=$IK_HTTP_PROXY +export https_proxy=$IK_HTTPS_PROXY +export ftp_proxy=$IK_FTP_PROXY + +# disable service restarts +test -e /sbin/start-stop-daemon.keep || mv /sbin/start-stop-daemon /sbin/start-stop-daemon.keep +echo '#!/bin/sh' > /sbin/start-stop-daemon +echo 'exit 0' >> /sbin/start-stop-daemon +chmod +x /sbin/start-stop-daemon + +[ \$? -eq 0 ] && apt-get update +[ \$? -eq 0 ] && apt-get upgrade + +# check for kernel upgrades +for symlink in /vmlinuz /vmlinuz.old /initrd.img /initrd.img.old; do + if [ -h \$symlink ]; then + symlink_target=\$(ls -l "\$symlink" | awk '{print \$11}') + echo \$symlink_target | egrep ".*-486$" >/dev/null && mv \$symlink \${symlink/.old/}.486 + echo \$symlink_target | egrep ".*-686$" >/dev/null && mv \$symlink \${symlink/.old/}.686 + fi +done + +# restore start-stop-daemon +[ \$(stat --format '%s' /sbin/start-stop-daemon) -lt 200 ] && mv /sbin/start-stop-daemon.keep /sbin/start-stop-daemon + +umount -l /proc &> /dev/null +umount -l /dev/pts &> /dev/null + +echo +echo "Internet Kiosk Diskless Terminal upgrade has finished." +echo +EOF +chmod u+x "$IK_CHROOT/ik_dte_upgrade.sh" +chroot "$IK_CHROOT" /ik_dte_upgrade.sh diff --git a/internet-kiosk-management/share/ik_init b/internet-kiosk-management/share/ik_init new file mode 100755 index 0000000..9474dfc --- /dev/null +++ b/internet-kiosk-management/share/ik_init @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +mkdir -p /home/internet-kiosk +mkdir -p /home/internet-kiosk/.mozilla +#test -e /etc/internet-kiosk/profile && cp -a /etc/internet-kiosk/profile /home/internet-kiosk/.mozilla/firefox +chown internet-kiosk:internet-kiosk /home/internet-kiosk -Rf +chmod go-rwx /home/internet-kiosk -Rf diff --git a/internet-kiosk-management/share/ik_start b/internet-kiosk-management/share/ik_start new file mode 100755 index 0000000..70b06b8 --- /dev/null +++ b/internet-kiosk-management/share/ik_start @@ -0,0 +1,22 @@ +#!/bin/bash + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +/usr/bin/iceweasel & + diff --git a/internet-kiosk-management/share/tftpboot/default.cfg b/internet-kiosk-management/share/tftpboot/default.cfg new file mode 100644 index 0000000..81f32b3 --- /dev/null +++ b/internet-kiosk-management/share/tftpboot/default.cfg @@ -0,0 +1,46 @@ +# +# example for a main boot menu of an Internet Kiosk Terminal +# + +DEFAULT vesamenu.c32 +PROMPT 0 +MENU BACKGROUND ik-dte.png +MENU TITLE Internet Kiosk Terminal + +include local-boot.cfg +include ik-dte.cfg +MENU SEPARATOR +include memtest.cfg + +# menu settings +MENU VSHIFT 3 +MENU HSHIFT 18 +MENU WIDTH 60 +MENU MARGIN 10 +MENU ROWS 12 +MENU TABMSGROW 13 +MENU CMDLINEROW 23 +MENU ENDROW 12 +MENU TIMEOUTROW 18 + +MENU COLOR border 30;44 #40ffffff #a0000000 std +MENU COLOR title 1;36;44 #9033ccff #a0000000 std +MENU COLOR sel 7;37;40 #e0000000 #20ffffff all +MENU COLOR unsel 37;44 #50ffffff #a0000000 std +MENU COLOR help 37;40 #c0ffffff #a0000000 std +MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std +MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std +MENU COLOR msg07 37;40 #90ffffff #a0000000 std +MENU COLOR tabmsg 37;40 #e0ffffff #a0000000 std +MENU COLOR disabled 37;44 #50ffffff #a0000000 std +MENU COLOR hotkey 1;30;47 #ffff0000 #a0000000 std +MENU COLOR hotsel 1;7;30;47 #ffff0000 #20ffffff all +MENU COLOR scrollbar 30;47 #ffff0000 #00000000 std +MENU COLOR cmdmark 1;36;47 #e0ff0000 #00000000 std +MENU COLOR cmdline 30;47 #ff000000 #00000000 none + +# possible boot profiles for ONTIMEOUT: +# localboot, ik-dte-686, ik-dte-486 +# (... or any other profile you defined in your customized menu) +ONTIMEOUT localboot +TIMEOUT 100 diff --git a/internet-kiosk-management/share/tftpboot/ik-dte.cfg b/internet-kiosk-management/share/tftpboot/ik-dte.cfg new file mode 100644 index 0000000..69f0592 --- /dev/null +++ b/internet-kiosk-management/share/tftpboot/ik-dte.cfg @@ -0,0 +1,8 @@ +LABEL ik-dte-686 + MENU LABEL Internet Kiosk ^Terminal + KERNEL vmlinuz.686 + APPEND initrd=initrd.img.686 nfsroot=/opt/internet-kiosk/chroot boot=nfs ro quiet nomodeset +LABEL ik-dte-486 + MENU LABEL Internet Kiosk Terminal (^old hardware) + KERNEL vmlinuz.486 + APPEND initrd=initrd.img.486 nfsroot=/opt/internet-kiosk/chroot boot=nfs ro quiet nomodeset diff --git a/internet-kiosk-management/share/tftpboot/ik-dte.png b/internet-kiosk-management/share/tftpboot/ik-dte.png Binary files differnew file mode 100644 index 0000000..159ecff --- /dev/null +++ b/internet-kiosk-management/share/tftpboot/ik-dte.png diff --git a/internet-kiosk-management/share/tftpboot/local-boot.cfg b/internet-kiosk-management/share/tftpboot/local-boot.cfg new file mode 100644 index 0000000..9d3d8ca --- /dev/null +++ b/internet-kiosk-management/share/tftpboot/local-boot.cfg @@ -0,0 +1,11 @@ +# English +LABEL localboot + MENU LABEL Boot from ^local harddrive + MENU DEFAULT + localboot 0 + +# German +#LABEL localboot +# MENU LABEL Von ^lokaler Festplatte starten +# MENU DEFAULT +# localboot 0 diff --git a/internet-kiosk-management/share/tftpboot/memtest.cfg b/internet-kiosk-management/share/tftpboot/memtest.cfg new file mode 100644 index 0000000..6f3caa4 --- /dev/null +++ b/internet-kiosk-management/share/tftpboot/memtest.cfg @@ -0,0 +1,3 @@ +LABEL memtest86plus + MENU LABEL memtest86+ (run memory test) + LINUX memtest86+.bin diff --git a/internet-kiosk-management/share/tftpboot/pxelinux.cfg/default b/internet-kiosk-management/share/tftpboot/pxelinux.cfg/default new file mode 120000 index 0000000..cdc626f --- /dev/null +++ b/internet-kiosk-management/share/tftpboot/pxelinux.cfg/default @@ -0,0 +1 @@ +../default.cfg
\ No newline at end of file diff --git a/internet-kiosk/man/internet-kiosk-daemon.8 b/internet-kiosk/man/internet-kiosk-daemon.8 new file mode 100644 index 0000000..d97eefa --- /dev/null +++ b/internet-kiosk/man/internet-kiosk-daemon.8 @@ -0,0 +1,25 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH internet-kiosk-daemon 8 "17 August 2012" "Version 0.0.1.x" "Internet Kiosk" +.SH NAME +internet-kiosk-daemon \- Session Control Daemon running on Internet Kiosk Terminals +.SH SYNOPSIS +'nh +.fi +.ad l +\fBinternet-kiosk-daemon\fR + +.SH DESCRIPTION +\fBinternet-kiosk-daemon\fR is a session control daemon that runs on Internet Kiosk terminals. +.PP +.SH OPTIONS +\fBinternet-kiosk-daemon\fR has no known options. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the Debian Edu +project (http://wiki.debian.org/DebianEdu). diff --git a/internet-kiosk/sbin/internet-kiosk-daemon b/internet-kiosk/sbin/internet-kiosk-daemon new file mode 100755 index 0000000..d41aee3 --- /dev/null +++ b/internet-kiosk/sbin/internet-kiosk-daemon @@ -0,0 +1,133 @@ +#!/usr/bin/perl + +# Copyright (C) 2012 by Debian Edu project, http://wiki.debian.org/DebianEdu +# Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +# Internet Kiosk is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Internet Kiosk is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +use strict; +use IPC::Open3; + +sub catch_term +{ + system ("killall firefox-bin"); + system ("killall Xorg"); + system ("killall pulseaudio"); + unlink("/var/run/internet-kiosk.pid"); + exit; +} + +sub check_x +{ + my $x=`ps ax | grep Xorg`; + if ( $x=~m/usr.bin.Xorg/ ) + { + return 1; + } + return 0; +} + +sub check_pulse +{ + my $pulse=`ps ax | grep pulse`; + + if ( $pulse=~m/pulseaudio/) + { + return 1; + } + return 0; +} + +sub check_browser +{ + my $browser=`ps ax | grep firef`; + + if ( $browser=~m/firefox-bin/) + { + return 1; + } + return 0; +} + +# make sure the .halt file is not present when we start this script +system("rm -f /home/internet-kiosk/.halt"); + +# pre-load the thinclient initialization script +system("su internet-kiosk -c \". /etc/internet-kiosk/internet-kiosk_init\""); + +# fork to background, check if forked state is ok... +my $pid = fork(); +if (not defined $pid) +{ + print "resources not avilable.\n"; +} +elsif ($pid != 0) +{ + open (F,">/var/run/internet-kiosk.pid"); + print F "$pid\n"; + close(F); +} +elsif ($pid == 0 ) +{ + + # silence this daemon script completely... + close(STDOUT); + close(STDERR); + + $SIG{TERM}=\&catch_term; + + while(sleep 1) + { + # test if shutdown is requested + if ( -e "/home/internet-kiosk/.halt") + { + # when used with plymouth, make sure we stay on the correct terminal + system("killall Xorg"); + system("shutdown -h now"); + } + # test if XServer is running, if not launch it... + if ( check_x() ==0 ) + { + system("/usr/bin/Xorg -br &"); + } + + # test if pulseaudio is running, if not launch it... + if ( !check_pulse() ) + { + system("su - internet-kiosk -c \"DISPLAY=:0 pulseaudio -D -n \\ + -L 'module-native-protocol-tcp port=4713' \\ + -L 'module-esound-protocol-tcp port=16001' \\ + -L 'module-udev-detect' --exit-idle-time=65535\""); + } + + # test if web browser is running, if not launch it... + my $ic_pid = 0; + if ( !check_browser() ) + { + local *IN, *OUT, *ERR; + $ic_pid = eval { + open3( \*IN, \*OUT, \*ERR, "su - internet-kiosk -c 'DISPLAY=:0 bash -c \"/etc/internet-kiosk/internet-kiosk_start &\"'"); + }; + ## give the web browser some time to start + sleep(3); + ## wait for browser to finish + if ( check_browser() ) + { + waitpid( $ic_pid, 0 ); + } + } + } +} |