diff -Nru ltsp-5.3.2/ChangeLog ltsp-5.3.5/ChangeLog --- ltsp-5.3.2/ChangeLog 2012-02-23 19:19:08.000000000 +0000 +++ ltsp-5.3.5/ChangeLog 2012-03-09 18:02:08.000000000 +0000 @@ -1,4 +1,226 @@ ------------------------------------------------------------ +revno: 2136 +tags: ltsp-5.3.5 +committer: Stéphane Graber +branch nick: ltsp-trunk +timestamp: Fri 2012-03-09 13:01:19 -0500 +message: + version 5.3.5 +------------------------------------------------------------ +revno: 2135 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Fri 2012-03-09 08:59:25 +0200 +message: + Only remove old kernels for valid chroots. + + This allows for e.g. updating the kernels for /opt/ltsp/i386 while /opt/ltsp/nfs-mounted-powerpc is temporarily unavailable. +------------------------------------------------------------ +revno: 2134 +committer: Stéphane Graber +branch nick: ltsp-trunk +timestamp: Thu 2012-03-08 18:32:09 -0500 +message: + Ubuntu: Add ltsp-core.upstart to be installed as ltsp-client-core.upstart +------------------------------------------------------------ +revno: 2133 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Fri 2012-03-09 00:25:42 +0200 +message: + Plymouth is sometimes using vt7, use openvt -f (force). +------------------------------------------------------------ +revno: 2132 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Thu 2012-03-08 20:34:11 +0200 +message: + Use /usr/share/xsessions to autodetect fat chroots. +------------------------------------------------------------ +revno: 2131 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Thu 2012-03-08 19:11:42 +0200 +message: + Allow 2 parameters in run_parts_list. +------------------------------------------------------------ +revno: 2130 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Thu 2012-03-08 09:32:41 +0200 +message: + ltsp-init-common: delete functions that were moved to init-ltsp.d/. +------------------------------------------------------------ +revno: 2129 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Wed 2012-03-07 13:50:07 +0200 +message: + Remove "exit 0" from /etc/rc.local. +------------------------------------------------------------ +revno: 2128 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Wed 2012-03-07 09:44:59 +0200 +message: + Restructure screen sessions launching to save the openvt RAM. +------------------------------------------------------------ +revno: 2127 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Wed 2012-03-07 08:12:36 +0200 +message: + ltsp-common-functions: if $1 is not a dir, echo nothing. +------------------------------------------------------------ +revno: 2126 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Tue 2012-03-06 18:10:30 +0200 +message: + Ubuntu: disable cron, dbus and other services in clients with <= 128 MB RAM. +------------------------------------------------------------ +revno: 2125 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Tue 2012-03-06 18:09:10 +0200 +message: + Disable more cronjobs. +------------------------------------------------------------ +revno: 2124 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Tue 2012-03-06 10:09:13 +0200 +message: + Sound volume is set from udev, remove it from ltsp-core. +------------------------------------------------------------ +revno: 2123 +committer: Alkis Georgopoulos +branch nick: ltsp-trunk +timestamp: Tue 2012-03-06 09:29:42 +0200 +message: + Ubuntu: avoid running update-motd.d scripts. +------------------------------------------------------------ +revno: 2122 +tags: ltsp-5.3.4 +committer: Vagrant Cascadian +branch nick: ltsp-trunk +timestamp: Mon 2012-03-05 18:00:33 -0800 +message: + version 5.3.4 +------------------------------------------------------------ +revno: 2121 +committer: Stéphane Graber +branch nick: ltsp-trunk +timestamp: Mon 2012-03-05 17:17:06 -0500 +message: + Remove ltsp-setup (nothing seems to reference it anymore) +------------------------------------------------------------ +revno: 2120 +committer: Stéphane Graber +branch nick: ltsp-trunk +timestamp: Mon 2012-03-05 17:15:04 -0500 +message: + ltsp-core: Update lsb headers +------------------------------------------------------------ +revno: 2119 +committer: Stéphane Graber +branch nick: ltsp-trunk +timestamp: Mon 2012-03-05 17:14:01 -0500 +message: + Usplash no longer exists, remove any remaining reference. +------------------------------------------------------------ +revno: 2118 +committer: Vagrant Cascadian +branch nick: ltsp-trunk +timestamp: Fri 2012-03-02 16:32:40 -0800 +message: + ltsp-setup: remove functions now moved to init-ltsp.d hooks. +------------------------------------------------------------ +revno: 2117 +committer: Vagrant Cascadian +branch nick: ltsp-trunk +timestamp: Fri 2012-03-02 11:56:13 -0800 +message: + init-ltsp.d/common/50-jetpipe: do not overwrite the DEVICE variable. +------------------------------------------------------------ +revno: 2116 +committer: Vagrant Cascadian +branch nick: ltsp-trunk +timestamp: Fri 2012-03-02 11:52:26 -0800 +message: + init-ltsp.d/common/04-server: do not overwrite the DEVICE variable. +------------------------------------------------------------ +revno: 2115 +committer: Marc Gariepy +branch nick: ltsp-trunk +timestamp: Thu 2012-03-01 11:27:32 -0500 +message: + LANG=C isn't enough, on ubuntu 11.04 i need to set LANGUAGE too. +------------------------------------------------------------ +revno: 2114 +tags: ltsp-5.3.3 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Tue 2012-02-28 18:28:26 +0100 +message: + version 5.3.3 +------------------------------------------------------------ +revno: 2113 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 21:08:55 +0100 +message: + Moved some ltsp-init-common functions to init-ltsp.d scripts. +------------------------------------------------------------ +revno: 2112 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 19:50:39 +0100 +message: + Gentoo: put cron and syslog deps in package, start by default +------------------------------------------------------------ +revno: 2111 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 12:40:23 +0100 +message: + Gentoo: add client cron support +------------------------------------------------------------ +revno: 2110 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 11:53:37 +0100 +message: + Gentoo: updated rc initscripts +------------------------------------------------------------ +revno: 2109 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 11:41:10 +0100 +message: + Moved 50-mtab from common to Ubuntu, symlink to Debian. +------------------------------------------------------------ +revno: 2108 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 11:36:09 +0100 +message: + Gentoo: adding init-ltsp.d scripts +------------------------------------------------------------ +revno: 2107 +committer: Wim Muskee +branch nick: ltsp-trunk +timestamp: Sun 2012-02-26 10:48:25 +0100 +message: + Gentoo: separate build profiles for 5.3 client installs +------------------------------------------------------------ +revno: 2106 +committer: Vagrant Cascadian +branch nick: ltsp-trunk +timestamp: Fri 2012-02-24 18:00:18 -0800 +message: + Remove init-ltsp.d/*/50-localdev, which shouldn't be needed any longer. +------------------------------------------------------------ revno: 2105 tags: ltsp-5.3.2 committer: Stéphane Graber diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/04-server ltsp-5.3.5/client/init-ltsp.d/common/04-server --- ltsp-5.3.2/client/init-ltsp.d/common/04-server 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/04-server 2012-03-09 18:02:07.000000000 +0000 @@ -4,12 +4,12 @@ elif [ -n "$NFS_SERVER" ]; then export SERVER="$NFS_SERVER" else - test -f /proc/mounts && while read DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do - case $DEVICE in + test -f /proc/mounts && while read MOUNTED_DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do + case $MOUNTED_DEVICE in /dev/nbd[0-9]*) if [ "$MOUNTPOINT" = "/rofs" ] || [ "$MOUNTPOINT" = "/" ]; then # check for NBD devices - pid=$(nbd-client -c $DEVICE) + pid=$(nbd-client -c $MOUNTED_DEVICE) if grep -q '\-N' /proc/$pid/cmdline; then server=$(cut -d '' -f 2 /proc/$pid/cmdline) @@ -35,7 +35,7 @@ if [ "$FSTYPE" = "nfs" ]; then if [ "$MOUNTPOINT" = "/" ] || [ "$MOUNTPOINT" = "/rofs" ]; then # NFS root - server=${DEVICE%%:*} + server=${MOUNTED_DEVICE%%:*} echo NFS_SERVER=${server} >> /var/cache/ltsp/ltsp_config fi fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/20-modules ltsp-5.3.5/client/init-ltsp.d/common/20-modules --- ltsp-5.3.2/client/init-ltsp.d/common/20-modules 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/20-modules 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,4 @@ -# This file is sourced # Load extra modules here, in case they affect other plugins -load_modules || true +for module in $(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/g);do + modprobe $(echo $module|tr "*" " ") +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-cron ltsp-5.3.5/client/init-ltsp.d/common/50-cron --- ltsp-5.3.2/client/init-ltsp.d/common/50-cron 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-cron 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,9 @@ -# This file is sourced - -configure_cron || true +CRON_FILE=/etc/cron.d/ltsp +if [ ! -w "/etc/cron.d" ]; then + echo "Warning: /etc/cron.d is not writeable." + return 1 +fi +if [ -n "$SHUTDOWN_TIME" ] ; then + echo $SHUTDOWN_TIME | awk -F : '{print $2" "$1" * * * root test ! -S \"$(ls -1 /var/run/ldm_socket_* | head -1)\" && PATH=\$PATH:/sbin/ poweroff" }' >> $CRON_FILE +fi +env | sed -n 's/^CRONTAB_[0-9][0-9]=//p' >> $CRON_FILE diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-jetpipe ltsp-5.3.5/client/init-ltsp.d/common/50-jetpipe --- ltsp-5.3.2/client/init-ltsp.d/common/50-jetpipe 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-jetpipe 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,24 @@ -# This file is sourced +for I in 0 1 2; do + eval PRINTER_DEVICE=\$\{PRINTER_${I}_DEVICE\} + if [ -n "${PRINTER_DEVICE}" ]; then + eval PORT=\$\{PRINTER_${I}_PORT:="910${I}"\} + eval BAUD=\$\{PRINTER_${I}_SPEED:-"9600"\} + eval SIZE=\$\{PRINTER_${I}_DATABITS:-"8"\} + eval PARITY=\$\{PRINTER_${I}_PARITY:-"none"\} + eval FLOW=\$\{PRINTER_${I}_FLOWCTRL:-"soft"\} -configure_printer || true + JETPIPE_ARGS= + [ -n "$BAUD" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -b ${BAUD}" + [ -n "$SIZE" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -y ${SIZE}" + [ -n "$PARITY" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -p ${PARITY}" + if [ -n "$FLOW" ]; then + if [ "$FLOW" = "soft" ]; then + JETPIPE_ARGS="${JETPIPE_ARGS} -x" + else + JETPIPE_ARGS="${JETPIPE_ARGS} -r" + fi + fi + + /usr/sbin/jetpipe ${JETPIPE_ARGS} ${PRINTER_DEVICE} ${PORT} + fi +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-localdev ltsp-5.3.5/client/init-ltsp.d/common/50-localdev --- ltsp-5.3.2/client/init-ltsp.d/common/50-localdev 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-localdev 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# This file is sourced -# FIXME: This should happen out of udev, but perhaps -# udev needs to be retriggered for coldplug devices -# once switched to the rootfs -configure_localdev || true diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-mtab ltsp-5.3.5/client/init-ltsp.d/common/50-mtab --- ltsp-5.3.2/client/init-ltsp.d/common/50-mtab 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-mtab 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -# This file is sourced - -# make the chroot's /etc/mtab a file rather than a link -# because mountall.conf complains loudly -if [ -L /etc/mtab ]; then - rm /etc/mtab - :>/etc/mtab -fi - diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-rcfiles ltsp-5.3.5/client/init-ltsp.d/common/50-rcfiles --- ltsp-5.3.2/client/init-ltsp.d/common/50-rcfiles 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-rcfiles 2012-03-09 18:02:07.000000000 +0000 @@ -1,7 +1,4 @@ -# This file is sourced +# Sample rc.local may end with "exit 0", remove it if it's in the last line +sed '${/^exit 0$/d;}' -i /etc/rc.local -for rcfile in $(env|grep ^RCFILE_|sed -e s/^RCFILE_[0-9]*\=//|sed -e s/\ /*/g); do - rcf=`echo $rcfile |sed -e s/\*/\ /g` - rcexe=`echo $rcfile |sed -e s/\*.*//` - [ -x $rcexe ] && echo $rcf >> /etc/rc.local -done +env | sed -n 's/^RCFILE_[0-9][0-9]=//p' >> /etc/rc.local diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-saned ltsp-5.3.5/client/init-ltsp.d/common/50-saned --- ltsp-5.3.2/client/init-ltsp.d/common/50-saned 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-saned 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,3 @@ -# This file is sourced - -configure_scanner || true +if boolean_is_true "$SCANNER" ; then + saned -a +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-sendsigs ltsp-5.3.5/client/init-ltsp.d/common/50-sendsigs --- ltsp-5.3.2/client/init-ltsp.d/common/50-sendsigs 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-sendsigs 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,14 @@ -# This file is sourced +if [ -n "$NBD_ROOT_HOST" ]; then + # register pids of nbd-client and nbd-proxy so that sendsigs doesn't kill + # them on shutdown/reboot. -nbd_sendsigs_protection || true + # FIXME: only register pids relevent to the root filesystem. + nbd_pids=$(pgrep '^nbd-client|^nbd-proxy') + for d in /run/sendsigs.omit.d /lib/init/rw/sendsigs.omit.d /var/run/sendsigs.omit.d ; do + if [ -d "$d" ]; then + for p in $nbd_pids ; do + echo "$p" >> "$d"/ltsp || true + done + fi + done +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-set-time ltsp-5.3.5/client/init-ltsp.d/common/50-set-time --- ltsp-5.3.2/client/init-ltsp.d/common/50-set-time 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-set-time 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,14 @@ -# This file is sourced +# Set up timezone +if [ -n "$TIMEZONE" ] && [ -e "/usr/share/zoneinfo/$TIMEZONE" ]; then + cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime 2>/dev/null +fi -set_time || true +# Set timeserver to $SERVER if set to autodetect +if [ "$TIMESERVER" = "auto" ]; then + TIMESERVER=${SERVER} +fi + +# Set up timeserver +if [ -n "$TIMESERVER" ]; then + ntpdate $TIMESERVER && hwclock --systohc --${HWCLOCK:-"utc"} --noadjfile || true +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/common/50-syslog ltsp-5.3.5/client/init-ltsp.d/common/50-syslog --- ltsp-5.3.2/client/init-ltsp.d/common/50-syslog 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/common/50-syslog 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,12 @@ -# This file is sourced - -configure_syslog || true +if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then + syslog_conf=/etc/syslog.conf + if [ -d /etc/rsyslog.d ]; then + syslog_conf=/etc/rsyslog.d/ltsp.conf + touch $syslog_conf + fi + if [ -f "$syslog_conf" ]; then + cat < "$syslog_conf" +*.* @${SYSLOG_HOST:-$SERVER} +EOF + fi +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/04-server ltsp-5.3.5/client/init-ltsp.d/Debian/04-server --- ltsp-5.3.2/client/init-ltsp.d/Debian/04-server 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/04-server 2012-03-09 18:02:07.000000000 +0000 @@ -4,12 +4,12 @@ elif [ -n "$NFS_SERVER" ]; then export SERVER="$NFS_SERVER" else - test -f /proc/mounts && while read DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do - case $DEVICE in + test -f /proc/mounts && while read MOUNTED_DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do + case $MOUNTED_DEVICE in /dev/nbd[0-9]*) if [ "$MOUNTPOINT" = "/rofs" ] || [ "$MOUNTPOINT" = "/" ]; then # check for NBD devices - pid=$(nbd-client -c $DEVICE) + pid=$(nbd-client -c $MOUNTED_DEVICE) if grep -q '\-N' /proc/$pid/cmdline; then server=$(cut -d '' -f 2 /proc/$pid/cmdline) @@ -35,7 +35,7 @@ if [ "$FSTYPE" = "nfs" ]; then if [ "$MOUNTPOINT" = "/" ] || [ "$MOUNTPOINT" = "/rofs" ]; then # NFS root - server=${DEVICE%%:*} + server=${MOUNTED_DEVICE%%:*} echo NFS_SERVER=${server} >> /var/cache/ltsp/ltsp_config fi fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/20-modules ltsp-5.3.5/client/init-ltsp.d/Debian/20-modules --- ltsp-5.3.2/client/init-ltsp.d/Debian/20-modules 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/20-modules 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,4 @@ -# This file is sourced # Load extra modules here, in case they affect other plugins -load_modules || true +for module in $(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/g);do + modprobe $(echo $module|tr "*" " ") +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-cron ltsp-5.3.5/client/init-ltsp.d/Debian/50-cron --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-cron 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-cron 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,9 @@ -# This file is sourced - -configure_cron || true +CRON_FILE=/etc/cron.d/ltsp +if [ ! -w "/etc/cron.d" ]; then + echo "Warning: /etc/cron.d is not writeable." + return 1 +fi +if [ -n "$SHUTDOWN_TIME" ] ; then + echo $SHUTDOWN_TIME | awk -F : '{print $2" "$1" * * * root test ! -S \"$(ls -1 /var/run/ldm_socket_* | head -1)\" && PATH=\$PATH:/sbin/ poweroff" }' >> $CRON_FILE +fi +env | sed -n 's/^CRONTAB_[0-9][0-9]=//p' >> $CRON_FILE diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-disable-cronjobs ltsp-5.3.5/client/init-ltsp.d/Debian/50-disable-cronjobs --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-disable-cronjobs 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-disable-cronjobs 2012-03-09 18:02:07.000000000 +0000 @@ -1,11 +1,17 @@ -# This file is sourced - # Disable several cronjobs that are usually present but that -# Cause unnecessary load +# cause unnecessary load. -for f in /etc/cron.daily/man-db \ - /etc/cron.weekly/man-db \ - /etc/cron.weekly/apt-xapian-index -do - rm -f ${f} 2>/dev/null -done +while read job; do + rm -f "$job" +done <> /etc/rc.local -done +env | sed -n 's/^RCFILE_[0-9][0-9]=//p' >> /etc/rc.local diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-rm-system-services ltsp-5.3.5/client/init-ltsp.d/Debian/50-rm-system-services --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-rm-system-services 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-rm-system-services 2012-03-09 18:02:07.000000000 +0000 @@ -3,18 +3,23 @@ # or RM_THIN_SYSTEM_SERVICES lists in lts.conf. The RM_THIN_SYSTEM_SERVICES list # is ignored by fat clients. # KEEP_SYSTEM_SERVICES is a space separated whitelist of services. -# Hint: for really low RAM thin clients, set the following in lts.conf: -# RM_THIN_SYSTEM_SERVICES="anacron cron dbus rsyslog tty1 upstart-udev-bridge" -while read service description; do - case " $KEEP_SYSTEM_SERVICES " in - *" $service "*) - ;; - *) - RM_SYSTEM_SERVICES="$RM_SYSTEM_SERVICES $service" - ;; - esac -done < name mapper +portmap # RPC portmapper replacement +rpcbind-boot # RPC portmapper replacement +")" fi for service in $rm_services; do diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-saned ltsp-5.3.5/client/init-ltsp.d/Debian/50-saned --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-saned 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-saned 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,3 @@ -# This file is sourced - -configure_scanner || true +if boolean_is_true "$SCANNER" ; then + saned -a +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-sendsigs ltsp-5.3.5/client/init-ltsp.d/Debian/50-sendsigs --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-sendsigs 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-sendsigs 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,14 @@ -# This file is sourced +if [ -n "$NBD_ROOT_HOST" ]; then + # register pids of nbd-client and nbd-proxy so that sendsigs doesn't kill + # them on shutdown/reboot. -nbd_sendsigs_protection || true + # FIXME: only register pids relevent to the root filesystem. + nbd_pids=$(pgrep '^nbd-client|^nbd-proxy') + for d in /run/sendsigs.omit.d /lib/init/rw/sendsigs.omit.d /var/run/sendsigs.omit.d ; do + if [ -d "$d" ]; then + for p in $nbd_pids ; do + echo "$p" >> "$d"/ltsp || true + done + fi + done +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-set-time ltsp-5.3.5/client/init-ltsp.d/Debian/50-set-time --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-set-time 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-set-time 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,14 @@ -# This file is sourced +# Set up timezone +if [ -n "$TIMEZONE" ] && [ -e "/usr/share/zoneinfo/$TIMEZONE" ]; then + cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime 2>/dev/null +fi -set_time || true +# Set timeserver to $SERVER if set to autodetect +if [ "$TIMESERVER" = "auto" ]; then + TIMESERVER=${SERVER} +fi + +# Set up timeserver +if [ -n "$TIMESERVER" ]; then + ntpdate $TIMESERVER && hwclock --systohc --${HWCLOCK:-"utc"} --noadjfile || true +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/50-syslog ltsp-5.3.5/client/init-ltsp.d/Debian/50-syslog --- ltsp-5.3.2/client/init-ltsp.d/Debian/50-syslog 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/50-syslog 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,12 @@ -# This file is sourced - -configure_syslog || true +if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then + syslog_conf=/etc/syslog.conf + if [ -d /etc/rsyslog.d ]; then + syslog_conf=/etc/rsyslog.d/ltsp.conf + touch $syslog_conf + fi + if [ -f "$syslog_conf" ]; then + cat < "$syslog_conf" +*.* @${SYSLOG_HOST:-$SERVER} +EOF + fi +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Debian/60-screen-sessions ltsp-5.3.5/client/init-ltsp.d/Debian/60-screen-sessions --- ltsp-5.3.2/client/init-ltsp.d/Debian/60-screen-sessions 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Debian/60-screen-sessions 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -# This file is sourced -# -# Generate upstart services for all screens specified in lts.conf - -for i in 01 02 03 04 05 06 07 08 09 10 11 12; do - eval num=\$SCREEN_$screen - [ -n "$num" ] || continue - echo </etc/init/screen_session${i}.conf -# screen_session${i}.conf -# -# Automatically generated by init-ltsp.d scripts -# - -description "LTSP screen ${i}" -author "Gideon Romm" - -start on (filesystem - and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 - or stopped udevtrigger)) -stop on runlevel [016] - -pre-start script - [ -r "/usr/share/ltsp/ltsp_config" ] && . /usr/share/ltsp/ltsp_config - - # Find current tty, and if it is not the same as SCREEN_DEFAULT, chvt - if [ -n "${SCREEN_DEFAULT}" ]; then - chvt ${SCREEN_DEFAULT} - fi -end script - -respawn -script - if [ -r /etc/default/locale ]; then - . /etc/default/locale - export LANG LANGUAGE - elif [ -r /etc/environment ]; then - . /etc/environment - export LANG LANGUAGE - fi - - exec /usr/share/ltsp/screen_session ${i} -end script - -EOF - -done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/00-bindmounts ltsp-5.3.5/client/init-ltsp.d/Gentoo/00-bindmounts --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/00-bindmounts 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/00-bindmounts 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,53 @@ +# This is not the preferred solution +# rather bind or union mount from initramfs + +# tmpfs directory mounted when using tmpfs/bind +tmpfs_dir=/var/lib/ltsp-client-setup + +# size of tmpfs mount +tmpfs_size=10m + +# tmpfs/bind directions that get mounted with only directory structure preserved +rw_dirs="/var/lib/xkb /var/log /var/spool /var/tmp /tmp /var/run /var/lib/pulse" + +# tmpfs/bind directions that get mounted with directory structure and data copied +copy_dirs="/root /home /etc/conf.d /etc/cron.d /etc/runlevels /etc/udev/rules.d /var/cache/ltsp /var/cache/ltsp-localapps" + +# tmpfs/bind files that mounted on top of other files +bindfiles="/etc/hosts /etc/syslog.conf /etc/fstab /etc/resolv.conf /etc/passwd /etc/group /etc/localtime /etc/lts.conf /etc/mtab" + + +# set defaults +test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup +mount -t tmpfs -o mode=0755 tmpfs $tmpfs_dir +# preserve directory structure +for d in $rw_dirs ; do + if [ -d "$d" ]; then + cd $tmpfs_dir + tar --no-recursion -cpf - $(find $d -type d 2> /dev/null) 2> /dev/null | tar xpf - + mount --bind $tmpfs_dir/$d $d + else + echo "WARNING: $d does not exist" + fi +done +# copy contents into tmpfs +for d in $copy_dirs; do + if [ -d "$d" ]; then + cd $tmpfs_dir + tar -cpf - $d 2> /dev/null | tar xpf - + mount --bind $tmpfs_dir/$d $d + else + echo "WARNING: $d does not exist" + fi +done + +# mount one file on top of another +for f in $bindfiles ; do + if [ -e "$f" ]; then + mkdir -p "$(dirname $tmpfs_dir/$f)" + cp $f $tmpfs_dir/$f + mount --bind $tmpfs_dir/$f $f + else + echo "WARNING: $f does not exist" + fi +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/01-clean-cache ltsp-5.3.5/client/init-ltsp.d/Gentoo/01-clean-cache --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/01-clean-cache 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/01-clean-cache 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,6 @@ +# Make sure our cache dirs are there +mkdir -p /var/cache/ltsp +mkdir -p /var/cache/ltsp-localapps + +# Also delete the cache files in case they exist in the underlying root rofs. +rm -f /var/cache/ltsp/ltsp_config /var/cache/ltsp/ltsp_config_env diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/02-initramfs-env ltsp-5.3.5/client/init-ltsp.d/Gentoo/02-initramfs-env --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/02-initramfs-env 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/02-initramfs-env 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,8 @@ +# Source some files saved by the initramfs. +# Those environment variables, e.g. HOSTNAME, can be overriden by lts.conf. + +for netfile in /var/cache/ltsp/net-*.conf ; do + if [ -f "$netfile" ]; then + . "$netfile" + fi +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/03-kernel-cmdline ltsp-5.3.5/client/init-ltsp.d/Gentoo/03-kernel-cmdline --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/03-kernel-cmdline 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/03-kernel-cmdline 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,67 @@ +# Get NBD_ROOT_HOST or NFS_SERVER from the kernel command line. + +if [ -n "$NBD_ROOT_HOST" ] || [ -n "$NFS_SERVER" ]; then + return +fi + +for x in $(cat /proc/cmdline); do + case "$x" in + nbdroot=*) + netroot="${x#nbdroot=}" + nbd=true + break + ;; + nfsroot=*) + netroot="${x#nfsroot=}" + nfs=true + break + ;; + esac +done + +# The code below is stripped from local-top/nbd +case "$netroot" in + \[*\]*) + # [ipv6]:port/path + netsrv=${netroot%\]*} + netsrv=${netsrv#\[} + netportpath=${netroot#\[$netsrv\]} + netportpath=${netportpath#:} + netport=${netportpath%%/*} + netpath=${netportpath#$netport} + ;; + *) + # ipv4:port/path + netsrv=${netroot%%[:/]*} + netportpath=${netroot#$netsrv} + netportpath=${netportpath#:} + netport=${netportpath%%/*} + netpath=${netportpath#$netport} + ;; +esac + +# If not specified in the kernel cmdline, use the value from DHCP +netsrv=${netsrv:-$ROOTSERVER} + +if [ -n "$nbd" ]; then + export NBD_ROOT_HOST="$netsrv" + echo "NBD_ROOT_HOST=$NBD_ROOT_HOST" + case "$netport" in + *[!0-9]*) + # non-numeric characters, assume a name rather than a port + netpath="$netport" + unset netport + ;; + esac + if [ -n "$netpath" ]; then + export NBD_ROOT_NAME="$netpath" + echo "NBD_ROOT_NAME=$NBD_ROOT_NAME" + fi + if [ -n "$netport" ]; then + export NBD_ROOT_PORT="$netport" + echo "NBD_ROOT_PORT=$NBD_ROOT_PORT" + fi +elif [ -n "$nfs" ]; then + export NFS_SERVER="$netsrv" + echo "NFS_SERVER=$NFS_SERVER" +fi >> /var/cache/ltsp/ltsp_config diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/04-server ltsp-5.3.5/client/init-ltsp.d/Gentoo/04-server --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/04-server 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/04-server 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,50 @@ +# Ensure a default for SERVER. It may be overriden later on by lts.conf. +if [ -n "$NBD_ROOT_HOST" ]; then + export SERVER="$NBD_ROOT_HOST" +elif [ -n "$NFS_SERVER" ]; then + export SERVER="$NFS_SERVER" +else + test -f /proc/mounts && while read MOUNTED_DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do + case $MOUNTED_DEVICE in + /dev/nbd[0-9]*) + if [ "$MOUNTPOINT" = "/rofs" ] || [ "$MOUNTPOINT" = "/" ]; then + # check for NBD devices + pid=$(nbd-client -c $MOUNTED_DEVICE) + + if grep -q '\-N' /proc/$pid/cmdline; then + server=$(cut -d '' -f 2 /proc/$pid/cmdline) + name=$(cut -d '' -f 5 /proc/$pid/cmdline) + else + server=$(cut -d '' -f 2 /proc/$pid/cmdline) + port=$(cut -d '' -f 3 /proc/$pid/cmdline) + fi + + # Check for nbd-proxy + if [ "$server" = "127.0.0.1" ]; then + server=$(ps --no-headers -o cmd x | grep "^nbd-proxy [[:graph:]]* [[:graph:]]* ${port}" | cut -d ' ' -f2) + fi + fi + echo "NBD_ROOT_HOST=${server}" >> /var/cache/ltsp/ltsp_config + if [ -n "$name" ]; then + echo "NBD_ROOT_NAME=${name}" >> /var/cache/ltsp/ltsp_config + else + echo "NBD_ROOT_PORT=${port}" >> /var/cache/ltsp/ltsp_config + fi + ;; + *) + if [ "$FSTYPE" = "nfs" ]; then + if [ "$MOUNTPOINT" = "/" ] || [ "$MOUNTPOINT" = "/rofs" ]; then + # NFS root + server=${MOUNTED_DEVICE%%:*} + echo NFS_SERVER=${server} >> /var/cache/ltsp/ltsp_config + fi + fi + ;; + esac + [ -n "$server" ] && break + done < /proc/mounts + + SERVER="${server:-$ROOTSERVER}" + export SERVER="${SERVER:-192.168.0.1}" +fi +echo "SERVER=$SERVER" >> /var/cache/ltsp/ltsp_config diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/05-getltsconffile ltsp-5.3.5/client/init-ltsp.d/Gentoo/05-getltsconffile --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/05-getltsconffile 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/05-getltsconffile 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,22 @@ +# Attempt to get lts.conf via tftp + +arch=$(uname -m | sed -e 's:i[3-6]86:x86:' -e 's:x86_64:amd64:' -e 's:parisc:hppa:') +tftppath="/ltsp/${arch}/lts.conf" +lts_conf_temp=$(mktemp) + +tftp "$SERVER" -c get ${tftppath} $lts_conf_temp >/dev/null + +# or if tftp gives a buffer overflow error, use curl +# https://bugs.archlinux.org/task/28103 +# curl "tftp://${SERVER}${tftppath}" -o $lts_conf_temp >/dev/null + +# only overwrite lts.conf if it has non-zero size. +if [ -s "$lts_conf_temp" ]; then + # doing copy, getting inter-device move fail (because of bind mounts?) + cp "$lts_conf_temp" /etc/lts.conf +fi + +rm "$lts_conf_temp" + +# Get the lts.conf vars into the environment +. /usr/share/ltsp/ltsp_config diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/06-ltsp-init-common ltsp-5.3.5/client/init-ltsp.d/Gentoo/06-ltsp-init-common --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/06-ltsp-init-common 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/06-ltsp-init-common 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,3 @@ +# This file is sourced + +. /usr/share/ltsp/ltsp-init-common diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/09-hostname ltsp-5.3.5/client/init-ltsp.d/Gentoo/09-hostname --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/09-hostname 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/09-hostname 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,28 @@ +if [ -z "$HOSTNAME" ]; then + HOSTNAME_BASE=${HOSTNAME_BASE:-ltsp} + case "$HOSTNAME_EXTRA" in + mac) + HOSTNAME_EXTRA=$(ip link show $DEVICE | awk '/ether/{print $2}' | tr ':' '-') + ;; + ip|"") + HOSTNAME_EXTRA=$(echo "$IPV4ADDR.$IPV4NETMASK" | awk -F "." '{ print (($1%(256-$5)*256+$2%(256-$6))*256+$3%(256-$7))*256+$4%(256-$8) }') + ;; + esac + HOSTNAME="$HOSTNAME_BASE$HOSTNAME_EXTRA" +fi + +hostname "$HOSTNAME" +echo "hostname=\"$HOSTNAME\"" > /etc/conf.d/hostname + +cat < /etc/hosts +127.0.0.1 localhost +127.0.0.2 $HOSTNAME +$SERVER server + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +EOF diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/10-resolv-conf ltsp-5.3.5/client/init-ltsp.d/Gentoo/10-resolv-conf --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/10-resolv-conf 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/10-resolv-conf 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,40 @@ +# This file is sourced. + +# set to defaults from DHCP if not specified in lts.conf +if [ -z "$DNS_SERVER" ]; then + for dns in $IPV4DNS0 $IPV4DNS1 ; do + # ignore nameserver of 0.0.0.0, which ipconfig may return if both + # nameservers aren't specified. + if [ "$dns" != "0.0.0.0" ]; then + DNS_SERVER="$DNS_SERVER $dns" + fi + done +fi + +if [ -z "$SEARCH_DOMAIN" ] && [ -n "$DNSDOMAIN" ]; then + SEARCH_DOMAIN="$DNSDOMAIN" +fi + +# Apply the dns info that was received from dhcp or from lts.conf +if [ -n "$DNS_SERVER" ] || [ -n "$SEARCH_DOMAIN" ]; then + # Deal with resolvconf + if [ -x /sbin/resolvconf ] && ( [ -L /etc/resolv.conf ] || [ -e /var/lib/resolvconf/convert ] ); then + mkdir -p /run/resolvconf/interface/ + resolv_method=resolvconf + resolv=/run/resolvconf/interface/LTSP + else + resolv_method=static + resolv=/etc/resolv.conf + fi + + # Check if $resolv is writable + if echo '# Generated by ltsp' 2>/dev/null > "$resolv"; then + if [ -n "$SEARCH_DOMAIN" ]; then + echo "search $SEARCH_DOMAIN" >> "$resolv" + fi + for n in $DNS_SERVER; do + echo "nameserver $n" >> "$resolv" + done + fi +fi +true diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/20-modules ltsp-5.3.5/client/init-ltsp.d/Gentoo/20-modules --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/20-modules 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/20-modules 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,4 @@ +# Load extra modules here, in case they affect other plugins +for module in $(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/g);do + modprobe $(echo $module|tr "*" " ") +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-console ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-console --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-console 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-console 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,3 @@ +if [ -n "$CONSOLE_KEYMAP" ]; then + sed -i "s/keymap=\"us\"/keymap=\"${CONSOLE_KEYMAP}\"/" /etc/conf.d/keymaps +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-cron ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-cron --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-cron 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-cron 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,9 @@ +CRON_FILE=/etc/cron.d/ltsp +if [ ! -w "/etc/cron.d" ]; then + echo "Warning: /etc/cron.d is not writeable." + return 1 +fi +if [ -n "$SHUTDOWN_TIME" ] ; then + echo $SHUTDOWN_TIME | awk -F : '{print $2" "$1" * * * root test ! -S \"$(ls -1 /var/run/ldm_socket_* | head -1)\" && PATH=\$PATH:/sbin/ poweroff" }' >> $CRON_FILE +fi +env | sed -n 's/^CRONTAB_[0-9][0-9]=//p' >> $CRON_FILE diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-fstab ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-fstab --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-fstab 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-fstab 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,27 @@ +if [ -n "$CONFIGURE_FSTAB" ] && ! boolean_is_true "$CONFIGURE_FSTAB"; then + return +fi + +cat >/etc/fstab < +proc /proc proc nodev,noexec,nosuid 0 0 +EOF + +# Backwards compatibility for the deprecated NFS_HOME lts.conf option +if [ -n "$NFS_HOME" ]; then + # if $NFS_HOME doesn't contain a :/ part + if [ "$NFS_HOME" = ${NFS_HOME#*:} ]; then + # Ensure that it begins with a slash, and also add the server + NFS_HOME="/${NFS_HOME#/}" + NFS_HOME="$SERVER:$NFS_HOME" + fi + mntpt=${NFS_HOME##*:} + test -n "$mntpt" && mkdir -p "$mntpt" + NFS_HOME_OPTIONS=${NFS_HOME_OPTIONS:-defaults} + echo "$NFS_HOME $mntpt nfs $NFS_HOME_OPTIONS 0 0" >> /etc/fstab +fi + +# Put FSTAB_0 to FSTAB_9 lts.conf options to fstab +env | sed -n '/^FSTAB_[0-9]=/s///p' >> /etc/fstab diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-interfaces ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-interfaces --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-interfaces 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-interfaces 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,11 @@ +# This file is sourced + +# prohibit network-manager from messing with the boot interface +if [ -w "/etc/network/interfaces" ]; then + if [ -n "$DEVICE" ]; then + echo "" + echo "auto $DEVICE" + echo "iface $DEVICE inet manual" + fi >> "/etc/network/interfaces" 2>/dev/null || true +fi + diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-jetpipe ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-jetpipe --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-jetpipe 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-jetpipe 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,24 @@ +for I in 0 1 2; do + eval PRINTER_DEVICE=\$\{PRINTER_${I}_DEVICE\} + if [ -n "${PRINTER_DEVICE}" ]; then + eval PORT=\$\{PRINTER_${I}_PORT:="910${I}"\} + eval BAUD=\$\{PRINTER_${I}_SPEED:-"9600"\} + eval SIZE=\$\{PRINTER_${I}_DATABITS:-"8"\} + eval PARITY=\$\{PRINTER_${I}_PARITY:-"none"\} + eval FLOW=\$\{PRINTER_${I}_FLOWCTRL:-"soft"\} + + JETPIPE_ARGS= + [ -n "$BAUD" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -b ${BAUD}" + [ -n "$SIZE" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -y ${SIZE}" + [ -n "$PARITY" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -p ${PARITY}" + if [ -n "$FLOW" ]; then + if [ "$FLOW" = "soft" ]; then + JETPIPE_ARGS="${JETPIPE_ARGS} -x" + else + JETPIPE_ARGS="${JETPIPE_ARGS} -r" + fi + fi + + /usr/sbin/jetpipe ${JETPIPE_ARGS} ${PRINTER_DEVICE} ${PORT} + fi +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-rcfiles ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-rcfiles --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-rcfiles 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-rcfiles 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,5 @@ +# This file is sourced + +rc-update add ltsp-client default +rc-update add sysklogd default +rc-update add vixie-cron default diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-saned ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-saned --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-saned 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-saned 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,3 @@ +if boolean_is_true "$SCANNER" ; then + saned -a +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-sendsigs ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-sendsigs --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-sendsigs 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-sendsigs 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,14 @@ +if [ -n "$NBD_ROOT_HOST" ]; then + # register pids of nbd-client and nbd-proxy so that sendsigs doesn't kill + # them on shutdown/reboot. + + # FIXME: only register pids relevent to the root filesystem. + nbd_pids=$(pgrep '^nbd-client|^nbd-proxy') + for d in /run/sendsigs.omit.d /lib/init/rw/sendsigs.omit.d /var/run/sendsigs.omit.d ; do + if [ -d "$d" ]; then + for p in $nbd_pids ; do + echo "$p" >> "$d"/ltsp || true + done + fi + done +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-set-time ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-set-time --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-set-time 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-set-time 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,14 @@ +# Set up timezone +if [ -n "$TIMEZONE" ] && [ -e "/usr/share/zoneinfo/$TIMEZONE" ]; then + cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime 2>/dev/null +fi + +# Set timeserver to $SERVER if set to autodetect +if [ "$TIMESERVER" = "auto" ]; then + TIMESERVER=${SERVER} +fi + +# Set up timeserver +if [ -n "$TIMESERVER" ]; then + ntpdate $TIMESERVER && hwclock --systohc --${HWCLOCK:-"utc"} --noadjfile || true +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-swap ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-swap --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-swap 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-swap 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,58 @@ +if boolean_is_true "$USE_LOCAL_SWAP" ; then + # Enable local swap partition if found on local disk + for part in `sfdisk -l 2>/dev/null | awk '/ 82 / { print $1}'`; do + swap_devices="$swap_devices $part" + done +fi + +# Set NBD_SWAP=true by default for clients with RAM < NBD_SWAP_THRESHOLD +if [ -z "$NBD_SWAP" ]; then + # Set reasonable defaults for NBD_SWAP_THRESHOLD (in MB) + if [ -z "$NBD_SWAP_THRESHOLD" ]; then + if boolean_is_true "$LTSP_FATCLIENT"; then + NBD_SWAP_THRESHOLD=800 + else + NBD_SWAP_THRESHOLD=300 + fi + fi + memtotal=$(sed -n 's/MemTotal: *\([0-9]*\) .*/\1/p' /proc/meminfo) + if [ "$memtotal" -lt $((1024*$NBD_SWAP_THRESHOLD)) ]; then + NBD_SWAP=true + fi +fi + +if boolean_is_true "$NBD_SWAP" ; then + NBD_SWAP_HOST=${NBD_SWAP_HOST:-"$SERVER"} + modprobe nbd + # Detect first unused nbd device, skip nbd0 + for num in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do + nbd-client -c /dev/nbd${num} > /dev/null + [ $? -eq 1 ] && break + done + # TODO: add -persist here when LP: #938511 is solved, but also verify that + # we'll get the same file from the server without `mkswap` called again. + nbd-client $NBD_SWAP_HOST -N swap /dev/nbd${num} -swap && \ + swap_devices="$swap_devices /dev/nbd${num}" +fi + +if boolean_is_true "$ENCRYPT_SWAP" ; then + if [ -x /sbin/cryptsetup ]; then + modprobe dm_crypt + else + echo "ERROR: ENCRYPT_SWAP=Y, but /sbin/cryptsetup not found. disabling swap." + swap_devices="" + fi +fi + +num=0 +for device in $swap_devices ; do + swap="$device" + if boolean_is_true "$ENCRYPT_SWAP" ; then + if [ -x /sbin/cryptsetup ]; then + cryptsetup -d /dev/urandom create swap$num $swap && swap="/dev/mapper/swap$num" + num=$(($num+1)) + fi + mkswap $swap + fi + swapon $swap +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-syslog ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-syslog --- ltsp-5.3.2/client/init-ltsp.d/Gentoo/50-syslog 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Gentoo/50-syslog 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,12 @@ +if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then + syslog_conf=/etc/syslog.conf + if [ -d /etc/rsyslog.d ]; then + syslog_conf=/etc/rsyslog.d/ltsp.conf + touch $syslog_conf + fi + if [ -f "$syslog_conf" ]; then + cat < "$syslog_conf" +*.* @${SYSLOG_HOST:-$SERVER} +EOF + fi +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/04-server ltsp-5.3.5/client/init-ltsp.d/Ubuntu/04-server --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/04-server 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/04-server 2012-03-09 18:02:07.000000000 +0000 @@ -4,12 +4,12 @@ elif [ -n "$NFS_SERVER" ]; then export SERVER="$NFS_SERVER" else - test -f /proc/mounts && while read DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do - case $DEVICE in + test -f /proc/mounts && while read MOUNTED_DEVICE MOUNTPOINT FSTYPE OPTIONS PASS1 PASS2; do + case $MOUNTED_DEVICE in /dev/nbd[0-9]*) if [ "$MOUNTPOINT" = "/rofs" ] || [ "$MOUNTPOINT" = "/" ]; then # check for NBD devices - pid=$(nbd-client -c $DEVICE) + pid=$(nbd-client -c $MOUNTED_DEVICE) if grep -q '\-N' /proc/$pid/cmdline; then server=$(cut -d '' -f 2 /proc/$pid/cmdline) @@ -35,7 +35,7 @@ if [ "$FSTYPE" = "nfs" ]; then if [ "$MOUNTPOINT" = "/" ] || [ "$MOUNTPOINT" = "/rofs" ]; then # NFS root - server=${DEVICE%%:*} + server=${MOUNTED_DEVICE%%:*} echo NFS_SERVER=${server} >> /var/cache/ltsp/ltsp_config fi fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/20-modules ltsp-5.3.5/client/init-ltsp.d/Ubuntu/20-modules --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/20-modules 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/20-modules 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,4 @@ -# This file is sourced # Load extra modules here, in case they affect other plugins -load_modules || true +for module in $(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/g);do + modprobe $(echo $module|tr "*" " ") +done diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-cron ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-cron --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-cron 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-cron 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,9 @@ -# This file is sourced - -configure_cron || true +CRON_FILE=/etc/cron.d/ltsp +if [ ! -w "/etc/cron.d" ]; then + echo "Warning: /etc/cron.d is not writeable." + return 1 +fi +if [ -n "$SHUTDOWN_TIME" ] ; then + echo $SHUTDOWN_TIME | awk -F : '{print $2" "$1" * * * root test ! -S \"$(ls -1 /var/run/ldm_socket_* | head -1)\" && PATH=\$PATH:/sbin/ poweroff" }' >> $CRON_FILE +fi +env | sed -n 's/^CRONTAB_[0-9][0-9]=//p' >> $CRON_FILE diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-disable-cronjobs ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-disable-cronjobs --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-disable-cronjobs 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-disable-cronjobs 2012-03-09 18:02:07.000000000 +0000 @@ -1,11 +1,17 @@ -# This file is sourced - # Disable several cronjobs that are usually present but that -# Cause unnecessary load +# cause unnecessary load. -for f in /etc/cron.daily/man-db \ - /etc/cron.weekly/man-db \ - /etc/cron.weekly/apt-xapian-index -do - rm -f ${f} 2>/dev/null -done +while read job; do + rm -f "$job" +done <> /etc/rc.local -done +env | sed -n 's/^RCFILE_[0-9][0-9]=//p' >> /etc/rc.local diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-rm-system-services ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-rm-system-services --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-rm-system-services 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-rm-system-services 2012-03-09 18:02:07.000000000 +0000 @@ -3,18 +3,23 @@ # or RM_THIN_SYSTEM_SERVICES lists in lts.conf. The RM_THIN_SYSTEM_SERVICES list # is ignored by fat clients. # KEEP_SYSTEM_SERVICES is a space separated whitelist of services. -# Hint: for really low RAM thin clients, set the following in lts.conf: -# RM_THIN_SYSTEM_SERVICES="anacron cron dbus rsyslog tty1 upstart-udev-bridge" -while read service description; do - case " $KEEP_SYSTEM_SERVICES " in - *" $service "*) - ;; - *) - RM_SYSTEM_SERVICES="$RM_SYSTEM_SERVICES $service" - ;; - esac -done < name mapper +portmap # RPC portmapper replacement +rpcbind-boot # RPC portmapper replacement +")" fi for service in $rm_services; do diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-sendsigs ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-sendsigs --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-sendsigs 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-sendsigs 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,14 @@ -# This file is sourced +if [ -n "$NBD_ROOT_HOST" ]; then + # register pids of nbd-client and nbd-proxy so that sendsigs doesn't kill + # them on shutdown/reboot. -nbd_sendsigs_protection || true + # FIXME: only register pids relevent to the root filesystem. + nbd_pids=$(pgrep '^nbd-client|^nbd-proxy') + for d in /run/sendsigs.omit.d /lib/init/rw/sendsigs.omit.d /var/run/sendsigs.omit.d ; do + if [ -d "$d" ]; then + for p in $nbd_pids ; do + echo "$p" >> "$d"/ltsp || true + done + fi + done +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-syslog ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-syslog --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-syslog 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-syslog 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,12 @@ -# This file is sourced - -configure_syslog || true +if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then + syslog_conf=/etc/syslog.conf + if [ -d /etc/rsyslog.d ]; then + syslog_conf=/etc/rsyslog.d/ltsp.conf + touch $syslog_conf + fi + if [ -f "$syslog_conf" ]; then + cat < "$syslog_conf" +*.* @${SYSLOG_HOST:-$SERVER} +EOF + fi +fi diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-update-motd ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-update-motd --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/50-update-motd 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/50-update-motd 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,6 @@ +# /etc/init/mounted-run.conf calls `run-parts /etc/update-motd.d`, and that +# takes more than a (completely useless) second. But we don't want to remove +# the whole mounted-run service as it prepares /run too. So remove most scripts +# there but leave the header and footer. + +rm -f /etc/update-motd.d/[1-9][0-8]* diff -Nru ltsp-5.3.2/client/init-ltsp.d/Ubuntu/60-screen-sessions ltsp-5.3.5/client/init-ltsp.d/Ubuntu/60-screen-sessions --- ltsp-5.3.2/client/init-ltsp.d/Ubuntu/60-screen-sessions 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/init-ltsp.d/Ubuntu/60-screen-sessions 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -# This file is sourced -# -# Generate upstart services for all screens specified in lts.conf - -for i in 01 02 03 04 05 06 07 08 09 10 11 12; do - eval num=\$SCREEN_$screen - [ -n "$num" ] || continue - echo </etc/init/screen_session${i}.conf -# screen_session${i}.conf -# -# Automatically generated by init-ltsp.d scripts -# - -description "LTSP screen ${i}" -author "Gideon Romm" - -start on (filesystem - and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 - or stopped udevtrigger)) -stop on runlevel [016] - -pre-start script - [ -r "/usr/share/ltsp/ltsp_config" ] && . /usr/share/ltsp/ltsp_config - - # Find current tty, and if it is not the same as SCREEN_DEFAULT, chvt - if [ -n "${SCREEN_DEFAULT}" ]; then - chvt ${SCREEN_DEFAULT} - fi -end script - -respawn -script - if [ -r /etc/default/locale ]; then - . /etc/default/locale - export LANG LANGUAGE - elif [ -r /etc/environment ]; then - . /etc/environment - export LANG LANGUAGE - fi - - exec /usr/share/ltsp/screen_session ${i} -end script - -EOF - -done diff -Nru ltsp-5.3.2/client/initscripts/Gentoo/ltsp-client.initd ltsp-5.3.5/client/initscripts/Gentoo/ltsp-client.initd --- ltsp-5.3.2/client/initscripts/Gentoo/ltsp-client.initd 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/Gentoo/ltsp-client.initd 2012-03-09 18:02:07.000000000 +0000 @@ -1,10 +1,9 @@ #!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ depend() { - need ltsp-client-setup after alsasound } diff -Nru ltsp-5.3.2/client/initscripts/Gentoo/ltsp-client-setup.confd ltsp-5.3.5/client/initscripts/Gentoo/ltsp-client-setup.confd --- ltsp-5.3.2/client/initscripts/Gentoo/ltsp-client-setup.confd 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/Gentoo/ltsp-client-setup.confd 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# bind_mounts or unionfs (leave empty to autodetect) -# NOTE: if you change this parameter, you must regenerate the initramfs -root_write_method="bind_mounts" - -# tmpfs directory mounted when using tmpfs/bind -tmpfs_dir=/var/lib/ltsp-client-setup - -# size of tmpfs mount -tmpfs_size=10m - -# tmpfs/bind directions that get mounted with only directory structure -# preserved -rw_dirs="/var/lib/xkb /var/log /var/spool /var/tmp /tmp /var/run /var/lib/pulse" - -# tmpfs/bind directions that get mounted with directory structure and data -# copied -copy_dirs="/root /home /etc/conf.d /etc/udev/rules.d /var/cache/ltsp /var/cache/ltsp-localapps" - -# tmpfs/bind directories that are mounted and copied, but then unmounted after -# ltsp-client-setup finishes -temp_copy_dirs="" - -# tmpfs/bind files that mounted on top of other files -bindfiles="/etc/hosts /etc/syslog.conf /etc/fstab -/etc/resolv.conf /etc/passwd /etc/group /etc/localtime /etc/lts.conf" diff -Nru ltsp-5.3.2/client/initscripts/Gentoo/ltsp-client-setup.initd ltsp-5.3.5/client/initscripts/Gentoo/ltsp-client-setup.initd --- ltsp-5.3.2/client/initscripts/Gentoo/ltsp-client-setup.initd 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/Gentoo/ltsp-client-setup.initd 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -depend() { - before modules -} - -checkconfig() { - if [ ! -f /etc/ltsp_chroot ] ; then - eerror "You are not in an LTSP chroot" - eend 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Setting up LTSP client" - - if [ -z "$root_write_method" ]; then - touch / 2> /dev/null || root_write_method="bind_mounts" - fi - [ "$root_write_method" = "bind_mounts" ] && bind_mounts - - - # This logic stolen from fedora's scripts, since neither of us get - # lts.conf in the initramfs - - # Grab lts.conf from the same IP address as the mount server. - # (TODO: This is duplicated from ltsp_config because we don't - # want to run that entire script at this point.) - - # check for NBD devices - NBD_DEVICES=$(awk '/^\/dev\/nbd.* \/ /||/^\/dev\/nbd.* \/rofs /{print $1}' /proc/mounts) - if [ -n "$NBD_DEVICES" ]; then - for DEVICE in $NBD_DEVICES ; do - SERVER=$(pgrep -f -l $DEVICE | awk '{print $3}') - test -n "$SERVER" && break - done - else - # check for NFS root - SERVER=$(sed -ne '/ltsp.*nfs/ { s/^\([^:]*\):.*$/\1/; p; q }' /proc/mounts) - fi - - SERVER="${SERVER:-192.168.0.254}" - export SERVER - - ARCH=$(uname -m | sed -e 's:i[3-6]86:x86:' -e 's:x86_64:amd64:' -e 's:parisc:hppa:') - TFTPPATH="/ltsp/${ARCH}/lts.conf" - - # Attempt to get lts.conf via tftp - cd /var/run - (echo "get ${TFTPPATH}"|tftp ${SERVER} >/dev/null 2>&1) - - if [ -s ./lts.conf ];then - cp ./lts.conf /etc/lts.conf - fi - cd - > /dev/null - - # back to our regularly scheduled programming - - # run local function before ltsp-init-common is loaded - configure_resolver || true - - . /usr/share/ltsp/ltsp-init-common - - load_modules || true - set_time || true - configure_keymap || true - configure_swap || true - configure_syslog || true - configure_fstab || true - run_rcfiles || true - configure_serial_mouse || true - configure_localdev || true - configure_printer || true - [ "$root_write_method" = "bind_mounts" ] && bind_unmounts -} - -load_modules() { - # TODO: support module arguments - MODULES=$(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/) - echo "modules_$(uname -r | sed -e s/-/_/g -e s/\./_/g)=\"${MODULES}\"" >> /etc/conf.d/modules - #for module in $(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/);do - # modprobe $(echo $module|tr "*" " ") - #done -} - -configure_keymap() { - if [ -n "$CONSOLE_KEYMAP" ]; then - sed -i "s/keymap=\"us\"/keymap=\"${CONSOLE_KEYMAP}\"/" /etc/conf.d/keymaps - fi -} - -configure_resolver() { - # TODO: probably a better way to do this - client_ip=$(ip -o -f inet addr show | sed -e 's,.* \(.*\)/.*,\1,' | grep -v '^127') - hostname=$(hostname) - if [ "(none)" = "$hostname" ] ; then - hostname="client-${client_ip}" - fi - - echo "hostname="$hostname"" > /etc/conf.d/hostname - - cat <> /etc/hosts -$client_ip $hostname -$SERVER server -EOF - - if [ -n "$DNS_SERVER" ] && [ -n "$SEARCH_DOMAIN" ]; then - cat <> /etc/conf.d/net -dns_servers=( "${DNS_SERVER}" ) -dns_search="${SEARCH_DOMAIN}" -EOF - fi -} - -bind_mounts () { - # set defaults - test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup - mount -t tmpfs -o mode=0755 tmpfs $tmpfs_dir - # preserve directory structure - for d in $rw_dirs ; do - if [ -d "$d" ]; then - cd $tmpfs_dir - tar --no-recursion -cpf - $(find $d -type d 2> /dev/null) 2> /dev/null | tar xpf - - mount --bind $tmpfs_dir/$d $d - else - echo "WARNING: $d does not exist" - fi - done - # copy contents into tmpfs - for d in $copy_dirs $temp_copy_dirs; do - if [ -d "$d" ]; then - cd $tmpfs_dir - tar -cpf - $d 2> /dev/null | tar xpf - - mount --bind $tmpfs_dir/$d $d - else - echo "WARNING: $d does not exist" - fi - done - # mount one file on top of another - for f in $bindfiles ; do - if [ -e "$f" ]; then - mkdir -p "$(dirname $tmpfs_dir/$f)" - cp $f $tmpfs_dir/$f - mount --bind $tmpfs_dir/$f $f - else - echo "WARNING: $f does not exist" - fi - done -} - -run_rcfiles() { - for rcfile in $(env | sort | awk -F= '$1 ~ /^RCFILE_/ { print $2 }'); do - [ -x "$rcfile" ] && "$rcfile" $@ - done -} diff -Nru ltsp-5.3.2/client/initscripts/ltsp-bindmounts ltsp-5.3.5/client/initscripts/ltsp-bindmounts --- ltsp-5.3.2/client/initscripts/ltsp-bindmounts 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/ltsp-bindmounts 2012-03-09 18:02:07.000000000 +0000 @@ -5,6 +5,53 @@ # Gracefully exit if ltsp_chroot file is not present test -f /etc/ltsp_chroot || exit 0 +bind_mounts () { + # set defaults + test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup + mount -t tmpfs -o mode=0755 tmpfs $tmpfs_dir + bind_missing="" + # preserve directory structure + for d in $rw_dirs ; do + if [ -d "$d" ]; then + cd $tmpfs_dir + tar --no-recursion -cpf - $(find $d -type d 2> /dev/null) 2> /dev/null | tar xpf - + mount --bind $tmpfs_dir/$d $d + else + bind_missing="$bind_missing $d" + fi + done + # copy contents into tmpfs + for d in $copy_dirs $temp_copy_dirs; do + if [ -d "$d" ]; then + cd $tmpfs_dir + tar -cpf - $d 2> /dev/null | tar xpf - + mount --bind $tmpfs_dir/$d $d + else + bind_missing="$bind_missing $d" + fi + done + # mount one file on top of another + for f in $bindfiles ; do + if [ -e "$f" ]; then + mkdir -p "$(dirname $tmpfs_dir/$f)" + cp $f $tmpfs_dir/$f + mount --bind $tmpfs_dir/$f $f + else + bind_missing="$bind_missing $f" + fi + done + if [ -n "$bind_missing" ]; then + echo "note: ltsp: missing files or directories for bind mounting: $bind_missing" + fi +} + +bind_unmounts() { + for dir in $temp_copy_dirs; do + umount $dir + rm -rf $tmpfs_dir/${dir#/} + done +} + # tmpfs/bind directories that get mounted with only directory structure # preserved diff -Nru ltsp-5.3.2/client/initscripts/ltsp-core ltsp-5.3.5/client/initscripts/ltsp-core --- ltsp-5.3.2/client/initscripts/ltsp-core 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/ltsp-core 2012-03-09 18:02:07.000000000 +0000 @@ -3,12 +3,12 @@ # Author: Matt Zimmerman # ### BEGIN INIT INFO -# Provides: ltsp-client ltsp-client-core -# Required-Start: ltsp-client-setup $remote_fs $network $syslog -# Should-Start: hal +# Provides: ltsp-client ltsp-client-core ltsp-client-setup +# Required-Start: $remote_fs $network $syslog +# Should-Start: # Required-Stop: # Default-Start: 2 3 4 5 -# Default-Stop: +# Default-Stop: 0 6 # Short-Description: Script for LTSP client initialization # Description: ### END INIT INFO @@ -44,39 +44,11 @@ eval $(getltscfg-cluster -a -l boot) || true fi - # if usplash is running, make sure to stop it now - # (yes "start" is the right arg to do it ... even it looks silly) - if pidof usplash > /dev/null; then - usplash=: - orig_console="$(fgconsole)" - /etc/init.d/usplash start - # We've just shut down usplash, so don't log success as it will - # look weird on the console. - log_action_end_msg=: - else - usplash=false - log_action_end_msg=log_end_msg - fi - start_screen_sessions || true start_sound || true - configure_sound_volume || true & log_action_end_msg 0 - if $usplash && [ "$orig_console" != serial ]; then - # Wait a short while for the active console to change, to try to - # avoid visible console noise from later init scripts. - i=0 - while [ "$(fgconsole)" = "$orig_console" ]; do - i="$(($i + 1))" - if [ "$i" -gt 5 ]; then - break - fi - sleep 1 - done - fi - if [ -x /bin/plymouth ]; then /bin/plymouth quit --retain-splash fi diff -Nru ltsp-5.3.2/client/initscripts/ltsp-core.upstart ltsp-5.3.5/client/initscripts/ltsp-core.upstart --- ltsp-5.3.2/client/initscripts/ltsp-core.upstart 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/ltsp-core.upstart 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,40 @@ +description "LTSP core client init script" +author "Stéphane Graber " + +start on ((filesystem + and runlevel [!06] + and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 + or stopped udev-fallback-graphics)) + or runlevel PREVLEVEL=S) +stop on starting rc RUNLEVEL=[06] + +pre-start script + grep -Eqsw "init=/sbin/init-ltsp|ltsp" /proc/cmdline || exit 0 + + # Make sure the locales are set + if [ -r /etc/default/locale ]; then + . /etc/default/locale + export LANG LANGUAGE + fi + + . /usr/share/ltsp/ltsp-init-common + if [ -f "/etc/ltsp/getltscfg-cluster.conf" ]; then + # Tell the control center that we are booting and get lts.conf + eval $(getltscfg-cluster -a -l boot) || true + fi + + start_screen_sessions || true + start_sound || true + + if [ -x /bin/plymouth ]; then + /bin/plymouth quit --retain-splash || true + fi +end script + +post-stop script + grep -Eqsw "init=/sbin/init-ltsp|ltsp" /proc/cmdline || exit 0 + + if [ -x /usr/share/ltsp/nbd-disconnect ]; then + /usr/share/ltsp/nbd-disconnect& + fi +end script diff -Nru ltsp-5.3.2/client/initscripts/ltsp-init-common ltsp-5.3.5/client/initscripts/ltsp-init-common --- ltsp-5.3.2/client/initscripts/ltsp-init-common 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/ltsp-init-common 2012-03-09 18:02:07.000000000 +0000 @@ -127,356 +127,22 @@ fi } -configure_localdev() { - if boolean_is_true "$LOCALDEV" ; then - # Make mountpoint dir - mkdir -p /var/run/drives - # Make this sessions secret auth cookie for ltspfs - if [ ! -f /var/run/ltspfs_token ]; then - mcookie > /var/run/ltspfs_token - fi - if [ -z "$(pgrep ltspfsd)" ]; then - /usr/bin/ltspfsd - fi - # cdrom devices are handled by the cdpingerponger - if [ -z "$(pgrep -l -f -x "/usr/sbin/cdpinger cdrom$")" ]; then - /usr/sbin/cdpinger cdrom # default for usb cdroms - fi - - # and start one for every additional cdrom device - if [ -L /dev/cdrom?* ];then - for CDDEV in $(ls /dev/cdrom?*); do - if [ -z "$(pgrep -l -f -x "/usr/sbin/cdpinger ${CDDEV}$")" ]; then - /usr/sbin/cdpinger $(basename ${CDDEV}) - fi - done - fi - fi -} - -configure_swap() { - if boolean_is_true "$USE_LOCAL_SWAP" ; then - # Enable local swap partition if found on local disk - for part in `sfdisk -l 2>/dev/null | awk '/ 82 / { print $1}'`; do - swap_devices="$swap_devices $part" - done - fi - - # Enable NBD_SWAP for clients with RAM < NBD_SWAP_THRESHOLD (in MB) - if [ -n "$NBD_SWAP_THRESHOLD" ] && [ -z "$NBD_SWAP" ] && [ -z "$swap_devices" ]; then - memtotal=$(sed -n 's/MemTotal: *\([0-9]*\) .*/\1/p' /proc/meminfo) - # Clients with less than 64 MB RAM already got a network swap in ltsp_nbd - if [ "$memtotal" -gt 65536 ] && [ "$memtotal" -lt $((1024*$NBD_SWAP_THRESHOLD)) ]; then - echo "Only found ${memtotal}k main ram, trying network swap." - NBD_SWAP=true - fi - fi - - if boolean_is_true "$NBD_SWAP" ; then - NBD_SWAP_HOST=${NBD_SWAP_HOST:-"$SERVER"} - NBD_SWAP_PORT=${NBD_SWAP_PORT:-"9572"} - modprobe nbd - # Detect first unused nbd device, skip nbd0 - for num in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do - nbd-client -c /dev/nbd${num} > /dev/null - [ $? -eq 1 ] && break - done - nbd-client $NBD_SWAP_HOST $NBD_SWAP_PORT /dev/nbd${num} -swap && \ - swap_devices="$swap_devices /dev/nbd${num}" - fi - - if boolean_is_true "$ENCRYPT_SWAP" ; then - if [ -x /sbin/cryptsetup ]; then - modprobe dm_crypt - else - echo "ERROR: ENCRYPT_SWAP=Y, but /sbin/cryptsetup not found. disabling swap." - swap_devices="" - fi - fi - - num=0 - for device in $swap_devices ; do - swap="$device" - if boolean_is_true "$ENCRYPT_SWAP" ; then - if [ -x /sbin/cryptsetup ]; then - cryptsetup -d /dev/urandom create swap$num $swap && swap="/dev/mapper/swap$num" - num=$(($num+1)) - fi - fi - mkswap $swap - swapon $swap - done - - # If any swap device was used, there's no need for compcache, so unload it to - # gain that 25% of RAM. It makes a significant difference on low end clients. - if [ -n "$swap_devices" ]; then - for swap in /dev/ramzswap*; do - if [ -b "$swap" ]; then - swapoff "$swap" && remove_ramzswap=true || true - fi - done - if [ -n "$remove_ramzswap" ]; then - modprobe -r ramzswap || true - fi - fi -} - -configure_printer() { - for I in 0 1 2; do - eval DEVICE=\$\{PRINTER_${I}_DEVICE\} - if [ -n "${DEVICE}" ]; then - eval PORT=\$\{PRINTER_${I}_PORT:="910${I}"\} - eval BAUD=\$\{PRINTER_${I}_SPEED:-"9600"\} - eval SIZE=\$\{PRINTER_${I}_DATABITS:-"8"\} - eval PARITY=\$\{PRINTER_${I}_PARITY:-"none"\} - eval FLOW=\$\{PRINTER_${I}_FLOWCTRL:-"soft"\} - - JETPIPE_ARGS= - [ -n "$BAUD" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -b ${BAUD}" - [ -n "$SIZE" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -y ${SIZE}" - [ -n "$PARITY" ] && JETPIPE_ARGS="${JETPIPE_ARGS} -p ${PARITY}" - if [ -n "$FLOW" ]; then - if [ "$FLOW" = "soft" ]; then - JETPIPE_ARGS="${JETPIPE_ARGS} -x" - else - JETPIPE_ARGS="${JETPIPE_ARGS} -r" - fi - fi - - /usr/sbin/jetpipe ${JETPIPE_ARGS} ${DEVICE} ${PORT} - fi - done -} - -configure_scanner() { - if boolean_is_true "$SCANNER" ; then - saned -a - fi -} - -configure_serial_mouse() { - if [ -n "$X_MOUSE_DEVICE" ] && \ - [ -n "$X_MOUSE_PROTOCOL" ] && \ - type inputattach >/dev/null 2>/dev/null ; then - case "${X_MOUSE_DEVICE}" in - *ttyS*) inputattach --"$X_MOUSE_PROTOCOL" "$X_MOUSE_DEVICE" & ;; - esac - fi -} - -set_time() { - # Set up timezone - if [ -n "$TIMEZONE" ] && [ -e "/usr/share/zoneinfo/$TIMEZONE" ]; then - cp /usr/share/zoneinfo/$TIMEZONE /etc/localtime 2>/dev/null - fi - - # Set timeserver to $SERVER if set to autodetect - if [ "$TIMESERVER" = "auto" ]; then - TIMESERVER=${SERVER} - fi - - # Set up timeserver - if [ -n "$TIMESERVER" ]; then - ntpdate $TIMESERVER && hwclock --systohc --${HWCLOCK:-"utc"} --noadjfile || true - fi - -} - -load_modules() { - for module in $(env|grep ^MODULE_|sed -e s/^MODULE_[0-9]*\=//|sed -e s/\ /*/g);do - modprobe $(echo $module|tr "*" " ") - done -} - -configure_console() { - if [ -n "$CONSOLE_KEYMAP" ]; then - ckbcomp -model pc105 "$CONSOLE_KEYMAP" | loadkeys - fi -} - -configure_resolver() { - hostname=$(cat /proc/sys/kernel/hostname) - if [ -z "$hostname" ] || [ "$hostname" = "(none)" ]; then - # ensure a default hostname, otherwise /etc/hosts may get borked. - hostname=ltsp - echo $hostname > /proc/sys/kernel/hostname || true - fi - cat < /etc/hosts -127.0.0.1 localhost -127.0.0.2 $hostname -$SERVER server -EOF - if [ -f /etc/hosts.ltsp ]; then - cat /etc/hosts.ltsp >> /etc/hosts - fi - - if [ -n "$DNS_SERVER" ] || [ -n "$SEARCH_DOMAIN" ]; then - if [ -x $rootmnt/sbin/resolvconf ] && ( [ -L $rootmnt/etc/resolv.conf ] || [ -e $rootmnt/var/lib/resolvconf/convert ] ); then - mkdir -p /run/resolvconf/interface/ - resolv_method=resolvconf - resolv=/run/resolvconf/interface/LTSP - else - resolv_method=static - resolv=$rootmnt/etc/resolv.conf - fi - > $resolv - if [ -n "$SEARCH_DOMAIN" ]; then - echo "search $SEARCH_DOMAIN" >> $resolv - fi - if [ -n "$DNS_SERVER" ]; then - for n in $DNS_SERVER; do - echo "nameserver ${n}" >> $resolv - done - fi - if [ "$resolv_method" = "static" ]; then - resolvconf -a LTSP - fi - fi -} - -configure_syslog() { - if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then - syslog_conf=/etc/syslog.conf - if [ -d /etc/rsyslog.d ]; then - syslog_conf=/etc/rsyslog.d/ltsp.conf - touch $syslog_conf - fi - if [ -f "$syslog_conf" ]; then - cat < "$syslog_conf" -*.* @${SYSLOG_HOST:-$SERVER} -EOF - fi - fi -} - -configure_fstab() { - if [ -z "$CONFIGURE_FSTAB" ] || boolean_is_true "$CONFIGURE_FSTAB" ; then - echo "/dev/root / rootfs defaults 0 0" > /etc/fstab - echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> /etc/fstab - mount /tmp - fi -} - -configure_home() { - test -n "$NFS_HOME" || return 0 - - # if $NFS_HOME doesn't contain a :/ part - if [ "$NFS_HOME" = ${NFS_HOME#*:/} ]; then - NFS_HOME="$SERVER:/$NFS_HOME" - fi - MNTPT=$(echo ${NFS_HOME}|cut -d: -f2) - [ -n "${MNTPT}" ] && mkdir -p "${MNTPT}" 2>/dev/null - NFS_HOME_OPTIONS=${NFS_HOME_OPTIONS:-defaults} - if ! mount -t nfs -o "$NFS_HOME_OPTIONS" "$NFS_HOME" "${MNTPT}"; then - unset NFS_HOME - else - if [ -z "$CONFIGURE_FSTAB" ] || boolean_is_true "$CONFIGURE_FSTAB" ; then - echo "$NFS_HOME ${MNTPT} nfs $NFS_HOME_OPTIONS 0 0" >> /etc/fstab - fi - fi -} - -configure_cron() { - CRON_FILE=/etc/cron.d/ltsp - if [ ! -w "/etc/cron.d" ]; then - echo "Warning: /etc/cron.d is not writeable." - return 1 - fi - if [ -n "$SHUTDOWN_TIME" ] ; then - echo $SHUTDOWN_TIME | awk -F : '{print $2" "$1" * * * root test ! -S \"$(ls -1 /var/run/ldm_socket_* | head -1)\" && PATH=\$PATH:/sbin/ poweroff" }' >> $CRON_FILE - fi - env | sed -n 's/^CRONTAB_[0-9][0-9]=//p' >> $CRON_FILE -} - -run_rcfiles() { - for rcfile in $(env|grep ^RCFILE_|sed -e s/^RCFILE_[0-9]*\=//|sed -e s/\ /*/g); do - rcf=`echo $rcfile |sed -e s/\*/\ /g` - rcexe=`echo $rcfile |sed -e s/\*.*//` - [ -x $rcexe ] && $rcf - done -} - -bind_mounts () { - # set defaults - test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup - mount -t tmpfs -o mode=0755 tmpfs $tmpfs_dir - bind_missing="" - # preserve directory structure - for d in $rw_dirs ; do - if [ -d "$d" ]; then - cd $tmpfs_dir - tar --no-recursion -cpf - $(find $d -type d 2> /dev/null) 2> /dev/null | tar xpf - - mount --bind $tmpfs_dir/$d $d - else - bind_missing="$bind_missing $d" - fi - done - # copy contents into tmpfs - for d in $copy_dirs $temp_copy_dirs; do - if [ -d "$d" ]; then - cd $tmpfs_dir - tar -cpf - $d 2> /dev/null | tar xpf - - mount --bind $tmpfs_dir/$d $d - else - bind_missing="$bind_missing $d" - fi - done - # mount one file on top of another - for f in $bindfiles ; do - if [ -e "$f" ]; then - mkdir -p "$(dirname $tmpfs_dir/$f)" - cp $f $tmpfs_dir/$f - mount --bind $tmpfs_dir/$f $f - else - bind_missing="$bind_missing $f" - fi - done - if [ -n "$bind_missing" ]; then - echo "note: ltsp: missing files or directories for bind mounting: $bind_missing" - fi -} - -bind_unmounts() { - for dir in $temp_copy_dirs; do - umount $dir - rm -rf $tmpfs_dir/${dir#/} - done -} - -nbd_sendsigs_protection() { - if [ -n "$NBD_ROOT_HOST" ]; then - # register pids of nbd-client and nbd-proxy so that sendsigs doesn't kill - # them on shutdown/reboot. - - # FIXME: only register pids relevent to the root filesystem. - nbd_pids=$(pgrep '^nbd-client|^nbd-proxy') - for d in /run/sendsigs.omit.d /lib/init/rw/sendsigs.omit.d /var/run/sendsigs.omit.d ; do - if [ -d "$d" ]; then - for p in $nbd_pids ; do - echo "$p" >> "$d"/ltsp || true - done - fi - done - fi -} - start_screen_sessions() { - if [ -z "${SCREEN_DEFAULT}" ]; then - for screen in 01 02 03 04 05 06 07 08 09 10 11 12; do - eval num=\$SCREEN_$screen - [ -n "$num" ] && SCREEN_DEFAULT=$screen - done - fi + # If no default was found, there's no SCREEN_xx to be started, so exit + test -n "$SCREEN_DEFAULT" || return - # Find current tty, and if it is not the same as SCREEN_DEFAULT, chvt - if [ -n "${SCREEN_DEFAULT}" ] && [ $(fgconsole) -ne ${SCREEN_DEFAULT} ]; then - chvt ${SCREEN_DEFAULT} - fi + # Start the default screen and make it the active tty + openvt -f -c "${SCREEN_DEFAULT#0}" -s -- /usr/share/ltsp/screen_session "$SCREEN_DEFAULT" + + # Give the default screen a head start + sleep 1 - for screen in 01 02 03 04 05 06 07 08 09 10 11 12; do - eval num=\$SCREEN_$screen - if [ -n "$num" ]; then - start-stop-daemon --start -b --exec /usr/share/ltsp/screen_session -- "$screen" + # Launch the other screens without switching to them + for i in 01 02 03 04 05 06 07 08 09 10 11 12; do + test "$i" -eq "$SCREEN_DEFAULT" && continue + eval "screen=\$SCREEN_$i" + if [ -n "$screen" ]; then + openvt -f -c "${i#0}" -- /usr/share/ltsp/screen_session "$i" fi done } diff -Nru ltsp-5.3.2/client/initscripts/ltsp-setup ltsp-5.3.5/client/initscripts/ltsp-setup --- ltsp-5.3.2/client/initscripts/ltsp-setup 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/initscripts/ltsp-setup 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -#! /bin/sh -# -# Author: Matt Zimmerman -# -### BEGIN INIT INFO -# Provides: ltsp-client-setup -# Required-Start: mountdevsubfs -# X-Start-Before: mountall -# Required-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Script for LTSP client initialization -# Description: -### END INIT INFO - -set -e - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DESC="LTSP client setup" -NAME=ltsp-client-setup -SCRIPTNAME=/etc/init.d/$NAME - -# Gracefully exit if ltsp_chroot file is not present -test -f /etc/ltsp_chroot || exit 0 - -test -f /etc/default/ltsp-client-setup && . /etc/default/ltsp-client-setup - -. /lib/lsb/init-functions -. /usr/share/ltsp/ltsp-init-common - -case "$1" in - start) - log_begin_msg "Setting up LTSP client..." - which usplash_write >/dev/null 2>/dev/null && \ - usplash_write "TIMEOUT 120" || true - if [ -f "/etc/ltsp/getltscfg-cluster.conf" ]; then - # Tell the control center that we are booting and get lts.conf - set -f - eval $(getltscfg-cluster -a -l refresh) || true - set +f - fi - load_modules || true - configure_resolver || true - set_time || true - configure_console || true - configure_swap || true - configure_syslog || true - configure_fstab || true - configure_home || true - configure_cron || true - run_rcfiles || true - configure_serial_mouse || true - # Now that ltspfsd and cdpinger are started in udev in ltspfs, - # starting them here only causes problems - #configure_localdev || true - configure_printer || true - configure_scanner || true - nbd_sendsigs_protection || true - log_end_msg 0 - ;; - stop) - # echo -n "Stopping $DESC: $NAME" - # d_stop - # echo "." - ;; - restart|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". - # - echo -n "Restarting $DESC: $NAME" - d_stop - sleep 1 - d_start - echo "." - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff -Nru ltsp-5.3.2/client/ltsp_config.d/16default-tty ltsp-5.3.5/client/ltsp_config.d/16default-tty --- ltsp-5.3.2/client/ltsp_config.d/16default-tty 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/ltsp_config.d/16default-tty 2012-03-09 18:02:07.000000000 +0000 @@ -1,9 +1,25 @@ -# This file is sourced +# Verify that SCREEN_DEFAULT points to an existing SCREEN_XX +if [ -n "$SCREEN_DEFAULT" ]; then + # We want it to be e.g. 01, not 1 + SCREEN_DEFAULT=$(printf "%02d" "$SCREEN_DEFAULT") + eval "screen=\$SCREEN_$SCREEN_DEFAULT" + if [ -z "$screen" ]; then + echo "SCREEN_DEFAULT=$SCREEN_DEFAULT, but no SCREEN_$SCREEN_DEFAULT found" >&2 + unset SCREEN_DEFAULT + fi +fi -if [ -z "${SCREEN_DEFAULT}" ]; then - for screen in 01 02 03 04 05 06 07 08 09 10 11 12; do - eval num=\$SCREEN_$screen - [ -n "$num" ] && SCREEN_DEFAULT=$screen +# Otherwise, the highest screen number gets to be the default +if [ -z "$SCREEN_DEFAULT" ]; then + for i in 12 11 10 09 08 07 06 05 04 03 02 01; do + eval "screen=\$SCREEN_$i" + if [ -n "$screen" ]; then + SCREEN_DEFAULT="$i" + break + fi done fi +if [ -n "$SCREEN_DEFAULT" ]; then + set_lts_var SCREEN_DEFAULT "$SCREEN_DEFAULT" +fi diff -Nru ltsp-5.3.2/client/ltsp_config.d/20fatclients ltsp-5.3.5/client/ltsp_config.d/20fatclients --- ltsp-5.3.2/client/ltsp_config.d/20fatclients 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/ltsp_config.d/20fatclients 2012-03-09 18:02:07.000000000 +0000 @@ -1,4 +1,15 @@ -if [ -z "$LTSP_FATCLIENT" ] && [ -f /etc/ltsp_fat_chroot ] && [ -f /proc/meminfo ]; then +# Automatically set LTSP_FATCLIENT=True if the image supports local logins +test -z "$LTSP_FATCLIENT" || return +test -f /proc/meminfo || return + +unset supports_local_logins +# process_lts_conf() unsets glob expansion (set -f), so we need to use `find` +for xsession in $(find /usr/share/xsessions/ -name '*.desktop' 2>/dev/null); do + supports_local_logins=true + break +done + +if [ -n "$supports_local_logins" ]; then # Don't set LTSP_FATCLIENT for low-RAM clients booting from a fat chroot memtotal=$(sed -n 's/MemTotal: *\([0-9]*\) .*/\1/p' /proc/meminfo) FAT_RAM_THRESHOLD=${FAT_RAM_THRESHOLD:-300} diff -Nru ltsp-5.3.2/client/screen.d/menu ltsp-5.3.5/client/screen.d/menu --- ltsp-5.3.2/client/screen.d/menu 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/screen.d/menu 2012-03-09 18:02:07.000000000 +0000 @@ -28,8 +28,6 @@ ################################################################ -[ -n "${SCREEN_NUM}" ] && openvt chvt ${SCREEN_NUM} - # Need to specify TERM export TERM=linux diff -Nru ltsp-5.3.2/client/screen.d/ssh ltsp-5.3.5/client/screen.d/ssh --- ltsp-5.3.2/client/screen.d/ssh 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/screen.d/ssh 2012-03-09 18:02:07.000000000 +0000 @@ -9,9 +9,6 @@ # . /usr/share/ltsp/ltsp_config -# chvt to the right screen -[ -n "${SCREEN_NUM}" ] && openvt chvt ${SCREEN_NUM} - # # Get the IP address of the host to ssh into. # First look for 'SSH_HOST', if not specified, then diff -Nru ltsp-5.3.2/client/screen_session ltsp-5.3.5/client/screen_session --- ltsp-5.3.2/client/screen_session 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/client/screen_session 2012-03-09 18:02:07.000000000 +0000 @@ -11,6 +11,7 @@ # Stephane Graber # Vagrant Cascadian # Gideon Romm +# 2012, Alkis Georgopoulos # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -29,104 +30,53 @@ # MA 02110-1301, USA. # - -# Deprecated: /usr/lib/ltsp/screen.d is for compatibility reasons, will be removed one day -SCRIPT_DIRS="/etc/ltsp/screen.d /usr/share/ltsp/screen.d /usr/lib/ltsp/screen.d" - -# Source ltsp-common-functions if we have not already (needed in some functions) -(PATH="" boolean_is_true True 2>/dev/null) || . /usr/share/ltsp/ltsp-common-functions || true - # Load LTSP configuration # ltsp_config sources ltsp-common-functions . /usr/share/ltsp/ltsp_config -# Figure out SCREEN_NUM -if [ -n "$1" ]; then - SCREEN_NUM="$1" -else - SCREEN_NUM="$(tty)" -fi - -if [ -x /usr/bin/openvt ]; then - openvt=/usr/bin/openvt -elif [ -x /bin/openvt ]; then - openvt=/bin/openvt -fi - -# initialize the tty with openvt, so that it's possible to switch to later. -if [ -x "${openvt}" ]; then - ${openvt} -f -c ${SCREEN_NUM#0} /bin/true -fi - +case "$1" in + [0-1][0-9]) + num="$1" + ;; + *) + die "Usage: $0 [01..12]" + ;; +esac +while true; do + # Wait until this is the active vt before launching the screen script + while [ $(fgconsole) -ne "$num" ]; do + sleep 2 + done -export SCREEN_NUM - -main() { if [ -f /etc/ltsp/getltscfg-cluster.conf ]; then # Reset the environement - unset $(env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|PATH|HOME|SCREEN_NUM|SCREEN_DIRS|TTY_NUM|CURTTY_NUM' | /usr/bin/cut -d= -f1) + unset $(env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|PATH|HOME' | /usr/bin/cut -d= -f1) . /usr/share/ltsp/ltsp_config eval $(getltscfg-cluster -a -l prompt) fi - # Wait until this is the active vt before launching the screen script - while [ $(fgconsole) -ne ${SCREEN_NUM} ]; do - sleep 2 - done - - eval SCREEN_CMD=\$\{SCREEN_$SCREEN_NUM\} - [ -z "${SCREEN_CMD}" ] && return - - SCREEN_SCRIPT=`echo $SCREEN_CMD | cut -f1 -d" "` - SCREEN_ARGS=`echo $SCREEN_CMD | cut -f2- -d" " -s` - - if [ -d "/usr/share/ltsp/screen-session.d/" ]; then - for script in $(run_parts_list /usr/share/ltsp/screen-session.d/ S); do - . $script - done - fi - - for SCRIPT_DIR in ${SCRIPT_DIRS}; do - if [ -x ${SCRIPT_DIR}/${SCREEN_SCRIPT} ]; then - if [ "${SCRIPT_DIR}" = "/usr/lib/ltsp/screen.d" ]; then - echo "Warning: /usr/lib/ltsp/screen.d is deprecated and will be removed in the future." - echo " ${SCREEN_SCRIPT} requires updating to use /usr/share/ltsp." - fi - if [ -z "${openvt}" ]; then - return 2 - fi - - # Execute the session script in the correct VT - ${openvt} -s -f -w -c ${SCREEN_NUM#0} -- ${SCRIPT_DIR}/${SCREEN_SCRIPT} ${SCREEN_ARGS}& - PID=$! - wait $PID - return 0 + read script args < Fri, 09 Mar 2012 13:03:30 -0500 + ltsp (5.3.2-0ubuntu3) precise; urgency=low * ltsp-live: diff -Nru ltsp-5.3.2/debian/ltsp-client-core.install ltsp-5.3.5/debian/ltsp-client-core.install --- ltsp-5.3.2/debian/ltsp-client-core.install 2012-02-27 17:58:33.000000000 +0000 +++ ltsp-5.3.5/debian/ltsp-client-core.install 2012-03-09 18:03:22.000000000 +0000 @@ -11,6 +11,7 @@ client/kioskSession usr/share/ltsp client/ltsp_config.d/* usr/share/ltsp/ltsp_config.d/ client/ltsp_config usr/share/ltsp +client/nbd-disconnect usr/share/ltsp client/screen.d usr/share/ltsp client/screen-session.d usr/share/ltsp client/screen_session usr/share/ltsp diff -Nru ltsp-5.3.2/debian/rules ltsp-5.3.5/debian/rules --- ltsp-5.3.2/debian/rules 2012-02-27 17:58:33.000000000 +0000 +++ ltsp-5.3.5/debian/rules 2012-03-09 18:03:22.000000000 +0000 @@ -59,6 +59,7 @@ # Copy init scripts from upstream code cp $(CURDIR)/client/initscripts/ltsp-core $(CURDIR)/debian/ltsp-client-core.init + cp $(CURDIR)/client/initscripts/ltsp-core.upstart $(CURDIR)/debian/ltsp-client-core.upstart # Build architecture-independent files here. binary-indep: build install @@ -88,7 +89,7 @@ dh_installexamples -a dh_install -a dh_installdebconf -a - dh_installinit -a --no-start -u"start 25 2 ." + dh_installinit -a --no-start dh_link -a dh_strip -a dh_compress -a diff -Nru ltsp-5.3.2/localapps/ldm-rc.d/X01-localapps ltsp-5.3.5/localapps/ldm-rc.d/X01-localapps --- ltsp-5.3.2/localapps/ldm-rc.d/X01-localapps 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/localapps/ldm-rc.d/X01-localapps 2012-03-09 18:02:07.000000000 +0000 @@ -43,7 +43,7 @@ # (/usr/bin/id is only needed because getent evidently does not return groups # added by pam_group (bug in pam_group?) - myGroups1=$(ssh -S ${LDM_SOCKET} ${LDM_SERVER} LANG=C /usr/bin/id | sed -e 's/^.*groups=//' -e 's/) .*$/)/'|cut -d= -f2|sed -e 's/[0-9]*(//g' -e 's/)//g') + myGroups1=$(ssh -S ${LDM_SOCKET} ${LDM_SERVER} LANG=C LANGUAGE=C /usr/bin/id | sed -e 's/^.*groups=//' -e 's/) .*$/)/'|cut -d= -f2|sed -e 's/[0-9]*(//g' -e 's/)//g') # concatenate groups from different sources, stripping off prefixed and # trailing commas diff -Nru ltsp-5.3.2/ltsp-common-functions ltsp-5.3.5/ltsp-common-functions --- ltsp-5.3.2/ltsp-common-functions 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/ltsp-common-functions 2012-03-09 18:02:07.000000000 +0000 @@ -18,16 +18,11 @@ # $1 - directory to list # $2 - optional prefix to limit which files are selected run_parts_list() { - if [ $# -lt 1 ]; then - echo "ERROR: Usage: run_parts_list " > /dev/stderr - exit 1 + test $# -ge 1 || die "ERROR: Usage: run_parts_list " + if [ -d "$1" ]; then + find -L "$1" -mindepth 1 -maxdepth 1 -type f -name "$2*" | + sed -n '/.*\/[0-9a-zA-Z_\-]\{1,\}$/p' | sort -n fi - if [ ! -d "$1" ]; then - echo "ERROR: Not a directory: $1" > /dev/stderr - exit 1 - fi - - find -L "$1" -mindepth 1 -maxdepth 1 -type f -name "$2*" | sed -n '/.*\/[0-9a-zA-Z_\-]\{1,\}$/p' | sort -n } detect_vendor() { diff -Nru ltsp-5.3.2/release.conf ltsp-5.3.5/release.conf --- ltsp-5.3.2/release.conf 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/release.conf 2012-03-09 18:02:07.000000000 +0000 @@ -1,3 +1,3 @@ NAME=ltsp -VERSION=5.3.2 +VERSION=5.3.5 EXPORTCHANGELOG=yes diff -Nru ltsp-5.3.2/server/configs/Gentoo/kicktoo-5.2.profile ltsp-5.3.5/server/configs/Gentoo/kicktoo-5.2.profile --- ltsp-5.3.2/server/configs/Gentoo/kicktoo-5.2.profile 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/server/configs/Gentoo/kicktoo-5.2.profile 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,126 @@ +# setting config vars +if [ "${MAIN_ARCH}" = "x86" ]; then + use_linux32 +fi + +if [ -z "${BASE}" ]; then + BASE="/opt/ltsp" +fi + +if [ -z "${NAME}" ]; then + NAME="${ARCH}" +fi + +if [ -z "${CHROOT}" ]; then + CHROOT="${BASE}/${NAME}" +fi + +if [ -z "${LOCALE}" ]; then + LOCALE="en_US.UTF-8" +fi + +if [ -z "${TIMEZONE}" ]; then + TIMEZONE="$(> ${chroot_dir}/etc/make.conf <<- EOF + source /var/lib/layman/make.conf + EOF + + cat > ${chroot_dir}/etc/fstab <<- EOF + # DO NOT DELETE + EOF + + # making sure ltsp-client 5.3 is not installed + cat > ${chroot_dir}/etc/portage/package.mask <<- EOF + >=net-misc/ltsp-client-5.3 + EOF + + # linking ltsp profile from overlay + rm ${chroot_dir}/etc/make.profile + ln -s "/var/lib/layman/ltsp/profiles/default/linux/${MAIN_ARCH}/10.0/ltsp/" "${chroot_dir}/etc/make.profile" +} + +pre_build_kernel() { + if [ -n "${KERNEL_CONFIG_URI}" ]; then + kernel_config_uri "${KERNEL_CONFIG_URI}" + fi + + if [ -n "${KERNEL_SOURCES}" ]; then + kernel_sources "${KERNEL_SOURCES}" + fi + + genkernel_opts --makeopts="${MAKEOPTS}" + + if [ "${CCACHE}" == "true" ]; then + spawn_chroot "emerge ccache" + mount_bind "/var/tmp/ccache/${ARCH}" "${chroot_dir}/var/tmp/ccache" + genkernel_opts --makeopts="${MAKEOPTS}" --kernel-cc="/usr/lib/ccache/bin/gcc" --utils-cc="/usr/lib/ccache/bin/gcc" + fi +} + +pre_install_extra_packages() { + spawn_chroot "emerge --newuse udev" + spawn_chroot "emerge --update --deep world" +} + +post_install_extra_packages() { + # remove excluded packages + for package in ${EXCLUDE}; do + spawn_chroot "emerge --unmerge ${package}" + done + + # point /etc/mtab to /proc/mounts + spawn "ln -sf /proc/mounts ${chroot_dir}/etc/mtab" + + # make sure these exist + mkdir -p ${chroot_dir}/var/lib/nfs + mkdir -p ${chroot_dir}/var/lib/pulse + + # required for openrc's bootmisc + mkdir -p ${chroot_dir}/var/lib/misc +} diff -Nru ltsp-5.3.2/server/configs/Gentoo/kicktoo-5.3.profile ltsp-5.3.5/server/configs/Gentoo/kicktoo-5.3.profile --- ltsp-5.3.2/server/configs/Gentoo/kicktoo-5.3.profile 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/server/configs/Gentoo/kicktoo-5.3.profile 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,129 @@ +# setting config vars +if [ "${MAIN_ARCH}" = "x86" ]; then + use_linux32 +fi + +if [ -z "${BASE}" ]; then + BASE="/opt/ltsp" +fi + +if [ -z "${NAME}" ]; then + NAME="${ARCH}" +fi + +if [ -z "${CHROOT}" ]; then + CHROOT="${BASE}/${NAME}" +fi + +if [ -z "${LOCALE}" ]; then + LOCALE="en_US.UTF-8" +fi + +if [ -z "${TIMEZONE}" ]; then + TIMEZONE="$(> ${chroot_dir}/etc/make.conf <<- EOF + source /var/lib/layman/make.conf + EOF + + cat > ${chroot_dir}/etc/fstab <<- EOF + # DO NOT DELETE + EOF + + # making sure ltsp-client 5.2 is not installed + cat > ${chroot_dir}/etc/portage/package.mask <<- EOF + ${chroot_dir}/etc/portage/package.keywords <<- EOF + net-misc/ltsp-client + sys-fs/ltspfs + EOF + + # linking ltsp profile from overlay + rm ${chroot_dir}/etc/make.profile + ln -s "/var/lib/layman/ltsp/profiles/default/linux/${MAIN_ARCH}/10.0/ltsp/" "${chroot_dir}/etc/make.profile" +} + +pre_build_kernel() { + if [ -n "${KERNEL_CONFIG_URI}" ]; then + kernel_config_uri "${KERNEL_CONFIG_URI}" + fi + + if [ -n "${KERNEL_SOURCES}" ]; then + kernel_sources "${KERNEL_SOURCES}" + fi + + genkernel_opts --makeopts="${MAKEOPTS}" + + if [ "${CCACHE}" == "true" ]; then + spawn_chroot "emerge ccache" + mount_bind "/var/tmp/ccache/${ARCH}" "${chroot_dir}/var/tmp/ccache" + genkernel_opts --makeopts="${MAKEOPTS}" --kernel-cc="/usr/lib/ccache/bin/gcc" --utils-cc="/usr/lib/ccache/bin/gcc" + fi +} + +pre_install_extra_packages() { + spawn_chroot "emerge --newuse udev" + spawn_chroot "emerge --update --deep world" +} + +post_install_extra_packages() { + # remove excluded packages + for package in ${EXCLUDE}; do + spawn_chroot "emerge --unmerge ${package}" + done + + # point /etc/mtab to /proc/mounts + spawn "ln -sf /proc/mounts ${chroot_dir}/etc/mtab" + + # make sure these exist + mkdir -p ${chroot_dir}/var/lib/nfs + mkdir -p ${chroot_dir}/var/lib/pulse + + # required for openrc's bootmisc + mkdir -p ${chroot_dir}/var/lib/misc +} diff -Nru ltsp-5.3.2/server/configs/Gentoo/kicktoo.profile ltsp-5.3.5/server/configs/Gentoo/kicktoo.profile --- ltsp-5.3.2/server/configs/Gentoo/kicktoo.profile 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/server/configs/Gentoo/kicktoo.profile 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -# setting config vars -if [ "${MAIN_ARCH}" = "x86" ]; then - use_linux32 -fi - -if [ -z "${BASE}" ]; then - BASE="/opt/ltsp" -fi - -if [ -z "${NAME}" ]; then - NAME="${ARCH}" -fi - -if [ -z "${CHROOT}" ]; then - CHROOT="${BASE}/${NAME}" -fi - -if [ -z "${LOCALE}" ]; then - LOCALE="en_US.UTF-8" -fi - -if [ -z "${TIMEZONE}" ]; then - TIMEZONE="$(> ${chroot_dir}/etc/make.conf <<- EOF - source /var/lib/layman/make.conf - EOF - - cat > ${chroot_dir}/etc/fstab <<- EOF - # DO NOT DELETE - EOF - - # linking ltsp profile from overlay - rm ${chroot_dir}/etc/make.profile - ln -s "/var/lib/layman/ltsp/profiles/default/linux/${MAIN_ARCH}/10.0/ltsp/" "${chroot_dir}/etc/make.profile" -} - -pre_build_kernel() { - if [ -n "${KERNEL_CONFIG_URI}" ]; then - kernel_config_uri "${KERNEL_CONFIG_URI}" - fi - - if [ -n "${KERNEL_SOURCES}" ]; then - kernel_sources "${KERNEL_SOURCES}" - fi - - genkernel_opts --makeopts="${MAKEOPTS}" - - if [ "${CCACHE}" == "true" ]; then - spawn_chroot "emerge ccache" - mount_bind "/var/tmp/ccache/${ARCH}" "${chroot_dir}/var/tmp/ccache" - genkernel_opts --makeopts="${MAKEOPTS}" --kernel-cc="/usr/lib/ccache/bin/gcc" --utils-cc="/usr/lib/ccache/bin/gcc" - fi -} - -pre_install_extra_packages() { - spawn_chroot "emerge --newuse udev" - spawn_chroot "emerge --update --deep world" -} - -post_install_extra_packages() { - # remove excluded packages - for package in ${EXCLUDE}; do - spawn_chroot "emerge --unmerge ${package}" - done - - # point /etc/mtab to /proc/mounts - spawn "ln -sf /proc/mounts ${chroot_dir}/etc/mtab" - - # make sure these exist - mkdir -p ${chroot_dir}/var/lib/nfs - mkdir -p ${chroot_dir}/var/lib/pulse - - # required for openrc's bootmisc - mkdir -p ${chroot_dir}/var/lib/misc -} diff -Nru ltsp-5.3.2/server/configs/Gentoo/quickstart-5.2.profile ltsp-5.3.5/server/configs/Gentoo/quickstart-5.2.profile --- ltsp-5.3.2/server/configs/Gentoo/quickstart-5.2.profile 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/server/configs/Gentoo/quickstart-5.2.profile 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,161 @@ +install_mode chroot + +if [ "${MAIN_ARCH}" = "x86" ]; then + use_linux32 +fi + +if [ -z "${BASE}" ]; then + BASE="/opt/ltsp" +fi + +if [ -z "${NAME}" ]; then + NAME="${ARCH}" +fi + +if [ -z "${CHROOT}" ]; then + CHROOT="${BASE}/${NAME}" +fi + +if [ -z "${TIMEZONE}" ]; then + TIMEZONE="$(> /tmp/install.umount +} + +post_unpack_stage_tarball() { + # protecting locale.gen from updating, /etc is set in CONFIG_PROTECT_MASK + export CONFIG_PROTECT="/etc/locale.gen" + + if [ -n "$LOCALE" ]; then + echo "LANG=${LOCALE}" >> ${chroot_dir}/etc/env.d/02locale + grep ${LOCALE} /usr/share/i18n/SUPPORTED > ${chroot_dir}/etc/locale.gen + else + if [ -f /etc/env.d/02locale ]; then + cp /etc/env.d/02locale ${chroot_dir}/etc/env.d/ + fi + + cat > ${chroot_dir}/etc/locale.gen <<- EOF + en_US ISO-8859-1 + en_US.UTF-8 UTF-8 + EOF + fi +} + +pre_install_portage_tree() { + # bind mounting portage and binary package dir + mount_bind "/usr/portage" "${chroot_dir}/usr/portage" + mount_bind "/usr/portage/packages/${ARCH}" "${chroot_dir}/usr/portage/packages" + + # bind mounting layman, for overlay packages + # TODO: remove this mounting when the ltsp ebuilds are in the tree + mount_bind "/var/lib/layman" "${chroot_dir}/var/lib/layman" + + if [ -n "${MIRRORS}" ]; then + echo "GENTOO_MIRRORS="${MIRRORS}"" >> ${chroot_dir}/etc/make.conf + fi + + # TODO: don't add this by default + cat >> ${chroot_dir}/etc/make.conf <<- EOF + MAKEOPTS="${MAKEOPTS}" + source /var/lib/layman/make.conf + EOF + + cat > ${chroot_dir}/etc/fstab <<- EOF + # DO NOT DELETE + EOF + + # making sure ltsp-client 5.3 is not installed + cat > ${chroot_dir}/etc/portage/package.mask <<- EOF + >=net-misc/ltsp-client-5.3 + EOF + + # linking ltsp profile from overlay + rm ${chroot_dir}/etc/make.profile + ln -s "/var/lib/layman/ltsp/profiles/default/linux/${MAIN_ARCH}/10.0/ltsp/" "${chroot_dir}/etc/make.profile" +} + +pre_build_kernel() { + if [ -n "${KERNEL_CONFIG_URI}" ]; then + kernel_config_uri "${KERNEL_CONFIG_URI}" + fi + + if [ -n "${KERNEL_SOURCES}" ]; then + kernel_sources "${KERNEL_SOURCES}" + fi + + genkernel_opts --makeopts="${MAKEOPTS}" + + if [ "${CCACHE}" == "true" ]; then + spawn_chroot "emerge ccache" + mount_bind "/var/tmp/ccache/${ARCH}" "${chroot_dir}/var/tmp/ccache" + + cat >> ${chroot_dir}/etc/make.conf <<- EOF + FEATURES="ccache" + CCACHE_SIZE="4G" + EOF + + genkernel_opts --makeopts="${MAKEOPTS}" --kernel-cc="/usr/lib/ccache/bin/gcc" --utils-cc="/usr/lib/ccache/bin/gcc" + fi +} + +pre_install_extra_packages() { + spawn_chroot "emerge --newuse udev" + spawn_chroot "emerge --update --deep world" +} + +# adding a default font +extra_packages ldm ltsp-client dejavu ${PACKAGES} + +post_install_extra_packages() { + # remove excluded packages + for package in ${EXCLUDE}; do + spawn_chroot "emerge --unmerge ${package}" + done + + # point /etc/mtab to /proc/mounts + spawn "ln -sf /proc/mounts ${chroot_dir}/etc/mtab" + + # make sure these exist + mkdir -p ${chroot_dir}/var/lib/nfs + mkdir -p ${chroot_dir}/var/lib/pulse + + # required for openrc's bootmisc + mkdir -p ${chroot_dir}/var/lib/misc +} + +rcadd ltsp-client-setup boot +rcadd ltsp-client default diff -Nru ltsp-5.3.2/server/configs/Gentoo/quickstart-5.3.profile ltsp-5.3.5/server/configs/Gentoo/quickstart-5.3.profile --- ltsp-5.3.2/server/configs/Gentoo/quickstart-5.3.profile 1970-01-01 00:00:00.000000000 +0000 +++ ltsp-5.3.5/server/configs/Gentoo/quickstart-5.3.profile 2012-03-09 18:02:07.000000000 +0000 @@ -0,0 +1,160 @@ +install_mode chroot + +if [ "${MAIN_ARCH}" = "x86" ]; then + use_linux32 +fi + +if [ -z "${BASE}" ]; then + BASE="/opt/ltsp" +fi + +if [ -z "${NAME}" ]; then + NAME="${ARCH}" +fi + +if [ -z "${CHROOT}" ]; then + CHROOT="${BASE}/${NAME}" +fi + +if [ -z "${TIMEZONE}" ]; then + TIMEZONE="$(> /tmp/install.umount +} + +post_unpack_stage_tarball() { + # protecting locale.gen from updating, /etc is set in CONFIG_PROTECT_MASK + export CONFIG_PROTECT="/etc/locale.gen" + + if [ -n "$LOCALE" ]; then + echo "LANG=${LOCALE}" >> ${chroot_dir}/etc/env.d/02locale + grep ${LOCALE} /usr/share/i18n/SUPPORTED > ${chroot_dir}/etc/locale.gen + else + if [ -f /etc/env.d/02locale ]; then + cp /etc/env.d/02locale ${chroot_dir}/etc/env.d/ + fi + + cat > ${chroot_dir}/etc/locale.gen <<- EOF + en_US ISO-8859-1 + en_US.UTF-8 UTF-8 + EOF + fi +} + +pre_install_portage_tree() { + # bind mounting portage and binary package dir + mount_bind "/usr/portage" "${chroot_dir}/usr/portage" + mount_bind "/usr/portage/packages/${ARCH}" "${chroot_dir}/usr/portage/packages" + + # bind mounting layman, for overlay packages + # TODO: remove this mounting when the ltsp ebuilds are in the tree + mount_bind "/var/lib/layman" "${chroot_dir}/var/lib/layman" + + if [ -n "${MIRRORS}" ]; then + echo "GENTOO_MIRRORS="${MIRRORS}"" >> ${chroot_dir}/etc/make.conf + fi + + # TODO: don't add this by default + cat >> ${chroot_dir}/etc/make.conf <<- EOF + MAKEOPTS="${MAKEOPTS}" + source /var/lib/layman/make.conf + EOF + + cat > ${chroot_dir}/etc/fstab <<- EOF + # DO NOT DELETE + EOF + + # making sure ltsp-client 5.2 is not installed + cat > ${chroot_dir}/etc/portage/package.mask <<- EOF + ${chroot_dir}/etc/portage/package.keywords <<- EOF + net-misc/ltsp-client + sys-fs/ltspfs + EOF + + # linking ltsp profile from overlay + rm ${chroot_dir}/etc/make.profile + ln -s "/var/lib/layman/ltsp/profiles/default/linux/${MAIN_ARCH}/10.0/ltsp/" "${chroot_dir}/etc/make.profile" +} + +pre_build_kernel() { + if [ -n "${KERNEL_CONFIG_URI}" ]; then + kernel_config_uri "${KERNEL_CONFIG_URI}" + fi + + if [ -n "${KERNEL_SOURCES}" ]; then + kernel_sources "${KERNEL_SOURCES}" + fi + + genkernel_opts --makeopts="${MAKEOPTS}" + + if [ "${CCACHE}" == "true" ]; then + spawn_chroot "emerge ccache" + mount_bind "/var/tmp/ccache/${ARCH}" "${chroot_dir}/var/tmp/ccache" + + cat >> ${chroot_dir}/etc/make.conf <<- EOF + FEATURES="ccache" + CCACHE_SIZE="4G" + EOF + + genkernel_opts --makeopts="${MAKEOPTS}" --kernel-cc="/usr/lib/ccache/bin/gcc" --utils-cc="/usr/lib/ccache/bin/gcc" + fi +} + +pre_install_extra_packages() { + spawn_chroot "emerge --newuse udev" + spawn_chroot "emerge --update --deep world" +} + +# adding a default font +extra_packages ldm ltsp-client dejavu ${PACKAGES} + +post_install_extra_packages() { + # remove excluded packages + for package in ${EXCLUDE}; do + spawn_chroot "emerge --unmerge ${package}" + done + + # point /etc/mtab to /proc/mounts + spawn "ln -sf /proc/mounts ${chroot_dir}/etc/mtab" + + # make sure these exist + mkdir -p ${chroot_dir}/var/lib/nfs + mkdir -p ${chroot_dir}/var/lib/pulse + + # required for openrc's bootmisc + mkdir -p ${chroot_dir}/var/lib/misc +} diff -Nru ltsp-5.3.2/server/configs/Gentoo/quickstart.profile ltsp-5.3.5/server/configs/Gentoo/quickstart.profile --- ltsp-5.3.2/server/configs/Gentoo/quickstart.profile 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/server/configs/Gentoo/quickstart.profile 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -install_mode chroot - -if [ "${MAIN_ARCH}" = "x86" ]; then - use_linux32 -fi - -if [ -z "${BASE}" ]; then - BASE="/opt/ltsp" -fi - -if [ -z "${NAME}" ]; then - NAME="${ARCH}" -fi - -if [ -z "${CHROOT}" ]; then - CHROOT="${BASE}/${NAME}" -fi - -if [ -z "${TIMEZONE}" ]; then - TIMEZONE="$(> /tmp/install.umount -} - -post_unpack_stage_tarball() { - # protecting locale.gen from updating, /etc is set in CONFIG_PROTECT_MASK - export CONFIG_PROTECT="/etc/locale.gen" - - if [ -n "$LOCALE" ]; then - echo "LANG=${LOCALE}" >> ${chroot_dir}/etc/env.d/02locale - grep ${LOCALE} /usr/share/i18n/SUPPORTED > ${chroot_dir}/etc/locale.gen - else - if [ -f /etc/env.d/02locale ]; then - cp /etc/env.d/02locale ${chroot_dir}/etc/env.d/ - fi - - cat > ${chroot_dir}/etc/locale.gen <<- EOF - en_US ISO-8859-1 - en_US.UTF-8 UTF-8 - EOF - fi -} - -pre_install_portage_tree() { - # bind mounting portage and binary package dir - mount_bind "/usr/portage" "${chroot_dir}/usr/portage" - mount_bind "/usr/portage/packages/${ARCH}" "${chroot_dir}/usr/portage/packages" - - # bind mounting layman, for overlay packages - # TODO: remove this mounting when the ltsp ebuilds are in the tree - mount_bind "/var/lib/layman" "${chroot_dir}/var/lib/layman" - - if [ -n "${MIRRORS}" ]; then - echo "GENTOO_MIRRORS="${MIRRORS}"" >> ${chroot_dir}/etc/make.conf - fi - - # TODO: don't add this by default - cat >> ${chroot_dir}/etc/make.conf <<- EOF - MAKEOPTS="${MAKEOPTS}" - source /var/lib/layman/make.conf - EOF - - cat > ${chroot_dir}/etc/fstab <<- EOF - # DO NOT DELETE - EOF - - # linking ltsp profile from overlay - rm ${chroot_dir}/etc/make.profile - ln -s "/var/lib/layman/ltsp/profiles/default/linux/${MAIN_ARCH}/10.0/ltsp/" "${chroot_dir}/etc/make.profile" -} - -pre_build_kernel() { - if [ -n "${KERNEL_CONFIG_URI}" ]; then - kernel_config_uri "${KERNEL_CONFIG_URI}" - fi - - if [ -n "${KERNEL_SOURCES}" ]; then - kernel_sources "${KERNEL_SOURCES}" - fi - - genkernel_opts --makeopts="${MAKEOPTS}" - - if [ "${CCACHE}" == "true" ]; then - spawn_chroot "emerge ccache" - mount_bind "/var/tmp/ccache/${ARCH}" "${chroot_dir}/var/tmp/ccache" - - cat >> ${chroot_dir}/etc/make.conf <<- EOF - FEATURES="ccache" - CCACHE_SIZE="4G" - EOF - - genkernel_opts --makeopts="${MAKEOPTS}" --kernel-cc="/usr/lib/ccache/bin/gcc" --utils-cc="/usr/lib/ccache/bin/gcc" - fi -} - -pre_install_extra_packages() { - spawn_chroot "emerge --newuse udev" - spawn_chroot "emerge --update --deep world" -} - -# adding a default font -extra_packages ldm ltsp-client dejavu ${PACKAGES} - -post_install_extra_packages() { - # remove excluded packages - for package in ${EXCLUDE}; do - spawn_chroot "emerge --unmerge ${package}" - done - - # point /etc/mtab to /proc/mounts - spawn "ln -sf /proc/mounts ${chroot_dir}/etc/mtab" - - # make sure these exist - mkdir -p ${chroot_dir}/var/lib/nfs - mkdir -p ${chroot_dir}/var/lib/pulse - - # required for openrc's bootmisc - mkdir -p ${chroot_dir}/var/lib/misc -} - -rcadd ltsp-client-setup boot -rcadd ltsp-client default diff -Nru ltsp-5.3.2/server/ltsp-update-kernels ltsp-5.3.5/server/ltsp-update-kernels --- ltsp-5.3.2/server/ltsp-update-kernels 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/server/ltsp-update-kernels 2012-03-09 18:02:07.000000000 +0000 @@ -12,6 +12,7 @@ # Warren Togami # Oliver Grawert # 2009, Warren Togami +# 2012, Alkis Georgopoulos # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -34,7 +35,7 @@ usage() { cat < /dev/null - ### Cleanup old kernels and images from tftpboot directory ### - # Find $version from vmlinuz-* filename - # if corresponding /opt/ltsp/$arch/lib/modules/$version is missing - # then delete kernel and images from tftpboot directory - # - # Some distros wont match vmlinuz-*, but this is at least safe - # because it will simply cleanup nothing. - removefiles() { - # Common - rm -f $archpath/vmlinuz-$version - rm -f $archpath/config-$version - rm -f $archpath/System.map-$version - # Fedora - rm -f $archpath/initrd-$version.img - rm -f $archpath/initramfs-$version.img - rm -f $archpath/elf-$version.img - rm -f $archpath/wraplinux-nbi-$version.img - rm -f $archpath/aout-$version.img - rm -f $archpath/symvers-$version.gz - # Debian - rm -f $archpath/initrd.img-$version - rm -f $archpath/nbi.img-$version - # Ubuntu - rm -f $archpath/abi-$version - rm -f $archpath/vmcoreinfo-$version - } - # Loop through every arch - for archpath in $(find $TFTPDIR/$TFTPBOOTDIR -mindepth 1 -maxdepth 1 -type d); do - arch=`basename $archpath` + echo "Updating $TFTPDIR directories for chroot: $CHROOT" + CHROOT_NAME="$(basename $CHROOT)" + + if [ "$COPYTFTP" = "true" ]; then + mkdir -p $TFTPBOOT/$CHROOT_NAME + cp -a $CHROOT/boot/. $TFTPBOOT/$CHROOT_NAME/ + + # Make sure permissions are always correct (LP: #759115) + chmod -f 644 $TFTPBOOT/$CHROOT_NAME/vmlinuz-* $TFTPBOOT/$CHROOT_NAME/initrd.img-* $TFTPBOOT/$CHROOT_NAME/nbi.img-* || true + fi + + # OFW on Mac is lame, they cannot tftp from directories + if [ -e $TFTPBOOT/$CHROOT_NAME/yaboot ]; then + ln -sf ltsp/$CHROOT_NAME/yaboot $TFTPDIR/yaboot + ln -sf ltsp/$CHROOT_NAME/yaboot.conf $TFTPDIR/yaboot.conf + fi + + ### Cleanup old kernels and images from tftpboot directory ### + # Find $version from vmlinuz-* filename, + # if corresponding /opt/ltsp/$CHROOT_NAME/lib/modules/$version is + # missing, then delete kernel and images from tftpboot directory. + # + # Some distros won't match vmlinuz-*, but this is at least safe + # because it will simply cleanup nothing. + # Loop through every vmlinuz-* file - for kernelpath in $(find $TFTPDIR/$TFTPBOOTDIR/$arch -name 'vmlinuz-*'); do + for kernelpath in $(find $TFTPBOOT/$CHROOT_NAME -name 'vmlinuz-*'); do kernel=`basename $kernelpath` version=${kernel##vmlinuz-} - if [ ! -d $BASE/$arch/lib/modules/$version ]; then + if [ ! -d $BASE/$CHROOT_NAME/lib/modules/$version ]; then echo "Removing $kernelpath" - removefiles + # Common + rm -f $TFTPBOOT/$CHROOT_NAME/vmlinuz-$version + rm -f $TFTPBOOT/$CHROOT_NAME/config-$version + rm -f $TFTPBOOT/$CHROOT_NAME/System.map-$version + # Fedora + rm -f $TFTPBOOT/$CHROOT_NAME/initrd-$version.img + rm -f $TFTPBOOT/$CHROOT_NAME/initramfs-$version.img + rm -f $TFTPBOOT/$CHROOT_NAME/elf-$version.img + rm -f $TFTPBOOT/$CHROOT_NAME/wraplinux-nbi-$version.img + rm -f $TFTPBOOT/$CHROOT_NAME/aout-$version.img + rm -f $TFTPBOOT/$CHROOT_NAME/symvers-$version.gz + # Debian + rm -f $TFTPBOOT/$CHROOT_NAME/initrd.img-$version + rm -f $TFTPBOOT/$CHROOT_NAME/nbi.img-$version + # Ubuntu + rm -f $TFTPBOOT/$CHROOT_NAME/abi-$version + rm -f $TFTPBOOT/$CHROOT_NAME/vmcoreinfo-$version fi done done + # Update selinux file contexts if necessary + [ -f /selinux/enforce ] && /sbin/restorecon -R $TFTPDIR > /dev/null done -exit 0 diff -Nru ltsp-5.3.2/server/plugins/ltsp-build-client/Ubuntu/030-fat-client ltsp-5.3.5/server/plugins/ltsp-build-client/Ubuntu/030-fat-client --- ltsp-5.3.2/server/plugins/ltsp-build-client/Ubuntu/030-fat-client 2012-02-23 19:19:07.000000000 +0000 +++ ltsp-5.3.5/server/plugins/ltsp-build-client/Ubuntu/030-fat-client 2012-03-09 18:02:07.000000000 +0000 @@ -46,14 +46,6 @@ return 0 fi - # Tag that the user requested a fat chroot, so that we can set - # appropriate defaults when the clients boot - echo FAT_CLIENT_DESKTOPS="'$(echo $FAT_CLIENT_DESKTOPS)'" >> $ROOT/etc/ltsp_fat_chroot - - # Notify the user about the different defaults - echo "--fat-client was specified, all clients will boot as fat clients by default." - echo "To modify this behavior, put LTSP_FATCLIENT=False in lts.conf." - # Install the packages for package in ubuntu-standard $FAT_CLIENT_DESKTOPS; do echo "Installing $package"