[debian-edu-commits] [Git][debian-edu/debian-edu-install][bookworm] 9 commits: Start 2.12.10 development.

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Wed Jan 31 15:15:46 GMT 2024



Mike Gabriel pushed to branch bookworm at Debian Edu / debian-edu-install


Commits:
981c71ef by Mike Gabriel at 2023-08-19T16:56:41+02:00
Start 2.12.10 development.

d/changelog entries will be written on release
using the git commit messages.

Use 'gbp dch --since 2.12.9'
to write d/changelog entries since that last release.

Gbp-Dch: ignore
Signed-off-by: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>

- - - - -
473c7c22 by Mike Gabriel at 2023-08-19T16:58:47+02:00
d/changelog: typo fix in previous upload stanza

- - - - -
c80e9b30 by Guido Berhoerster at 2023-09-12T07:47:28+02:00
Add systemd service files equivalent to xdebian-edu-firstboot init script

The init script performs two tasks on the first boot after installation.
Firstly, it starts the run-at-firstboot script from debian-edu-config.
Secondly, it runs tests via the debian-edu-test-install script provided by
debian-edu-config if requested by the user via the testinstall argument on the
kernel command line.  Any errors found will be mailed to the first user and
success or failure will be signaled through a graphical dialog on top of the
display manager.
Factor out the test runner into a separate script debian-edu-testsuite.  This
script is then run by the xdebian-edu-firstboot sysvinit script.  Create two
systemd service files, one which runs the run-at-firstboot script and another
one for running debian-edu-testsuite.
Remove unsupported update-rc.d options.

- - - - -
87ce403f by Guido Berhoerster at 2023-09-25T10:06:05+02:00
Adjust debian-edu-testsuite to new UID/GID of first user

This has been changed to UID/GID 2000.
Also use getent passwd for obtaining the user account information instead of
relying on grep which might match the wrong user.

- - - - -
76b7242f by Wolfgang Schweer at 2023-12-22T13:00:59+01:00
Fix security mirror URL generated by apt-setup generator script (closes #1058788)

Since Debian changed the security mirror URL (as of bullseye), the
related Debian Edu apt-setup generator script (70debian-edu-install)
prevents the Debian installer apt-setup mechanism to write the security
mirror entry *also in case of an existing Internet connection*.

The Debian Edu apt-setup generator script is useful in case of
completely offline installations (using the BD ISO image). The manual
informs about the missing security mirror entry in this case, see:
https://wiki.debian.org/DebianEdu/Documentation/Bullseye/Installation#A_note_on_USB_flash_drive_.2F_Blu-ray_disc_image_installs

Fix this by pointing the generator script to the correct URL.

- - - - -
eb7e012a by Wolfgang Schweer at 2023-12-22T12:02:14+00:00
Remove non-free and contrib repository components (closes #1058789)

Since the Debian bookworm release, d-i apt-setup adds non-free-firmware
as new default mirror component by default. This improves user
experience in case of awkward hardware (esp. network components).

The non-free and contrib repository components are thus no longer needed for
firmware and as a Debian Pure Blend, Debian Edu should no longer enable them.

- - - - -
41d403fe by Holger Levsen at 2023-12-25T11:13:09+01:00
release as 2.12.10

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -
98bea703 by Mike Gabriel at 2024-01-31T16:00:29+01:00
Merge tag '2.12.10' into bookworm

released as 2.12.10

- - - - -
ec033710 by Mike Gabriel at 2024-01-31T16:15:19+01:00
release to bookworm as 2.12.10~deb12u1

- - - - -


9 changed files:

- Makefile
- apt-setup/generators/70debian-edu-install
- + debian-edu-testsuite
- debian/changelog
- + debian/debian-edu-install.debian-edu-testsuite.service
- debian/debian-edu-install.xdebian-edu-firstboot.init
- + debian/debian-edu-install.xdebian-edu-firstboot.service
- debian/rules
- preseed-values/defaults.common


Changes:

=====================================
Makefile
=====================================
@@ -4,10 +4,13 @@
 
 INSTALL     = install
 INSTALL_DATA= install -m 644
+INSTALL_BIN = install -m 755
 
 libdir      = /usr/lib
 templatedir = /usr/share/debconf/templates
 pkglibdir   = $(libdir)/debian-edu-install
+libexecdir  = /usr/lib
+pkglibexecdir = $(libexecdir)/debian-edu-install
 sbindir     = /usr/sbin
 sysconfdir  = /etc
 
@@ -45,6 +48,7 @@ install:
 	    $(INSTALL_DATA) preseed-values/defaults.$$profile $(DESTDIR)$(pkglibdir)/; \
 	done
 	$(INSTALL_DATA) version $(DESTDIR)$(pkglibdir)
+	$(INSTALL_BIN) debian-edu-testsuite $(DESTDIR)$(pkglibexecdir)
 
 debian-edu-profile.templates: debian/debian-edu-profile-udeb.templates
 	(cd debian; po2debconf debian-edu-profile-udeb.templates) > $@


=====================================
apt-setup/generators/70debian-edu-install
=====================================
@@ -28,7 +28,7 @@ DISTRIBUTION="$RET"
 # Prevent installer to contact security host as we don't have network
 # connection.  Setting apt-setup/security_host to an empty value will
 # make apt-setup/generators/90security skip the security mirror
-if ! wget -qO - http://security.debian.org/dists/$DISTRIBUTION/updates/Release ; then
+if ! wget -qO - http://security.debian.org/dists/$DISTRIBUTION-security/Release ; then
 	log "Disabling security mirror, unable to reach it using http/wget"
 	db_fset apt-setup/security_host seen true || true
 	db_set apt-setup/security_host "" || true


=====================================
debian-edu-testsuite
=====================================
@@ -0,0 +1,167 @@
+#!/bin/sh
+#
+# debian-edu-testsuite - Check the Debian Edu installation after first boot
+#
+# Run the self test and report any errors found.
+#
+# Author: Petter Reinholdtsen
+#
+
+info() {
+    logger -t debian-edu-install "info: $@"
+}
+
+error() {
+    logger -t debian-edu-install "error: $@"
+}
+
+at_exit() {
+    error "script $0 terminated unexpectedly."
+}
+disable_exception() { trap - INT TERM EXIT; }
+trap at_exit INT TERM EXIT
+
+run_testsuite() {
+    logfile=/var/log/installer/debian-edu-install-testsuite
+
+    temp_dir=$(mktemp -d)
+    errfile=$temp_dir/errors
+
+    nice debian-edu-test-install > $logfile 2>&1
+
+    # find error and partition resize messages in the d-i log and the
+    # self test
+    if [ -f /var/log/installer/syslog  ] ; then
+        # remove syslog prefix
+        # Ignore normal errors from wget commands used to test if
+        # mirrors are available [pere 2010-07-22].
+        # Ignore also samba-ad-dc error (unused atm) [schweer 2018-11-05].
+        grep -E 'error:|fsautoresize' /var/log/installer/syslog | \
+	    grep -v 'wget: server returned error: HTTP/1.0 404 Not Found' | \
+	    grep -v 'wget: server returned error: HTTP/1.1 404 Not Found' | \
+	    grep -v 'samba-ad' | \
+	sed 's/.*error: /error: /g' > $errfile
+    fi
+    # The a param is now needed to find all errors [schweer 2018-11-05].
+    grep -a error: $logfile >> $errfile || true
+
+    if [ -s $errfile ] ; then
+    content=$(cat $errfile)
+    # Send error report via mail to first user (who has uid 2000 by default).
+    firstuser=$(getent passwd 2000 | cut -d':' -f1)
+    username=$(getent passwd 2000 | cut -d':' -f5)
+
+            cat << EOF | /usr/lib/sendmail $firstuser
+Subject: Test status
+
+Hello $username,
+
+these are the test results you requested by adding 'testinstall' as
+additional kernel commandline parameter. They have been collected by running
+the testsuite and searching in the /var/log/installer directory.
+
+$content
+
+(Sent from the Debian Edu first boot script.)
+
+EOF
+
+        $0 report-errors $errfile || true
+    else
+        $0 report-success || true
+    fi
+    rm $errfile
+    rmdir $temp_dir
+}
+
+prepare_debconf() {
+    # Try to get debconf to pop up the dialog on top of the display
+    # manager.  Need to do this before starting debconf.
+    if [ ! "$DEBIAN_HAS_FRONTEND" ] ; then
+        # This is generated by sddm
+	candidate="$(ls -tr /var/run/sddm/* 2>/dev/null|tail -1)"
+        # lightdm
+	candidate="$candidate /var/lib/lightdm/.Xauthority"
+
+	XAUTHORITY=
+	for f in $candidate ; do
+	    if XAUTHORITY=$f DISPLAY=:0 xauth list >/dev/null 2>&1 &&
+		XAUTHORITY=$f DISPLAY=:0 xhost > /dev/null 2>&1 ; then
+		XAUTHORITY=$f
+		break
+	    fi
+	done
+
+	if [ "$XAUTHORITY" ] ; then
+            info "found X authority file $XAUTHORITY, trying to start debconf with X frontend."
+            # Try to use gnome frontend (requires libgtk3-perl) or kde frontend
+            # (requires debconf-kde-helper). debconf will fall back to dialog if
+            # either frontend fails to start. The frontend needs to be set
+            # before confmodule is sourced to have effect.
+            DISPLAY=:0
+            # TODO: find graphical variant that works with dialog frontend?
+            if perl -MGtk3 -e 'exit 0' ; then
+               # use gnome frontend
+		export DEBIAN_FRONTEND=gnome
+            elif [ -x /usr/bin/debconf-kde-helper ] ; then
+               # use kde frontend
+		export DEBIAN_FRONTEND=kde
+            else
+		info "unable to find usable debconf X frontend"
+            fi
+            export XAUTHORITY DISPLAY
+	else
+            info "no X detected, not showing test status, send email"
+            return 1
+	fi
+    fi
+    . /usr/share/debconf/confmodule
+}
+
+report_errors() {
+    errfile="$2"
+
+    prepare_debconf $@ || return
+
+    # Quick fix to make sure all error entries at least are
+    # displayed.  The correct fix is to find out how to replace a
+    # debconf variable with multiline content.  not sure why I
+    # need to change this in to one long line
+    errors=`cat $errfile | sed 's/$/, /g' | tr -d "\n" | sed 's/, $//'`
+
+    # Take a look at how CURRENT_CONFIG is built up in
+    # partman/partman-lvm/choose_partition/lvm/do_option
+
+    db_subst debian-edu-install/errors-found ERRORS "$errors"
+
+    db_fset debian-edu-install/errors-found seen false
+    db_input critical debian-edu-install/errors-found || [ $? -eq 30 ]
+    db_go
+}
+
+report_success() {
+    prepare_debconf $@ || return
+
+    db_input critical debian-edu-install/no-errors-found || [ $? -eq 30 ]
+    db_go
+}
+
+case "$1" in
+    run)
+        run_testsuite
+        ;;
+    report-errors)
+        # Need to pass all arguments, to get debconf re-exec to work
+        report_errors $@
+        ;;
+    report-success)
+        # Need to pass all arguments, to get debconf re-exec to work
+        report_success $@
+	;;
+    *)
+        echo "Usage: $0 {run|report-errors|report-success}"
+        disable_exception
+        exit 1
+        ;;
+esac
+disable_exception


=====================================
debian/changelog
=====================================
@@ -1,3 +1,25 @@
+debian-edu-install (2.12.10~deb12u1) bookworm; urgency=medium
+
+  * Release to bookworm.
+
+ -- Mike Gabriel <sunweaver at debian.org>  Wed, 31 Jan 2024 16:00:42 +0100
+
+debian-edu-install (2.12.10) unstable; urgency=medium
+
+  [ Wolfgang Schweer ]
+  * Fix security mirror URL generated by apt-setup generator script.
+    Closes: #1058788.
+  * Remove non-free and contrib repository components. Closes: #1058789.
+
+  [ Guido Berhoerster ]
+  * Add systemd service files equivalent to xdebian-edu-firstboot init script.
+  * Adjust debian-edu-testsuite to new UID/GID of first user.
+
+  [ Mike Gabriel ]
+  * d/changelog: typo fix in previous upload stanza.
+
+ -- Holger Levsen <holger at debian.org>  Mon, 25 Dec 2023 11:07:01 +0100
+
 debian-edu-install (2.12.9~deb12u1) bookworm; urgency=medium
 
   * Release to bookworm.
@@ -26,7 +48,7 @@ debian-edu-install (2.12.9) unstable; urgency=medium
     - Add shebang (#!/bin/sh) to silence lintian with 'W: debian-edu-profile-
       udeb udeb: executable-not-elf-or-script [lib/debian-edu-common]'.
   * debian/debian-edu-profile-udeb.postinst:
-    + Drop #DEBHELPER# macro. The have no effect in udeb:pkgs. Thanks, lintian.
+    + Drop #DEBHELPER# macro. They have no effect in udeb:pkgs. Thanks, lintian.
 
  -- Mike Gabriel <sunweaver at debian.org>  Sat, 19 Aug 2023 16:32:09 +0200
 


=====================================
debian/debian-edu-install.debian-edu-testsuite.service
=====================================
@@ -0,0 +1,18 @@
+[Unit]
+Description=Check the Debian Edu installation after first boot
+After=xdebian-edu-firstboot.service graphical.target
+Requisite=xdebian-edu-firstboot.service
+ConditionPathExists=!/etc/debian-edu/debian-edu-testsuite
+
+[Service]
+EnvironmentFile=-/etc/debian-edu/config
+Type=oneshot
+ExecCondition=test ${TESTINSTALL} = true
+ExecStart=/usr/lib/debian-edu-install/debian-edu-testsuite run
+ExecStartPost=touch /etc/debian-edu/debian-edu-testsuite
+# Do not try to run after first boot even if condition failed
+ExecStopPost=touch /etc/debian-edu/debian-edu-testsuite
+RemainAfterExit=true
+
+[Install]
+WantedBy=multi-user.target


=====================================
debian/debian-edu-install.xdebian-edu-firstboot.init
=====================================
@@ -25,81 +25,6 @@ firstboot_file=/etc/debian-edu/xdebian-edu-firstboot
 
 set -e
 
-info() {
-    logger -t debian-edu-install "info: $@"
-}
-
-error() {
-    logger -t debian-edu-install "error: $@"
-}
-
-at_exit() {
-    error "script $0 terminated unexpectedly."
-}
-disable_exception() { trap - INT TERM EXIT; }
-trap at_exit INT TERM EXIT
-
-run_testsuite() {
-    log_begin_msg "Collecting testsuite results"
-    logfile=/var/log/installer/debian-edu-install-testsuite
-
-    temp_dir=$(mktemp -d)
-    errfile=$temp_dir/errors
-
-    nice debian-edu-test-install > $logfile 2>&1
-
-    # find error and partition resize messages in the d-i log and the
-    # self test
-    if [ -f /var/log/installer/syslog  ] ; then
-        # remove syslog prefix
-        # Ignore normal errors from wget commands used to test if
-        # mirrors are available [pere 2010-07-22].
-        # Ignore also samba-ad-dc error (unused atm) [schweer 2018-11-05].
-        egrep 'error:|fsautoresize' /var/log/installer/syslog | \
-	    grep -v 'wget: server returned error: HTTP/1.0 404 Not Found' | \
-	    grep -v 'wget: server returned error: HTTP/1.1 404 Not Found' | \
-	    grep -v 'samba-ad' | \
-	sed 's/.*error: /error: /g' > $errfile
-    fi
-    # The a param is now needed to find all errors [schweer 2018-11-05].
-    grep -a error: $logfile >> $errfile || true
-
-    if [ -s $errfile ] ; then
-    content=$(cat $errfile)
-    # Send error report via mail to first user (who has uid 1000 by default).
-    firstuser=$(getent passwd | grep 1000 | cut -d':' -f1)
-    username=$(getent passwd | grep 1000 | cut -d':' -f5)
-
-            cat << EOF | /usr/lib/sendmail $firstuser
-Subject: Test status
-
-Hello $username,
-
-these are the test results you requested by adding 'testinstall' as
-additional kernel commandline parameter. They have been collected by running
-the testsuite and searching in the /var/log/installer directory.
-
-$content
-
-(Sent from the Debian Edu first boot script.)
-
-EOF
-
-        log_end_msg 1 || true
-        log_begin_msg "Reporting errors found"
-        if $0 report-errors $errfile ; then
-            log_end_msg 0 || true
-        else
-            log_end_msg 1 || true
-        fi
-    else
-        log_end_msg 0 || true
-        $0 report-success || true
-    fi
-    rm $errfile
-    rmdir $temp_dir
-}
-
 do_start() {
     logger -t debian-edu-install "Executing xdebian-edu-firstboot"
 
@@ -118,89 +43,15 @@ do_start() {
     # command line param 'testinstall'.
     if [ -f /etc/debian-edu/config ] ; then . /etc/debian-edu/config ; fi
     if [ true = "$TESTINSTALL" ]; then
-	run_testsuite
+	log_begin_msg "Collecting testsuite results"
+	/usr/share/debian-edu-install/debian-edu-testsuite
+	log_end_msg $? || true
     else
 	log_begin_msg "Not collecting testsuite results"
 	log_end_msg 0 || true
     fi
 }
 
-prepare_debconf() {
-    # Try to get debconf to pop up the dialog on top of the display
-    # manager.  Need to do this before starting debconf.
-    if [ ! "$DEBIAN_HAS_FRONTEND" ] ; then
-        # This is generated by sddm
-	candidate="$(ls -tr /var/run/sddm/* 2>/dev/null|tail -1)"
-        # lightdm
-	candidate="$candidate /var/lib/lightdm/.Xauthority"
-
-	XAUTHORITY=
-	for f in $candidate ; do
-	    if XAUTHORITY=$f DISPLAY=:0 xauth list >/dev/null 2>&1 &&
-		XAUTHORITY=$f DISPLAY=:0 xhost > /dev/null 2>&1 ; then
-		XAUTHORITY=$f
-		break
-	    fi
-	done
-
-	if [ "$XAUTHORITY" ] ; then
-            info "found X authority file $XAUTHORITY, trying to start debconf with X frontend."
-            # Try to use gnome frontend (requires libgtk3-perl) or kde frontend
-            # (requires debconf-kde-helper). debconf will fall back to dialog if
-            # either frontend fails to start. The frontend needs to be set
-            # before confmodule is sourced to have effect.
-            DISPLAY=:0
-            # TODO: find graphical variant that works with dialog frontend?
-            if perl -MGtk3 -e 'exit 0' ; then
-               # use gnome frontend
-		export DEBIAN_FRONTEND=gnome
-            elif [ -x /usr/bin/debconf-kde-helper ] ; then
-               # use kde frontend
-		export DEBIAN_FRONTEND=kde
-            else
-		info "unable to find usable debconf X frontend"
-            fi
-            export XAUTHORITY DISPLAY
-	else
-            info "no X detected, not showing test status, send email"
-            return 1
-	fi
-    fi
-    . /usr/share/debconf/confmodule
-}
-
-report_errors() {
-    errfile="$2"
-
-    prepare_debconf $@ || return
-
-    # Quick fix to make sure all error entries at least are
-    # displayed.  The correct fix is to find out how to replace a
-    # debconf variable with multiline content.  not sure why I
-    # need to change this in to one long line
-    errors=`cat $errfile | sed 's/$/, /g' | tr -d "\n" | sed 's/, $//'`
-
-    # Take a look at how CURRENT_CONFIG is built up in
-    # partman/partman-lvm/choose_partition/lvm/do_option
-
-    db_subst debian-edu-install/errors-found ERRORS "$errors"
-
-    db_fset debian-edu-install/errors-found seen false
-    db_input critical debian-edu-install/errors-found || [ $? -eq 30 ]
-    db_go
-}
-
-report_success() {
-    prepare_debconf $@ || return
-
-    log_begin_msg "Reporting successful installation"
-
-    db_input critical debian-edu-install/no-errors-found || [ $? -eq 30 ]
-    db_go
-
-    log_end_msg 0 || true
-}
-
 case "$1" in
     start)
         if [ ! -f "$firstboot_file" ]; then
@@ -209,14 +60,6 @@ case "$1" in
         ;;
     stop|force-reload|restart)
         ;;
-    report-errors)
-        # Need to pass all arguments, to get debconf re-exec to work
-        report_errors $@
-        ;;
-    report-success)
-        # Need to pass all arguments, to get debconf re-exec to work
-        report_success $@
-	;;
     *)
         echo "Usage: /etc/init.d/xdebian-edu-firstboot {start|stop|restart|force-reload}"
         disable_exception
@@ -224,5 +67,4 @@ case "$1" in
         ;;
 esac
 
-disable_exception
 exit 0


=====================================
debian/debian-edu-install.xdebian-edu-firstboot.service
=====================================
@@ -0,0 +1,14 @@
+[Unit]
+Description=Run various tasks on the first boot after installation
+After=remote-fs.target network-online.target
+Wants=remote-fs.target
+ConditionPathExists=!/etc/debian-edu/xdebian-edu-firstboot
+
+[Service]
+Type=oneshot
+ExecStart=/usr/share/debian-edu-config/tools/run-at-firstboot
+ExecStartPost=touch /etc/debian-edu/xdebian-edu-firstboot
+RemainAfterExit=true
+
+[Install]
+WantedBy=multi-user.target


=====================================
debian/rules
=====================================
@@ -34,5 +34,8 @@ override_dh_auto_install:
 	cp debian-edu-profile $(CURDIR)/debian/debian-edu-profile-udeb/usr/bin
 
 override_dh_installinit:
-	# Use prefix 99x* to make sure it is the very last script in the boot sequence.
-	dh_installinit -pdebian-edu-install --name=xdebian-edu-firstboot --no-start -u"start 99 2 3 4 5 ."
+	dh_installinit -pdebian-edu-install --name=xdebian-edu-firstboot --no-start
+
+override_dh_installsystemd:
+	dh_installsystemd -pdebian-edu-install --no-start --name=xdebian-edu-firstboot
+	dh_installsystemd -pdebian-edu-install --no-start --name=debian-edu-testsuite


=====================================
preseed-values/defaults.common
=====================================
@@ -41,5 +41,3 @@ hddtemp hddtemp/daemon boolean false
 # remove the need to set up APT sources using cfengine.
 choose-mirror-bin mirror/http/hostname string deb.debian.org
 choose-mirror-bin mirror/http/directory string /debian/
-apt-mirror-setup apt-setup/non-free boolean true
-apt-mirror-setup apt-setup/contrib boolean true



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-install/-/compare/3031f1b2cdcc8580e5b9c71a51f7ac22a4a86f3f...ec033710ef18367e0c7508ebde26aae693882874

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-install/-/compare/3031f1b2cdcc8580e5b9c71a51f7ac22a4a86f3f...ec033710ef18367e0c7508ebde26aae693882874
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/20240131/71c9b982/attachment-0001.htm>


More information about the debian-edu-commits mailing list