[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] Adjust sbin/debian-edu-ltsp-install

Wolfgang Schweer (@schweer-guest) gitlab at salsa.debian.org
Sun Oct 3 11:19:21 BST 2021



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


Commits:
fd28c253 by Wolfgang Schweer at 2021-10-03T12:18:26+02:00
Adjust sbin/debian-edu-ltsp-install

  Use last edit date to improve version information.
  Minor fixes (typos and copy paste errors).

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

- - - - -


2 changed files:

- debian/changelog
- sbin/debian-edu-ltsp-install


Changes:

=====================================
debian/changelog
=====================================
@@ -28,6 +28,9 @@ debian-edu-config (2.12.5) UNRELEASED; urgency=medium
   * sbin/debian-edu-ltsp-chroot:
     - Use last edit date to improve version information.
     - Minor fixes, thanks shellcheck.
+  * sbin/debian-edu-ltsp-install:
+    - Use last edit date to improve version information.
+    - Minor fixes (typos and copy paste errors).
 
  -- Mike Gabriel <sunweaver at debian.org>  Sun, 03 Oct 2021 10:13:28 +0200
 


=====================================
sbin/debian-edu-ltsp-install
=====================================
@@ -17,7 +17,8 @@
 # Author/Copyright:	Wolfgang Schweer <wschweer at arcor.de>
 # Licence:		GPL2+
 # first edited:	2019-11-21
-#version=2021-09-28
+
+version=2021-10-02
 
 set -e
 
@@ -87,7 +88,7 @@ fi
 
 # Grab dist value for both testing and stable release cases.
 if grep -q / /etc/debian_version ; then
-	dist=$(cat /etc/debian_version | cut -d/ -f1)
+	dist="$(cat /etc/debian_version | cut -d/ -f1)"
 else
 	dist=$(lsb_release -sc)
 fi
@@ -99,7 +100,6 @@ thin_type=""
 dlw="no"
 img="no"
 desktop="xfce"
-#version="$version"
 
 while [ $# -gt 0 ] ; do
   case "$1" in
@@ -111,6 +111,7 @@ while [ $# -gt 0 ] ; do
     --dlw) dlw="$2" ; shift ;;
     --img) img="$2" ; shift ;;
     --desktop) desktop="$2" ; shift ;;
+    --version) echo $version; exit 0 ;;
   esac
   shift
 done
@@ -436,13 +437,13 @@ debootstrap --arch="$arch" --no-check-gpg --variant=minbase --include=linux-imag
 	# 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 for possible needed firmware).
-	chroot /srv/ltsp/x2go-"$thin_type"-"$arch"/ sh -c "cp /usr/share/doc/apt/examples/sources.list > /etc/apt/sources.list.d/full.list"
+	# 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/x2go-"$thin_type"-"$arch"/media/cdrom
-		mount $device /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/x2go-"$thin_type"-"$arch"/ apt -y -qq install education-thin-client p910nd
@@ -510,7 +511,7 @@ debootstrap --arch="$arch" --no-check-gpg --variant=minbase --include=linux-imag
 EOF
 	fi
 
-	if [ "img" == "yes" ] ; then
+	if [ "$img" == "yes" ] ; then
 		ltsp image /srv/ltsp/x2go-"$thin_type"-"$arch"
 	fi
 
@@ -600,8 +601,8 @@ EOF
 	# 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 for possible needed firmware).
-	chroot /srv/ltsp/dlw sh -c "cp /usr/share/doc/apt/examples/sources.list > /etc/apt/sources.list.d/full.list"
+	# 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/
@@ -617,8 +618,8 @@ EOF
 	unset TMPDIR TEMP TEMPDIR TMP
 	mount /dev/pts -t devpts /srv/ltsp/dlw/dev/pts
 	mount proc -t proc /srv/ltsp/dlw/proc
-	if mountpoint -q /media/cdrom ; then
-		echo "deb [trusted=yes] "$mirror" "$dist" main" > /srv/ltsp/dlw/etc/apt/sources.list
+	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
@@ -641,14 +642,11 @@ EOF
 	# Care for temporary mounts.
 	umount /srv/ltsp/dlw/dev/pts
 	umount /srv/ltsp/dlw/proc
-	if [ -f /media/cdrom/.disk/info ] ; then
+	if grep -q BD /etc/apt/sources.list && [ -f /media/cdrom/.disk/info ] ; then
 		umount /srv/ltsp/dlw/media/cdrom
 		umount /media/cdrom
 	fi
 
-	# Care for sources.list in dlw chroot in case of package upgrades.
-	cat /usr/share/doc/apt/examples/sources.list >> /srv/ltsp/dlw/etc/apt/sources.list
-
 	# Create optional SqashFS image file.
 	if [ "yes" == "$img"  ] ; then
 		ltsp image dlw
@@ -729,7 +727,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)\



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

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/fd28c253baa2f258bcc4cfddda96a421bb73573c
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/20211003/7982a7bb/attachment-0001.htm>


More information about the debian-edu-commits mailing list