[debian-edu-commits] [Git][debian-edu/debian-edu-config][bullseye] Add real support for LTSP chroot setup and maintenance (Closes: #996103)

Wolfgang Schweer (@schweer-guest) gitlab at salsa.debian.org
Thu Nov 18 18:39:15 GMT 2021



Wolfgang Schweer pushed to branch bullseye at Debian Edu / debian-edu-config


Commits:
136a4164 by Wolfgang Schweer at 2021-11-18T19:34:50+01:00
Add real support for LTSP chroot setup and maintenance (Closes: #996103)

Adjust existing scripts and manual page for improved LTSP chroot setup:
  sbin/debian-edu-ltsp-install: Add LTSP diskless client chroot creation,
  use uniform locations for X2Go thin clients and diskless workstations,
  ensure sitesummary-client setup and configuration inside chroots, care
  for proper mount and umount operation, add xrdp-sesman to the list of
  masked services for LTSP clients, make sure all kernels are updated,
  adjust the ltsp.conf file content to match the changes, replace last
  edit date with version number, adjust usage information accordingly.

  share/debian-edu-config/tools/run-at-firstboot: Care for the changed
  'debian-edu-ltsp-install' default options to make sure combined server
  installations have a generated SquashFS image file just like before.

  share/man/man8/debian-edu-ltsp-install.8: Update to reflect the changes..

Provide maintenance related scripts and manual pages:
  sbin/debian-edu-ltsp-chroot: Tool to make LTSP chroot maintenance easy.
  sbin/debian-edu-ltsp-initrd: Wrapper script for 'ltsp initrd' command.
  It makes sure that a use case specific initrd (/srv/tftp/ltsp/ltsp.img)
  is generated and moved to the right location.

  sbin/debian-edu-ltsp-ipxe: Wrapper script for 'ltsp ipxe' command. It
  cares for a Debian Edu specific /srv/tftp/ltsp/ltsp.ipxe content.

  share/debian-edu-config/tools/ltsp-addfirmware: Install firmware in LTSP
  chroots in case clients won't work otherwise. (Adjusted tool from Buster
  re-added to the binary package.)

  share/man/man8/debian-edu-ltsp-chroot.8

  share/man/man8/debian-edu-ltsp-initrd.8

  share/man/man8/debian-edu-ltsp-ipxe.8

Signed-off-by: Wolfgang Schweer <wschweer at arcor.de>

- - - - -


12 changed files:

- Makefile
- debian/changelog
- + sbin/debian-edu-ltsp-chroot
- + sbin/debian-edu-ltsp-initrd
- sbin/debian-edu-ltsp-install
- + sbin/debian-edu-ltsp-ipxe
- share/debian-edu-config/tools/ltsp-addfirmware
- share/debian-edu-config/tools/run-at-firstboot
- + share/man/man8/debian-edu-ltsp-chroot.8
- + share/man/man8/debian-edu-ltsp-initrd.8
- share/man/man8/debian-edu-ltsp-install.8
- + share/man/man8/debian-edu-ltsp-ipxe.8


Changes:

=====================================
Makefile
=====================================
@@ -6,7 +6,10 @@ PROGS = \
 	debian-edu-copy-pki
 
 SPROGS = debian-edu-fsautoresize \
+	debian-edu-ltsp-chroot \
 	debian-edu-ltsp-install \
+	debian-edu-ltsp-initrd \
+	debian-edu-ltsp-ipxe \
 	debian-edu-pxeinstall \
 	debian-edu-restart-services \
 	debian-edu-test-install \
@@ -285,6 +288,7 @@ install: install-testsuite
 		share/debian-edu-config/tools/ldapdump.sh \
 		share/debian-edu-config/tools/ldappasswd2 \
 		share/debian-edu-config/tools/locate-syslog-collector \
+		share/debian-edu-config/tools/ltsp-addfirmware \
 		share/debian-edu-config/tools/logoutkill.sh \
 		share/debian-edu-config/tools/missing-desktop-file \
 		share/debian-edu-config/tools/movehome \


=====================================
debian/changelog
=====================================
@@ -1,8 +1,38 @@
 debian-edu-config (2.11.56+deb11u2) UNRELEASED; urgency=medium
 
+  [ Mike Gabriel ]
   * share/debian-edu-config/tools/pxe-addfirmware: Fix TFTP server path
     (/var/lib/tftpboot-> /srv/tftp). (Closes: #995610).
 
+  [ Wolfgang Schweer ]
+  * Add real support for LTSP chroot setup and maintenance. (Closes: #996103).
+    - Adjust existing scripts and manual page for improved LTSP chroot setup:
+      + sbin/debian-edu-ltsp-install: Add LTSP diskless client chroot creation,
+        use uniform locations for X2Go thin clients and diskless workstations,
+        ensure sitesummary-client setup and configuration inside chroots, care
+        for proper mount and umount operation, add xrdp-sesman to the list of
+        masked services for LTSP clients, make sure all kernels are updated,
+        adjust the ltsp.conf file content to match the changes, replace last
+        edit date with version number, adjust usage information accordingly.
+      + share/debian-edu-config/tools/run-at-firstboot: Care for the changed
+        'debian-edu-ltsp-install' default options to make sure combined server
+        installations have a generated SquashFS image file just like before.
+      + share/man/man8/debian-edu-ltsp-install.8: Update to reflect the changes.
+    - Provide maintenance related scripts and manual pages:
+      + sbin/debian-edu-ltsp-chroot: Tool to make LTSP chroot maintenance easy.
+      + sbin/debian-edu-ltsp-initrd: Wrapper script for 'ltsp initrd' command.
+        It makes sure that a use case specific initrd (/srv/tftp/ltsp/ltsp.img)
+        is generated and moved to the right location.
+      + sbin/debian-edu-ltsp-ipxe: Wrapper script for 'ltsp ipxe' command. It
+        cares for a Debian Edu specific /srv/tftp/ltsp/ltsp.ipxe content..
+      + share/debian-edu-config/tools/ltsp-addfirmware: Install firmware in LTSP
+        chroots in case clients won't work otherwise. (Adjusted tool from Buster
+        re-added to the binary package.)
+      + share/man/man8/debian-edu-ltsp-chroot.8
+      + share/man/man8/debian-edu-ltsp-initrd.8
+      + share/man/man8/debian-edu-ltsp-ipxe.8
+  * Adjust Makefile to reflect the changes.
+
  -- Mike Gabriel <sunweaver at debian.org>  Sun, 03 Oct 2021 10:13:28 +0200
 
 debian-edu-config (2.11.56+deb11u1) bullseye; urgency=medium


=====================================
sbin/debian-edu-ltsp-chroot
=====================================
@@ -0,0 +1,187 @@
+#!/bin/sh
+
+# Based upon the 'ltsp-chroot' script and 'ltsp-server-functions', both shipped
+# with package 'ltsp-server 5.18.12-3' (Debian Buster).
+
+# Original information about authors and copyright:
+# copyright 2009 Vagrant Cascadian <vagrant at freegeek.org>,
+# 2010 Alkis Georgopoulos <alkisg at gmail.com>,
+# 2011 Wim Muskee <wimmuskee at gmail.com>, distributed under the
+# terms of the GNU General Public License v2 or any later version.
+
+# Reduced to the bare minimum and adjusted to be useful for Debian Edu Bullseye.
+# Also, integrated everything into one tool to be usable standalone.
+# 2021 Wolfgang Schweer <wschweer at arcor.de>, distributed under the
+# terms of the GNU General Public License v2 or any later version.
+# first edited:	2020-09-28
+
+version=2021-10-02
+
+# generic functions
+
+usage() {
+cat <<EOF
+Usage: $0 [OPTION] command
+
+Chroots into a specified LTSP chroot. Optional arguments can be provided to customize
+the chroot location as well as extra mounts.
+
+Options:
+  -b, --base[=PATH]             Sets base of target chroot. Defaults to /srv/ltsp/dlw if unspecified.
+  -d, --mount-dev               If set, mounts the server dev and devpts directories to the chroot
+                                previous to chrooting.
+  -h, --help                    Displays the debian-edu-ltsp-chroot help message.
+  -p, --mount-proc              If set, mounts the server /proc to the chroot previous to chrooting.
+  -m, --mount-all               If set, does both --mount-dev and --mount-proc previous to chrooting.
+      --version                 Output version information and exit.
+EOF
+}
+
+default_options() {
+    BASE=${BASE:-/srv/ltsp/dlw}
+    # If $BASE contains a terminating /, remove it
+    BASE=${BASE%/}
+}
+
+pre_chroot() {
+    test -d "$BASE" || die "ERROR: ltsp chroot not found: $BASE"
+
+    if boolean_is_true "$MOUNT_ALL"; then
+        MOUNT_DEV=true
+        MOUNT_PROC=true
+    fi
+    if boolean_is_true "$MOUNT_DEV"; then
+        mark_mount --bind "/dev" "$BASE/dev"
+        mark_mount -t devpts -o rw,noexec,nosuid,gid=5,mode=620 devpts "$BASE/dev/pts"
+    fi
+    if boolean_is_true "$MOUNT_PROC"; then
+        mark_mount -t proc proc "$BASE/proc"
+    fi
+}
+
+post_chroot() {
+    # Stop trapping
+    trap - 0 HUP INT QUIT KILL SEGV PIPE TERM
+    umount_marked
+}
+
+# Next functions are taken from ltsp-server-functions).
+
+warn()
+{
+    printf "%s\n" "$*" >&2
+}
+
+die() {
+    warn "$@"
+    exit 1
+}
+
+boolean_is_true(){
+    case $1 in
+       # match all cases of true|y|yes
+       [Tt][Rr][Uu][Ee]|[Yy]|[Yy][Ee][Ss]) return 0 ;;
+       *) return 1 ;;
+    esac
+}
+
+require_root()
+{
+    if [ ${UID:-$(id -u)} -ne 0 ]; then
+        die "Superuser privileges are needed."
+    fi
+}
+
+# Remember mounted dirs so that it's easier to unmount them with a single call
+# to umount_marked. They'll be unmounted in reverse order.
+# Use the normal mount syntax, e.g.
+#   mark_mount -t proc proc "$ROOT/proc"
+mark_mount() {
+    local dir old_marked_mounts
+
+    # The last parameter is the dir we need to remember to unmount
+    dir=$(eval "echo \$$#")
+    # If the user presses Ctrl+C while mount is still running, there's
+    # a possibility that it will succeed but it won't go inside the if.
+    # So mark the dir before mount.
+    # Use newlines to separate dirs, in case they contain spaces
+    old_marked_mounts="$MARKED_MOUNTS"
+    if [ -z "$MARKED_MOUNTS" ]; then
+        MARKED_MOUNTS="$dir"
+    else
+        MARKED_MOUNTS="$dir
+$MARKED_MOUNTS"
+    fi
+    if ! mount "$@"; then
+        MARKED_MOUNTS="$old_marked_mounts"
+        die "Could not mount $dir."
+    fi
+}
+
+umount_marked() {
+    [ -z "$MARKED_MOUNTS" ] && return 0
+
+    # Wait until all buffers are flushed, otherwise umount might fail
+    sync
+    echo "$MARKED_MOUNTS" | while read -r dir; do
+        if ! umount "$dir"; then
+            warn "Couldn't unmount $dir."
+        fi
+    done
+    unset MARKED_MOUNTS
+}
+
+umount_marked() {
+    [ -z "$MARKED_MOUNTS" ] && return
+
+    # Wait until all buffers are flushed, otherwise umount might fail
+    sync
+    echo "$MARKED_MOUNTS" | while read -r dir; do
+        # binfmt_misc might need to be unmounted manually, see LP #534211
+        if [ "$dir%/proc}" != "$dir" ] && 
+            [ -d "$dir/sys/fs/binfmt_misc" ] && [ -f "$dir/mounts" ] &&
+            grep -q "^binfmt_misc $dir/sys/fs/binfmt_misc" "$dir/mounts"; then
+            if ! umount "$dir/sys/fs/binfmt_misc"; then
+                echo "Couldn't unmount $dir/sys/fs/binfmt_misc." >&2
+            fi
+        fi
+        if ! umount "$dir"; then
+            echo "Couldn't unmount $dir." >&2
+        fi
+    done
+    unset MARKED_MOUNTS
+}
+
+# The command line parameters override the configuration file settings
+if ! args=$(getopt -n "$0" -o +a:b:dhmp -l \
+    'base:,mount-dev,help,mount-all,mount-proc,version' -- "$@"); then
+    exit 1
+fi
+eval "set -- $args"
+while true; do
+    case "$1" in
+        -b|--base) shift; BASE=$1 ;;
+        -d|--mount-dev) MOUNT_DEV=true ;;
+        -h|--help) usage; exit 0 ;;
+        -m|--mount-all) MOUNT_ALL=true ;;
+        -p|--mount-proc) MOUNT_PROC=true ;;
+        --version) echo $version; exit 0 ;;
+        --) shift; break ;;
+        *) die "$0: Internal error!" ;;
+    esac
+    shift
+done
+
+# Finally, fall back to using default values for any unset options
+default_options
+
+require_root
+
+trap "post_chroot" 0 HUP INT QUIT SEGV PIPE TERM
+pre_chroot
+
+# Unset temporary directory variables to avoid problems when directory
+# is missing inside the chroot. https://bugs.debian.org/765443
+unset TMPDIR TEMP TEMPDIR TMP
+
+chroot "$BASE" "$@"


=====================================
sbin/debian-edu-ltsp-initrd
=====================================
@@ -0,0 +1,126 @@
+#!/bin/bash
+#
+# Debian Edu specific replacement for 'ltsp initrd' command.
+# Author/Copyright:	Wolfgang Schweer <wschweer at arcor.de>
+# Licence:		GPL2+
+# first edited:	2021-11-10
+
+version=2021-11-11
+
+set -e
+
+usage() {
+	cat <<EOF
+Usage: $0 command
+
+Update specific LTSP initrd file (ltsp.img) for each use case. This needs to be
+done after the /etc/ltsp/ltsp.conf [clients] section has been modified.
+
+Options:
+	--help     Display the debian-edu-ltsp-initrd help message.
+	--version  Output version information and exit.
+EOF
+}
+
+thin() {
+	type="$1"
+	# Add specific configuration.
+	cat <<EOF >> /etc/ltsp/ltsp.conf
+POST_INIT_THIN_USER='useradd -G disk -m -d /run/home/thin -k /etc/ltsp/skel -r thin'
+POST_INIT_SYSTEMD='mkdir /etc/systemd/system/getty at tty1.service.d && \
+cp /etc/ltsp/getty at tty1.service.d/override.conf /etc/systemd/system/getty at tty1.service.d'
+POST_INIT_AUTOFS='cp /etc/ltsp/autofs/extra.autofs /etc/auto.master.d && \
+cp /etc/ltsp/autofs/auto.* /etc'
+EOF
+	# Create the ltsp.img file and move it to the right location.
+	echo "Updating LTSP initrd for $type:"
+	ltsp initrd
+	mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/"$type"/ltsp.img
+	echo "Moved /srv/tftp/ltsp/ltsp.img to /srv/tftp/ltsp/$type/"
+
+	# Clean up ltsp.conf from image specific items.
+	sed -i '/POST_INIT/d' /etc/ltsp/ltsp.conf
+}
+
+dlw() {
+	# Add specific configuration.
+	cat <<EOF >> /etc/ltsp/ltsp.conf
+LIGHTDM_CONF="greeter-hide-users"
+POST_INIT_USE_FQDN="sed -i '/10.0.2.2/ s/server/tjener.intern tjener/' /etc/hosts"
+EOF
+	# Create the ltsp.img file and move it to the right location.
+	echo "Updating LTSP initrd for dlw:"
+	ltsp initrd
+	mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/dlw/
+	echo "Moved /srv/tftp/ltsp/ltsp.img to /srv/tftp/ltsp/dlw/"
+
+	# Clean up ltsp.conf from image specific items.
+	sed -i '/POST_INIT/d' /etc/ltsp/ltsp.conf
+	sed -i '/LIGHTDM_CONF/d' /etc/ltsp/ltsp.conf
+}
+
+server() {
+
+	# Add specific configuration.
+	if echo "$PROFILE" | grep -Eq 'Main-Server' ; then
+		# The image is a copy of the main server's fs. On the server, autofs
+		# is disabled, but it is needed for diskless workstations.
+		# OTOH some services need to be disabled, i.e. 'masked'.
+		cat <<EOF >> /etc/ltsp/ltsp.conf
+PRE_INIT_AUTOFS="echo 'LDAPURI=ldap://ldap' >> /etc/default/autofs"
+PRE_INIT_MAIN_SERVER="systemctl enable autofs"
+POST_INIT_USE_FQDN="sed -i '/10.0.2.2/ s/server/tjener.intern tjener/' /etc/hosts"
+POST_INIT_SITESUMMARY="sed -i 's/main-server/ltsp-client/' /etc/sitesummary/hostclass"
+MASK_SYSTEM_SERVICES="apache2 named cups dovecot etckeeper exim4 squid tftpd-hpa \
+icinga2 nmbd slapd smbd systemd-journald xrdp xrdp-sesman krb5-kdc mariadb cfengine3 isc-dhcp-server"
+EOF
+	else
+		cat <<EOF >> /etc/ltsp/ltsp.conf
+MASK_SYSTEM_SERVICES="etckeeper exim4 tftpd-hpa isc-dhcp-server xrdp xrdp-sesman"
+EOF
+	fi
+	# Update the ltsp.img file and move it to the right location.
+	echo "Updating LTSP initrd for use with the server's filesystem:"
+	ltsp initrd
+	if uname -r | grep -q 686 ; then
+		mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/x86_32/ltsp.img
+		echo "Moved /srv/tftp/ltsp/ltsp.img to /srv/tftp/ltsp/x86_32/"
+	else
+		mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/"$(uname -m)"/ltsp.img
+		echo "Moved /srv/tftp/ltsp/ltsp.img to /srv/tftp/ltsp/x86_64/"
+	fi
+
+	# Clean up ltsp.conf from specific items.
+	sed -i '/PRE_INIT_MAIN/d' /etc/ltsp/ltsp.conf
+	sed -i '/PRE_INIT_AUTOFS/d' /etc/ltsp/ltsp.conf
+	sed -i '/MASK_SYSTEM/d' /etc/ltsp/ltsp.conf
+}
+
+case "$1" in
+	-h|--help) usage ; exit 0 ;;
+	--version) echo $version ; exit 0 ;;
+esac
+
+# Make Debian Edu profile available.
+if [ -r /etc/debian-edu/config ] ; then
+	. /etc/debian-edu/config
+fi
+
+# LTSP images base directory
+BASE="/srv/tftp/ltsp"
+
+if [ -d "$BASE"/x86_64 ] || [ -d "$BASE"/x86_32 ]; then server ; fi
+if [ -d "$BASE"/dlw ] ; then dlw ; fi
+
+# X2Go thin client variants.
+variants="bare-amd64 display-amd64 desktop-amd64 bare-i386 display-i386 desktop-i386"
+
+for i in $variants ; do
+    if [ -d $BASE/x2go-"$i" ] ; then thin x2go-"$i" ; fi
+done
+
+case "$1" in
+	-h|--help) usage ; exit 0 ;;
+	--version) echo $version ; exit 0 ;;
+	*) exit 0 ;;
+esac


=====================================
sbin/debian-edu-ltsp-install
=====================================
@@ -17,7 +17,8 @@
 # Author/Copyright:	Wolfgang Schweer <wschweer at arcor.de>
 # Licence:		GPL2+
 # first edited:	2019-11-21
-# last edited:	2021-09-14
+
+version=2021-11-18
 
 set -e
 
@@ -32,18 +33,26 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
 
 Usage information:
 
-debian-edu-ltsp-install --arch <amd64|i386> --dist <stable|testing|sid> --dns_server <10.0.2.2|dns server ip> --diskless_workstation <yes|no> --thin_type <bare|display|desktop>
+debian-edu-ltsp-install --arch <amd64|i386> --dist <stable|testing|sid> --dns_server <10.0.2.2|dns server ip> --diskless_workstation <yes|no> --thin_type <bare|display|desktop> --dlw <yes|no> --img <yes|no> --desktop <xfce|cinnamon|gnome|kde|lxde|lxqt|mate|none>
 
 Turn a Debian Edu workstation into an LTSP server for both diskless
 workstations and thin clients.
 
 --arch       takes effect for a thin client chroot setup, default value is the system architecture one.
 
---dist       takes effect for a thin client chroot setup, default value is the one the LTSP server is running.
+--dist       takes effect for a LTSP/X2Go client chroot setup, default value is the one the LTSP server is running.
+
+--dns_server defaults to 10.0.2.2 if omitted.
+
+--diskless_workstation defaults to no if omitted.
+
+--dlw        used to create a diskless workstation LTSP chroot (root fs via NFS), default is no.
 
---dns_server defaults to 10.0.2.2 if unset.
+--img        takes effect for LTSP diskless workstation and X2Go thin client chroot setup, default is yes.
 
---diskless_workstation defaults to yes if omitted.
+--desktop    takes effect for LTSP diskless workstation chroot setup, default is xfce.
+             Other values: cinnamon, gnome, kde, lxde, lxqt, mate.
+             (And 'none' for modular installations - also useful for testing).
 
 --thin_type  has no default value. These are available:
     bare:    preconfigured x2go client running via 'startx' as user 'thin' with sound and
@@ -51,10 +60,21 @@ workstations and thin clients.
     display: x2gothinclient running in display mode.
     desktop: x2gothinclient running in minidesktop mode.
 
-Example 1: 'debian-edu-ltsp-install --arch amd64' creates diskless workstation support.
-Example 2: 'debian-edu-ltsp-install --arch amd64 --dist bullseye --thin_type bare' creates diskless workstation and 64-bit thin client support.
-            LTSP client boot defaults to diskless workstation.
-Example 3: 'debian-edu-ltsp-install --arch i386 --diskless_workstation no --thin_type bare' creates additional 32-bit thin client support. 
+Example 1: 'debian-edu-ltsp-install --diskless_workstation yes' creates diskless workstation support (SquashFS image).
+
+Example 2: 'debian-edu-ltsp-install --arch amd64 --diskless_workstation yes --thin_type bare' creates diskless workstation
+            and 64-bit thin client support. LTSP client boot defaults to diskless workstation.
+
+Example 3: 'debian-edu-ltsp-install --arch i386 --thin_type bare' creates additional 32-bit thin client support.
+
+Example 4: 'debian-edu-ltsp-install --diskless_workstation yes' updates the diskless workstation SquashFS image.
+
+Example 5: 'debian-edu-ltsp-install --dlw yes --img no' creates a diskless workstation LTSP chroot.
+            Please note that about 15 GiB of additional disk space is needed. In the default case, run the commands
+            'lvresize -L+15G /dev/vg_system/srv+ltsp' and 'resize2fs /dev/vg_system/srv+ltsp'.
+
+Example 6: 'debian-edu-ltsp-install --dlw yes' creates diskless workstation LTSP chroot and
+           the related SquashFS image. Another 5 GiB more additional disk space is needed.
 
 This script applies to a system with two NICs on the internal backbone network.
 
@@ -75,8 +95,11 @@ fi
 # Set default values.
 arch="$(dpkg --print-architecture)"
 dns_server="10.0.2.2"
-diskless_workstation="yes"
+diskless_workstation="no"
 thin_type=""
+dlw="no"
+img="yes"
+desktop="xfce"
 
 while [ $# -gt 0 ] ; do
   case "$1" in
@@ -85,6 +108,10 @@ while [ $# -gt 0 ] ; do
     --dns_server) dns_server="$2"  ; shift ;;
     --diskless_workstation) diskless_workstation="$2" ; shift ;;
     --thin_type) thin_type="$2" ; shift ;;
+    --dlw) dlw="$2" ; shift ;;
+    --img) img="$2" ; shift ;;
+    --desktop) desktop="$2" ; shift ;;
+    --version) echo $version; exit 0 ;;
   esac
   shift
 done
@@ -120,36 +147,58 @@ if [ ! -d /etc/ltsp/client ] ; then
 # Documentation=man:ltsp.conf(5)
 
 [server]
-# Provide a full menu name for thin/bare-amd64.img
-IPXE_BARE_AMD64_IMG="Plain X2Go Thin Client (64-Bit)"
-# Provide a full menu name for thin/bare-i386.img
-IPXE_BARE_I386_IMG="Plain X2Go Thin Client (very old machines, 32-Bit)"
-
-# Provide a full menu name for thin/display-amd64.img
-IPXE_DISPLAY_AMD64_IMG="Display Mode X2Go Thin Client (64-Bit)"
-# Provide a full menu name for thin/display-i386.img
-IPXE_DISPLAY_I386_IMG="Display Mode X2Go Thin Client (very old machines, 32-Bit)"
-
-# Provide a full menu name for thin/desktop-amd64.img
-IPXE_DESKTOP_AMD64_IMG="Desktop Mode X2Go Thin Client (64-Bit)"
+# Provide a full menu name for x2go-bare-amd64.img
+IPXE_X2GO_BARE_AMD64_IMG="Plain X2Go Thin Client (64-Bit)"
+# Provide a full menu name for x2go-bare-i386.img
+IPXE_X2GO_BARE_I386_IMG="Plain X2Go Thin Client (32-Bit)"
+
+# Provide a full menu name for x2go-bare-amd64
+IPXE_X2GO_BARE_AMD64="Plain X2Go Thin Client (64-Bit, NFS rootfs)"
+# Provide a full menu name for x2go-bare-i386
+IPXE_X2GO_BARE_I386="Plain X2Go Thin Client (32-Bit, NFS rootfs)"
+
+# Provide a full menu name for x2go-display-amd64.img
+IPXE_X2GO_DISPLAY_AMD64_IMG="Display Mode X2Go Thin Client (64-Bit)"
+# Provide a full menu name for x2go-display-i386.img
+IPXE_X2GO_DISPLAY_I386_IMG="Display Mode X2Go Thin Client (32-Bit)"
+
+# Provide a full menu name for x2go-display-amd64
+IPXE_X2GO_DISPLAY_AMD64="Display Mode X2Go Thin Client (64-Bit, NFS rootfs)"
+# Provide a full menu name for x2go-display-i386
+IPXE_X2GO_DISPLAY_I386="Display Mode X2Go Thin Client (32-Bit, NFS rootfs)"
+
+# Provide a full menu name for x2go-desktop-amd64.img
+IPXE_X2GO_DESKTOP_AMD64_IMG="Desktop Mode X2Go Thin Client (64-Bit)"
 # Provide a full menu name for thin/desktop-i386.img
-IPXE_DESKTOP_I386_IMG="Desktop Mode X2Go Thin Client (very old machines, 32-Bit)"
+IPXE_X2GO_DESKTOP_I386_IMG="Desktop Mode X2Go Thin Client (32-Bit)"
+
+# Provide a full menu name for x2go-desktop-amd64
+IPXE_X2GO_DESKTOP_AMD64="Desktop Mode X2Go Thin Client (64-Bit, NFS rootfs)"
+# Provide a full menu name for thin/desktop-i386
+IPXE_X2GO_DESKTOP_I386="Desktop Mode X2Go Thin Client (32-Bit, NFS rootfs)"
 
 # Provide a full menu name for x86_64.img
-IPXE_X86_64_IMG="Diskless Workstation (64-Bit)"
+IPXE_X86_64_IMG="Diskless Workstation (server's SquashFS image)"
 # Provide a full menu name for x86_32.img
-IPXE_X86_32_IMG="Diskless Workstation (32-Bit)"
+IPXE_X86_32_IMG="Diskless Workstation (32-Bit, server's SquashFS image)"
+
+# Provide a full menu name for dlw.img
+IPXE_DLW_IMG="Diskless Workstation (SquashFS image from chroot)"
+# Provide a full menu name for dlw
+IPXE_DLW="Diskless Workstation (Chroot as NFS rootfs)"
 
 ##### Set default boot value ######
 # Default value is x86_64 or x86_32 (arch specific, Diskless Workstation)
 # Plain X2Go Thin Client (64-Bit)
-#DEFAULT_IMAGE="bare-amd64"
+#DEFAULT_IMAGE="x2go-bare-amd64"
 # Plain X2Go Thin Client (32-Bit)
-#DEFAULT_IMAGE="bare-i386"
+#DEFAULT_IMAGE="x2go-bare-i386"
 # Display Mode X2Go Thin Client (64-Bit)
-#DEFAULT_IMAGE="display-amd64"
+#DEFAULT_IMAGE="x2go-display-amd64"
 # Desktop Mode X2Go Thin Client (64-Bit)
-#DEFAULT_IMAGE="desktop-amd64"
+#DEFAULT_IMAGE="x2go-desktop-amd64"
+# Diskless Workstation (Chroot as NFS rootfs)
+#DEFAULT_IMAGE="dlw"
 # Install Debian Edu/amd64 (64-Bit)
 #DEFAULT_IMAGE="amd64"
 # Install Debian Edu/i386  (32-Bit)
@@ -378,62 +427,67 @@ fi
 
 # Create thin client chroot and generate image.
 export DEBIAN_FRONTEND=noninteractive
-if ! [ "" == "$thin_type" ] && [ ! -d /srv/ltsp/thin/"$thin_type"-"$arch"/etc/ltsp ] ; then
-	mkdir -p /srv/ltsp/thin/"$thin_type"-"$arch"
+if ! [ "" == "$thin_type" ] && [ ! -d /srv/tftp/ltsp/x2go-"$thin_type"-"$arch"/etc/ltsp ] ; then
+	mkdir -p /srv/tftp/ltsp/x2go-"$thin_type"-"$arch"
 	# Install common thin client packages.
-debootstrap --arch="$arch" --no-check-gpg --variant=minbase --include=linux-image-"$kernel_arch" \
-	"$dist" /srv/ltsp/thin/"$thin_type"-"$arch" "$mirror"
-	chroot /srv/ltsp/thin/"$thin_type"-"$arch"/ apt clean
-	mount /dev/pts -t devpts /srv/ltsp/thin/"$thin_type"-"$arch"/dev/pts
-	mount proc -t proc /srv/ltsp/thin/"$thin_type"-"$arch"/proc
-	mount tmpfs -t tmpfs /srv/ltsp/thin/"$thin_type"-"$arch"/tmp
-	mkdir -p /srv/ltsp/thin/"$thin_type"-"$arch"/tmp/user/0
+debootstrap --arch="$arch" --no-check-gpg --variant=minbase --include=sitesummary-client,linux-image-"$kernel_arch" \
+	"$dist" /srv/ltsp/x2go-"$thin_type"-"$arch" "$mirror"
+	# Unset temporary directory variables to avoid problems when directory
+	# is missing inside the chroot. https://bugs.debian.org/765443
+	unset TMPDIR TEMP TEMPDIR TMP
+	chroot /srv/ltsp/x2go-"$thin_type"-"$arch"/ apt clean
+	# Care for complete sources list (security, also nonfree -- in case firmware is needed).
+	chroot /srv/ltsp/x2go-"$thin_type"-"$arch"/ sh -c "cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list.d/full.list"
+	mount /dev/pts -t devpts /srv/ltsp/x2go-"$thin_type"-"$arch"/dev/pts
+	mount proc -t proc /srv/ltsp/x2go-"$thin_type"-"$arch"/proc
 	if [ "true" == "$BD_ISO" ] ; then
-		mkdir -p /srv/ltsp/thin/"$thin_type"-"$arch"/media/cdrom
-		mount $device /srv/ltsp/thin/"$thin_type"-"$arch"/media/cdrom
-		echo "deb [trusted=yes] $mirror $dist main" > /srv/ltsp/thin/"$thin_type"-"$arch"/etc/apt/sources.list
+		mkdir -p /srv/ltsp/x2go-"$thin_type"-"$arch"/media/cdrom
+		mount "$device" /srv/ltsp/x2go-"$thin_type"-"$arch"/media/cdrom
+		echo "deb [trusted=yes] $mirror $dist main" > /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/apt/sources.list
 	fi
-	chroot /srv/ltsp/thin/"$thin_type"-"$arch"/ apt -y -qq install education-thin-client p910nd
+	chroot /srv/ltsp/x2go-"$thin_type"-"$arch"/ apt -y -qq install education-thin-client p910nd
 	# Install case specific additional packages.
 	if [ "display" == "$thin_type" ] ; then
-		chroot /srv/ltsp/thin/"$thin_type"-"$arch"/ apt -y -qq install x2gothinclient-displaymanager
+		chroot /srv/ltsp/x2go-"$thin_type"-"$arch"/ apt -y -qq install x2gothinclient-displaymanager
 	fi
 	if [ "desktop" == "$thin_type" ] ; then
-		chroot /srv/ltsp/thin/"$thin_type"-"$arch"/ apt -y -qq install x2gothinclient-minidesktop \
+		chroot /srv/ltsp/x2go-"$thin_type"-"$arch"/ apt -y -qq install x2gothinclient-minidesktop \
 		x2gothinclient-cdmanager x2gothinclient-usbmount \
 		firefox-esr-l10n-"$LANGCODE"
 	fi
 	if [ "true" == "$BD_ISO" ] ; then
-		umount /srv/ltsp/thin/"$thin_type"-"$arch"/media/cdrom
+		umount /srv/ltsp/x2go-"$thin_type"-"$arch"/media/cdrom
 	fi
-	umount /srv/ltsp/thin/"$thin_type"-"$arch"/dev/pts
-	umount /srv/ltsp/thin/"$thin_type"-"$arch"/proc
-	umount /srv/ltsp/thin/"$thin_type"-"$arch"/tmp
-	rm -rf /srv/ltsp/thin/"$thin_type"-"$arch"/tmp/user
+	umount /srv/ltsp/x2go-"$thin_type"-"$arch"/dev/pts
+	umount /srv/ltsp/x2go-"$thin_type"-"$arch"/proc
 	if [ "bare" == "$thin_type" ] ; then
-		rm -rf /srv/ltsp/thin/"$thin_type"-"$arch"/var/cache/apt
-		rm -rf /srv/ltsp/thin/"$thin_type"-"$arch"/var/cache/debconf
-		rm -rf /srv/ltsp/thin/"$thin_type"-"$arch"/var/cache/man
-		rm -rf /srv/ltsp/thin/"$thin_type"-"$arch"/var/lib/dpkg
+		rm -rf /srv/ltsp/x2go-"$thin_type"-"$arch"/var/cache/debconf
+		rm -rf /srv/ltsp/x2go-"$thin_type"-"$arch"/var/cache/man
 	fi
-	cp /etc/locale.gen /srv/ltsp/thin/"$thin_type"-"$arch"/etc/
-	cp /etc/default/locale /srv/ltsp/thin/"$thin_type"-"$arch"/etc/default
-	chroot /srv/ltsp/thin/"$thin_type"-"$arch" locale-gen
-	cp /etc/default/keyboard /srv/ltsp/thin/"$thin_type"-"$arch"/etc/default
-	cp /etc/default/console-setup /srv/ltsp/thin/"$thin_type"-"$arch"/etc/default
-	chroot /srv/ltsp/thin/"$thin_type"-"$arch" setupcon -k
+	# Configure locale et al.
+	cp /etc/locale.gen /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/
+	cp /etc/default/locale /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/default
+	chroot /srv/ltsp/x2go-"$thin_type"-"$arch" locale-gen
+	cp /etc/default/keyboard /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/default
+	cp /etc/default/console-setup /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/default
+	chroot /srv/ltsp/x2go-"$thin_type"-"$arch" setupcon -k
+	# Configure Sitesummary.
+	cp -r /etc/sitesummary/config.d/ /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/sitesummary/
+	cp -f /etc/sitesummary/site /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/sitesummary/
+	cp -f /etc/sitesummary/sitegroup /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/sitesummary/
+	echo ltsp-client > /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/sitesummary/hostclass
 
 	# Customize X2Go client for Debian Edu use.
 	if [ "display" == "$thin_type" ] || [ "desktop" == "$thin_type" ] ; then
-		cp /etc/ltsp/skel/.x2goclient/sessions /srv/ltsp/thin/"$thin_type"-"$arch"/etc/x2go/x2gothinclient_sessions
+		cp /etc/ltsp/skel/.x2goclient/sessions /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/x2go/x2gothinclient_sessions
 	fi
 	# Firefox-ESR customization for Debian Edu.
 	if [ "desktop" == "$thin_type" ] ; then
-		cp /etc/environment /srv/ltsp/thin/"$thin_type"-"$arch"/etc
-		cp /etc/firefox-esr/debian-edu.js /srv/ltsp/thin/"$thin_type"-"$arch"/etc/firefox-esr
-		cp /etc/firefox-esr/debian-edu-homepage-ldap.js /srv/ltsp/thin/"$thin_type"-"$arch"/etc/firefox-esr
-		cp /etc/ssl/certs/Debian-Edu_rootCA.crt /srv/ltsp/thin/"$thin_type"-"$arch"/etc/ssl/certs
-		cat <<EOF > /srv/ltsp/thin/"$thin_type"-"$arch"/usr/share/firefox-esr/distribution/policies.json
+		cp /etc/environment /srv/ltsp/x2go-"$thin_type"-"$arch"/etc
+		cp /etc/firefox-esr/debian-edu.js /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/firefox-esr
+		cp /etc/firefox-esr/debian-edu-homepage-ldap.js /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/firefox-esr
+		cp /etc/ssl/certs/Debian-Edu_rootCA.crt /srv/ltsp/x2go-"$thin_type"-"$arch"/etc/ssl/certs
+		cat <<EOF > /srv/ltsp/x2go-"$thin_type"-"$arch"/usr/share/firefox-esr/distribution/policies.json
 {
   "policies": {
     "Certificates": {
@@ -461,10 +515,9 @@ debootstrap --arch="$arch" --no-check-gpg --variant=minbase --include=linux-imag
 EOF
 	fi
 
-	ltsp image /srv/ltsp/thin/"$thin_type"-"$arch"
-
-	# Remove chroot now that the image has been built (to save space)
-	rm -rf /srv/ltsp/thin/"$thin_type"-"$arch"
+	if [ "$img" == "yes" ] ; then
+		ltsp image /srv/ltsp/x2go-"$thin_type"-"$arch"
+	fi
 
 	# Create a runtime user for x2go login terminal; configure autofs (USB storage support).
 	if [ "bare" == "$thin_type" ] ; then
@@ -479,9 +532,10 @@ cp /etc/ltsp/autofs/auto.* /etc'
 EOF
 	fi
 
+	ALL_IMAGES=1 ltsp kernel
 	# Create the ltsp.img file and move it to where it belongs.
 	ltsp initrd
-	mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/"$thin_type"-"$arch"/ltsp.img
+	mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/x2go-"$thin_type"-"$arch"/ltsp.img
 
 	# Clean up ltsp.conf from image specific items.
 	sed -i '/POST_INIT/d' /etc/ltsp/ltsp.conf
@@ -497,12 +551,13 @@ if [ "yes" == "$diskless_workstation"  ] ; then
 PRE_INIT_AUTOFS="echo 'LDAPURI=ldap://ldap' >> /etc/default/autofs"
 PRE_INIT_MAIN_SERVER="systemctl enable autofs"
 POST_INIT_USE_FQDN="sed -i '/10.0.2.2/ s/server/tjener.intern tjener/' /etc/hosts"
+POST_INIT_SITESUMMARY="sed -i 's/main-server/ltsp-client/' /etc/sitesummary/hostclass"
 MASK_SYSTEM_SERVICES="apache2 named cups dovecot etckeeper exim4 squid tftpd-hpa \
 icinga2 nmbd slapd smbd systemd-journald xrdp xrdp-sesman krb5-kdc mariadb cfengine3 isc-dhcp-server"
 EOF
 	else
 		cat <<EOF >> /etc/ltsp/ltsp.conf
-MASK_SYSTEM_SERVICES="etckeeper exim4 tftpd-hpa isc-dhcp-server xrdp"
+MASK_SYSTEM_SERVICES="etckeeper exim4 tftpd-hpa isc-dhcp-server xrdp xrdp-sesman"
 EOF
 	fi
 	# Temporary workaround needed in some cases for configuring the resolver inside
@@ -529,9 +584,101 @@ EOF
 	sed -i '/MASK_SYSTEM/d' /etc/ltsp/ltsp.conf
 fi
 
+# Generate chroot and SquashFS image (optional) for diskless workstation..
+if [ "yes" == "$dlw"  ] ; then
+	# The chroot is basically a workstation installation.
+	# Petter Reinholdtsen's debian-edu-bless script is used to achieve it.
+	cat <<EOF >> /etc/ltsp/ltsp.conf
+LIGHTDM_CONF="greeter-hide-users"
+POST_INIT_USE_FQDN="sed -i '/10.0.2.2/ s/server/tjener.intern tjener/' /etc/hosts"
+EOF
+	mkdir -p /srv/ltsp/dlw
+	chmod 755 /srv/ltsp/dlw
+	# Use BD-ISO if available.
+	if ! mountpoint -q /media/cdrom ; then
+		mount /media/cdrom
+	fi
+	if grep -q BD /etc/apt/sources.list && [ -f /media/cdrom/.disk/info ] ; then
+		mkdir -p /srv/ltsp/dlw/media/cdrom
+		mount --bind /media/cdrom /srv/ltsp/dlw/media/cdrom
+		mirror="file:///media/cdrom/"
+	fi
+	# Install base system
+	debootstrap --arch="$arch" --no-check-gpg --variant=minbase --include=locales,console-setup,linux-image-"$arch" "$dist" /srv/ltsp/dlw "$mirror"
+
+	# Care for complete sources list (security, also nonfree -- in case firmware is needed).
+	chroot /srv/ltsp/dlw sh -c "cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list.d/full.list"
+
+	# Care for same locale and keyboard settings in the chroot, also useful to quiet down Perl.
+	cp /etc/locale.gen /srv/ltsp/dlw/etc/
+	cp /etc/default/locale /srv/ltsp/dlw/etc/default
+	chroot /srv/ltsp/dlw locale-gen
+	cp /etc/default/keyboard /srv/ltsp/dlw/etc/default
+	cp /etc/default/console-setup /srv/ltsp/dlw/etc/default
+	chroot /srv/ltsp/dlw setupcon -k
+
+	# Care for special files.
+	# Unset temporary directory variables to avoid problems when directory
+	# is missing inside the chroot. https://bugs.debian.org/765443
+	unset TMPDIR TEMP TEMPDIR TMP
+	mount /dev/pts -t devpts /srv/ltsp/dlw/dev/pts
+	mount proc -t proc /srv/ltsp/dlw/proc
+	if grep -q BD /etc/apt/sources.list && mountpoint -q /media/cdrom ; then
+		echo "deb [trusted=yes] $mirror $dist main" > /srv/ltsp/dlw/etc/apt/sources.list
+	fi
+	mkdir -p /srv/ltsp/dlw/tmp/user/0/
+	cp /usr/share/debian-edu-config/tools/debian-edu-bless /srv/ltsp/dlw/sbin
+
+	# Install the mandatory ltsp package (and apt-utils to don't delay package configuration).
+	chroot /srv/ltsp/dlw apt-get install -y -qq apt-utils ltsp
+
+	# Turn system into a Debian Edu workstation.
+	chroot /srv/ltsp/dlw sh -c "DESKTOP=$desktop /sbin/debian-edu-bless"
+	mkdir -p /srv/ltsp/dlw/skole
+	chmod 755 /srv/ltsp/dlw/skole
+	rm -f /srv/ltsp/dlw/etc/resolv.conf
+	# Next line needed for kerberized NFS home directory access.
+	cp /etc/krb5.keytab /srv/ltsp/dlw/etc/
+	# Care for Debian Edu certificates.
+	cp /etc/ssl/certs/debian-edu-server.crt /srv/ltsp/dlw/etc/ssl/certs/
+	cp /usr/local/share/ca-certificates/*.crt /srv/ltsp/dlw/usr/local/share/ca-certificates/
+	chroot /srv/ltsp/dlw update-ca-certificates
+	# Adjust Sitesummary configuration
+	cp -f /etc/sitesummary/site /srv/ltsp/dlw/etc/sitesummary/
+	cp -f /etc/sitesummary/sitegroup /srv/ltsp/dlw/etc/sitesummary/
+	echo ltsp-client > /srv/ltsp/dlw/etc/sitesummary/hostclass
+
+	# Care for temporary mounts.
+	umount /srv/ltsp/dlw/dev/pts
+	umount /srv/ltsp/dlw/proc
+	if grep -q BD /etc/apt/sources.list && [ -f /media/cdrom/.disk/info ] ; then
+		umount /srv/ltsp/dlw/media/cdrom
+		umount /media/cdrom
+	fi
+
+	# Create optional SqashFS image file.
+	if [ "yes" == "$img"  ] ; then
+		ltsp image dlw
+	fi
+
+	# Next modification avoids ltsp command error if lot of images are available.
+	ALL_IMAGES=1 ltsp kernel
+
+	# Create ltsp initrd (ltsp.img) and move it to the right location.
+	ltsp initrd
+	mv /srv/tftp/ltsp/ltsp.img /srv/tftp/ltsp/dlw/
+
+	# Update iPXE menu and adjust the created file for Debian Edu needs.
+	ltsp ipxe
+	sed -i 's#ltsp/ltsp.img#ltsp/${img}/ltsp.img#' /srv/tftp/ltsp/ltsp.ipxe
+
+	# Clean up ltsp.conf from image specific items.
+	sed -i '/POST_INIT/d' /etc/ltsp/ltsp.conf
+	sed -i '/LIGHTDM_CONF/d' /etc/ltsp/ltsp.conf
+fi
+
 # Get rid of additional excludes just in case they exist (main server).
-rm -rf /etc/ltsp/image-local.excludes
-touch /etc/ltsp/image-local.excludes
+cat /dev/null > /etc/ltsp/image-local.excludes
 
 # Use legacy network interfaces names.
 if ! grep -q net.ifnames /etc/default/grub ; then
@@ -589,7 +736,7 @@ ltsp ipxe
 # Add PXE installation related entries to iPXE menu.
 if ! grep -q main-server /srv/tftp/ltsp/ltsp.ipxe && \
     [ -f /srv/tftp/debian-installer/amd64/linux ] ; then
-	echo "Modifying $tftpdir/ltsp/ltsp.ipxe"
+	echo "Modifying /srv/tftp/ltsp/ltsp.ipxe"
 	sed -i '/^menu.*/ a item\
 item --gap                        Installation:\
 item --key a amd64                Install Debian Edu/amd64 (64-Bit)\


=====================================
sbin/debian-edu-ltsp-ipxe
=====================================
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+# Generate the LTSP specific iPXE menu
+ltsp ipxe 2> /dev/null
+
+# Add PXE installation related entries to iPXE menu.
+if ! grep -q main-server /srv/tftp/ltsp/ltsp.ipxe && \
+    [ -f /srv/tftp/debian-installer/amd64/linux ] ; then
+	echo "Modifying /srv/tftp/ltsp/ltsp.ipxe"
+	sed -i '/^menu.*/ a item\
+item --gap                        Installation:\
+item --key a amd64                Install Debian Edu/amd64 (64-Bit)\
+item --key i i386                 Install Debian Edu/i386  (32-Bit)\
+item\
+' /srv/tftp/ltsp/ltsp.ipxe
+	cat /srv/tftp/debian-edu/install.cfg >>/srv/tftp/ltsp/ltsp.ipxe
+fi
+
+# Make sure /srv/tftp/ltsp/ltsp.ipxe is Debian Edu specific.
+sed -i 's#ltsp/ltsp.img#ltsp/${img}/ltsp.img#' /srv/tftp/ltsp/ltsp.ipxe
+echo ""
+echo "/srv/tftp/ltsp/ltsp.ipxe has been modified."


=====================================
share/debian-edu-config/tools/ltsp-addfirmware
=====================================
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Add non-free firmware to the chroot used by ltsp to enable certain
+# Add non-free firmware to the chroot used by LTSP to enable certain
 # network cards (Intel, Broadcom, ...). Takes package name as param,
 # or add all firmware packages if no package name is given.
 
@@ -12,33 +12,46 @@ then
     cat <<EOF
 
 Usage information:
-Execute: apt-get update && apt-cache search ^firmware-.*
-Decide which package has to be installed for the network card.
-Then call this script with the package name as parameter.  Or do not
-use any parameter and get all firmware packages installed in the LTSP
-chroot. Prepend arch=<non default arch> to the command if server arch and
-LTSP chroot arch differ.
+
+(1) Run apt-get update and apt-cache search ^firmware-.* in the LTSP chroot.
+    Example for the default diskless workstation chroot:
+    debian-edu-ltsp-chroot -b /srv/ltsp/dlw apt update
+    debian-edu-ltsp-chroot -b /srv/ltsp/dlw apt-cache search ^firmware-.*
+(2) Decide which package has to be installed for the network card.
+(3) Call this script with the package name as parameter.
+    If no parameter is used, all firmware packages will be installed in the default
+    LTSP chroot (/srv/ltsp/dlw) - not really recommended because the initrd gets bloated!
+
+Please note:
+Prepend BASE=<non default LTSP chroot> to the command in case such a chroot
+should be modified.
+Example:
+BASE=/srv/ltsp/x2go-display-amd64 /usr/share/debian-edu-config/tools/ltsp-addfirmware firmware-linux
 
 EOF
     exit 0
 fi
+
+BASE=${BASE:-/srv/ltsp/dlw}
+
 if [ "$1" ] ; then
     debnames="$*"
 else
-    # Find files.  This require non-free to be enabled as APT
-    # repository.
-    # Skip installer debs, to avoid the b43 installers that conflict
-    # with each other.  FIXME review if this is needed after squeeze.
-    debnames="$(apt-cache search ^firmware-.* | grep -v installer | cut -d" " -f1)"
+    # Find files. This requires non-free to be enabled as APT repository..
+    # Skip installer debs to avoid the b43 installers that conflict
+    # with each other.
+    # For bookworm, also exclude firmware-microbit-micropython{-dl} and
+    # packages w/ EULA (firmware-{ivtv,ipw2x00}).
+    # FIXME Review if this is still needed after bookworm.
+    debnames="$(debian-edu-ltsp-chroot -b $BASE sh -c 'apt-cache search ^firmware-.* | grep -v installer | grep -v micropython | grep -v ivtv | grep -v ipw2x00 | cut -d" " -f1')"
 fi
 
-# do things in the ltsp chroot for the default arch.
-[ "$arch" ] || arch=$(dpkg --print-architecture)
-TMP= TMPDIR= ltsp-chroot -a $arch apt-get update
-TMP= TMPDIR= ltsp-chroot -d -a $arch apt-get -y -q install $debnames
+# do things in the default LTSP chroot.
+debian-edu-ltsp-chroot -b $BASE apt-get update
+debian-edu-ltsp-chroot -m -b $BASE apt-get -y -q install $debnames
 
 # copy new initrd from chroot to the server tftpboot dir
-ltsp-update-kernels
+ALL_IMAGES=1 ltsp kernel
 
 cat <<EOF
 Done - if no error about an unlocateable package was reported.


=====================================
share/debian-edu-config/tools/run-at-firstboot
=====================================
@@ -64,7 +64,7 @@ fi
 # needs to include the krb5.keytab file which isn't available at this time.
 if echo "$PROFILE" | grep -Eq 'Main-Server.*LTSP-Server' && \
 	[ ! -f /srv/ltsp/images/$ltspimg ] ; then
-	/usr/sbin/debian-edu-ltsp-install --dist $dist
+	/usr/sbin/debian-edu-ltsp-install --diskless_workstation yes
 fi
 
 # Update PXE setup on LTSP servers with proxy values set in environment


=====================================
share/man/man8/debian-edu-ltsp-chroot.8
=====================================
@@ -0,0 +1,36 @@
+.TH DEBIAN-EDU-LTSP-CHROOT "8" "September 2021" "Debian Edu" "Debian Edu Admin Tools"
+.SH NAME
+debian-edu-ltsp-chroot - execute commands in a specified LTSP Chroot
+.SH SYNOPSIS
+.B debian-edu-ltsp-chroot
+[\fI\,OPTION\/\fR] \fI\,command\/\fR
+.SH DESCRIPTION
+Tool to execute commands in a specified LTSP Chroot (like e.g. install, upgrade and remove packages).
+
+.SH OPTIONS
+.TP
+\fB\-b\fR, \fB\-\-base\fR[=\fI\,PATH\/\fR]
+Sets base of target chroot. Defaults to \fI\,/srv/ltsp/dlw\/\fP if unspecified.
+.TP
+\fB\-d\fR, \fB\-\-mount\-dev\fR
+If set, mounts the server dev and devpts directories to the chroot
+previous to chrooting.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Displays the debian\-edu\-ltsp\-chroot help message.
+.TP
+\fB\-p\fR, \fB\-\-mount\-proc\fR
+If set, mounts the server \fI\,/proc\/\fP to the chroot previous to chrooting.
+.TP
+\fB\-m\fR, \fB\-\-mount\-all\fR
+If set, does both \fB\-\-mount\-dev\fR and \fB\-\-mount\-proc\fR previous to chrooting.
+.TP
+\fB\-\-version\fR
+Output version information and exit.
+.SH EXAMPLE
+.TP
+.B debian-edu-ltsp-chroot -m -b /srv/ltsp/dlw apt update
+.TQ
+updates the package cache inside /srv/ltsp/dlw (diskless workstation chroot).
+.SH AUTHORS
+Debian Edu Team, https://blends.debian.org/edu


=====================================
share/man/man8/debian-edu-ltsp-initrd.8
=====================================
@@ -0,0 +1,13 @@
+.TH DEBIAN-EDU-LTSP-INITRD 8 "November 2021" "Debian Edu" "Debian Edu Admin Tools"
+
+.SH NAME
+debian-edu-ltsp-initrd - update the ltsp.img file on a Debian Edu LTSP server for each use case
+
+.SH SYNOPSIS
+.B debian-edu-ltsp-initrd
+
+.SH DESCRIPTION
+This is a wrapper script for the 'ltsp initrd' command. It makes sure that a use case specific initrd (/srv/tftp/ltsp/ltsp.img) is generated and then moved to the use case related directory. The command needs to be run after the /etc/ltsp/ltsp.conf [clients] section has been modified.
+
+.SH AUTHORS
+Debian Edu Team, https://blends.debian.org/edu


=====================================
share/man/man8/debian-edu-ltsp-install.8
=====================================
@@ -4,11 +4,12 @@
 debian-edu-ltsp-install - setup, configure and manage LTSP chroot and SquashFS image
 
 .SH SYNOPSIS
-.B debian-edu-ltsp-install --arch <amd64|i386> --dist <stable|testing|sid> --dns_server <10.0.2.2|dns server ip> --diskless_workstation <yes|no> --thin_type <bare|display|desktop>
+.B debian-edu-ltsp-install
+[\fI\,OPTIONS\/\fR] \fI\
 
 .SH DESCRIPTION
 .TP
-Tool to configure a Debian Edu system with 'LTSP-Server' profile' for both diskless workstations and also thin clients (using X2Go). The configuration applies to a Debian Edu machine in the internal backbone network with two NICs. This system needs to be registered using GOsa² in case it isn't the main server (i.e. a 'combined' server).
+Tool to configure a Debian Edu system with 'LTSP-Server' profile' for both diskless workstations and also thin clients (using X2Go). The configuration applies to a Debian Edu machine on the internal backbone network with two NICs. This system needs to be registered using GOsa² in case it isn't the main server (i.e. a 'combined' server).
 .TQ
 This script applies to a system with two NICs on the internal backbone network.
 
@@ -19,13 +20,22 @@ These are the options that can appear on the command line:
 takes effect for a thin client chroot setup, default value is the system architecture one
 .TP
 \fB\--dist\ <stable|testing|sid>\fR
-takes effect for a thin client chroot setup, default value is the one the LTSP server is running
+takes effect for a LTSP/X2Go client chroot setup, default value is the one the LTSP server is running
 .TP
 \fB\--dns_server\ <10.0.2.2|dns\ server\ ip>\fR
-defaults to 10.0.2.2 if option is omitted
+--dns_server defaults to 10.0.2.2 if omitted
 .TP
 \fB\--diskless_workstation\ <yes|no>\fR
-defaults to yes if option is omitted
+defaults to no if the option is omitted
+.TP
+\fB\--dlw\ <yes|no>\fR
+used to create a diskless workstation LTSP chroot (root fs via NFS), default is no
+.TP
+\fB\--img\ <yes|no>\fR
+takes effect for LTSP diskless workstation and X2Go thin client chroot setup, default is yes
+.TP
+\fB\--desktop\<xfce|cinnamon|gnome|kde|lxde|lxqt|mate|none> \fR
+takes effect for LTSP diskless workstation chroot setup, default is xfce
 .TP
 \fB\--thin_type\ <bare|display|desktop>\fR
 .TP
@@ -39,21 +49,36 @@ defaults to yes if option is omitted
 .TQ
        desktop: x2gothinclient running in minidesktop mode
 
-.SH EXAMPLE
+.SH EXAMPLES
 .TP
-.B debian-edu-ltsp-install --arch amd64
+.B debian-edu-ltsp-install --diskless_workstation yes
 .TQ
-creates 64-bit diskless workstation support.
+creates diskless workstation support (SquashFS image from server file system).
 .TP
-.B debian-edu-ltsp-install --arch amd64 --dist bullseye --thin_type bare
-.TQ 
-creates diskless workstation and 64-bit thin client support, the LTSP client
+.B debian-edu-ltsp-install --arch amd64 --diskless_workstation yes --thin_type bare
 .TQ
-boot defaults to diskless workstation.
+creates diskless workstation and 64-bit thin client support. LTSP client boot defaults to diskless workstation.
 .TP
-.B debian-edu-ltsp-install --arch i386 --diskless_workstation no --thin_type bare
-.TQ 
-creates additional 32-bit thin client support
+.B debian-edu-ltsp-install --arch i386 --thin_type bare
+.TQ
+creates additional 32-bit thin client support.
+.TP
+.B debian-edu-ltsp-install --diskless_workstation yes
+.TQ
+updates the diskless workstation SquashFS image.
+.TP
+.B debian-edu-ltsp-install --dlw yes --img no
+.TQ
+creates a diskless workstation LTSP chroot. About 15 GiB additional disk space is needed.
+.TQ
+In the default case, run the commands
+.B lvresize -L+15G /dev/vg_system/srv+ltsp
+and
+.B resize2fs /dev/vg_system/srv+ltsp
+.TP
+.B debian-edu-ltsp-install --dlw yes
+.TQ
+creates a diskless workstation LTSP chroot and the related SquashFS image. Another 5 GiB more additional disk space is needed.
 
 .SH AUTHORS
 Debian Edu Team, https://blends.debian.org/edu


=====================================
share/man/man8/debian-edu-ltsp-ipxe.8
=====================================
@@ -0,0 +1,13 @@
+.TH DEBIAN-EDU-LTSP-IPXE 8 "November 2021" "Debian Edu" "Debian Edu Admin Tools"
+
+.SH NAME
+debian-edu-ltsp-ipxe - update the iPXE menu file on a Debian Edu LTSP server
+
+.SH SYNOPSIS
+.B debian-edu-ltsp-ipxe
+
+.SH DESCRIPTION
+This is a wrapper script for the 'ltsp ipxe' command. It makes sure that the /srv/tftp/ltsp/ltsp.ipxe file is Debian Edu specific. The command needs to be run after iPXE menu related items (like menu timeout or default boot settings) in the /etc/ltsp/ltsp.conf [server] section have been modified.
+
+.SH AUTHORS
+Debian Edu Team, https://blends.debian.org/edu



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/136a41647cc2f0184399b25ff90c44e5a4cfe52e

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/136a41647cc2f0184399b25ff90c44e5a4cfe52e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20211118/644f672e/attachment-0001.htm>


More information about the debian-edu-commits mailing list