[debian-edu-commits] [Git][debian-edu/debian-edu-install][master] 6 commits: Cleanup apt-setup/generators/70debian-edu-install.

WolfgangSchweer gitlab at salsa.debian.org
Tue Nov 13 13:08:31 GMT 2018


WolfgangSchweer pushed to branch master at Debian Edu / debian-edu-install


Commits:
e907c864 by Wolfgang Schweer at 2018-11-12T22:16:38Z
Cleanup apt-setup/generators/70debian-edu-install.

Remove volatile related code, obsolete since years.

Remove leftover cruft from test distribution days.

- - - - -
bc07b029 by Wolfgang Schweer at 2018-11-12T22:20:08Z
Cleanup apt-setup/generators/70debian-edu-install from leftover cruft.

- - - - -
8cc6b470 by Wolfgang Schweer at 2018-11-12T22:22:20Z
Cleanup / adjust debian-edu-profile

Remove leftover cruft from test distribution days.
Adjust distribution check accordingly.

- - - - -
a927ec59 by Wolfgang Schweer at 2018-11-12T22:37:57Z
Rework debian/debian-edu-install.xdebian-edu-firstboot.init

  Add code to send the testsuite error output also via email to the first user;
  it's already the only way if gdm3 is used (wayland is default) and provides a
  better readable output. The test result report can be triggered by adding the
  additional 'testinstall' paramameter to the kernel commandline.

  Cleanup from usplash related code, usplash is gone since years.
  Adjust testsuite error check code.
  Replace kdm check with one for sddm, adjust code accordingly.
  Drop gdm check, gdm is gone  since years.

- - - - -
3dad393e by Wolfgang Schweer at 2018-11-13T12:16:19Z
Adjust debian/debian-edu-install.xdebian-edu-firstboot.init

Drop no longer useful gdm3 related X check.
Improve comments and formatting.

- - - - -
dc298185 by Wolfgang Schweer at 2018-11-13T12:32:50Z
Add changelog entries for last commits.

- - - - -


5 changed files:

- apt-setup/generators/70debian-edu-install
- debian-edu-profile
- debian/changelog
- debian/debian-edu-install.xdebian-edu-firstboot.init
- tools/edu-is-testinstall


Changes:

=====================================
apt-setup/generators/70debian-edu-install
=====================================
@@ -36,15 +36,6 @@ else
 	log "Not touching security mirror settings, able to reach it using http/wget"
 fi
 
-# Prevent installer from contacting volatile too if it isn't working.
-if ! wget -qO - http://volatile.debian.org/debian-volatile/dists/$DISTRIBUTION/volatile/Release ; then
-	log "Disabling volatile mirror, unable to reach it using http/wget"
-	db_fset apt-setup/volatile_host seen true || true
-	db_set apt-setup/volatile_host "" || true
-else
-	log "Not touching volatile mirror settings, able to reach it using http/wget"
-fi
-
 # Fetch the mirror
 db_get mirror/http/hostname || true
 MIRROR=$RET
@@ -71,12 +62,6 @@ done
 db_get mirror/codename || true
 codename="$RET"
 
-if edu-is-testinstall ; then
-    educodename="$DISTRIBUTION-test"
-else
-    educodename="$DISTRIBUTION"
-fi
-
 edu-etcvcs commit
 
 # We need to check for a local repository if we are using http as source


=====================================
debian-edu-profile
=====================================
@@ -455,20 +455,14 @@ set_mirror_info () {
 load_proxy_conf
 set_mirror_info
 
-if edu-is-testinstall ; then
-   de_suite="$DISTRIBUTION-test"
-else
-   de_suite="$DISTRIBUTION"
-fi
-
 archstr=$(/bin/archdetect)
 if [ -f /cdrom/.disk/cd_type ] && egrep -iq 'dvd|bluray' /cdrom/.disk/cd_type; then
     #disable mirror usage if we install from dvd or the usb sticks
     db_set "apt-setup/use_mirror" false
     db_fset "apt-setup/use_mirror" seen true || true
     log "disabling mirror selection on dvd's"
-elif ! log-output wget -U "Wget, Debian Edu d-i $de_suite $archstr" -qO - http://deb.debian.org/debian/README && \
-    ! log-output wget --no-proxy -U "Wget, Debian Edu d-i $de_suite $archstr" -qO - http://deb.debian.org/debian/README ; then
+elif ! log-output wget -U "Wget, Debian Edu d-i $DISTRIBUTION $archstr" -qO - http://deb.debian.org/debian/README && \
+    ! log-output wget --no-proxy -U "Wget, Debian Edu d-i $DISTRIBUTION $archstr" -qO - http://deb.debian.org/debian/README ; then
     db_settitle debian-edu-install/no-network/title
     db_input critical "debian-edu-install/no-network" || true
     db_go || true


=====================================
debian/changelog
=====================================
@@ -1,3 +1,24 @@
+debian-edu-install (2.10.16) UNRELEASED; urgency=medium
+
+  * Rework debian/debian-edu-install.xdebian-edu-firstboot.init
+    - Add code to send the testsuite error output also via email to the first
+      user; it's already the only way if gdm3 is used (wayland is default) and
+      provides a better readable output. The test result report can be triggered
+      by adding the additional testinstall parameter to the kernel commandline.
+    - Adjust testsuite error check code.
+    - Replace kdm X check with one for sddm, adjust code accordingly.
+    - Drop no longer useful gdm and gdm3 related X checks.
+    - Cleanup from usplash related code, usplash is gone since years.
+  * Cleanup and adjust debian-edu-profile:
+    - Remove leftover cruft from test distribution days.
+    - Adjust distribution check accordingly.
+  * Cleanup apt-setup/generators/70debian-edu-install:
+    - Remove volatile related code, obsolete since years.
+    - Remove leftover cruft from test distribution days.
+  * Cleanup tools/edu-is-testinstall from leftover cruft.
+
+ -- Wolfgang Schweer <wschweer at arcor.de>  Mon, 12 Nov 2018 18:32:30 +0100
+
 debian-edu-install (2.10.15) unstable; urgency=medium
 
   [ Wolfgang Schweer ]


=====================================
debian/debian-edu-install.xdebian-edu-firstboot.init
=====================================
@@ -52,16 +52,39 @@ run_testsuite() {
     # self test
     if [ -f /var/log/installer/syslog  ] ; then
         # remove syslog prefix
-        # Ignore normal errors from wget commands used to test it
+        # 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
-    grep error: $logfile >> $errfile || true
+    # 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
@@ -91,8 +114,8 @@ do_start() {
     # Create firstboot file to prevent it from being run again
     touch "$firstboot_file"
 
-    # only run the testsuite and report errors during development, not
-    # during production
+    # only run the testsuite and report errors if requested via kernel
+    # command line param 'testinstall'.
     if [ -f /etc/debian-edu/config ] ; then . /etc/debian-edu/config ; fi
     if [ true = "$TESTINSTALL" ]; then
 	run_testsuite
@@ -106,16 +129,10 @@ 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 kdm
-	candidate="`ls -tr /var/run/xauth/* 2>/dev/null|tail -1`"
-
-        # gdm, lightdm
-	candidate="$candidate /var/lib/gdm/:0.Xauth /var/lib/lightdm/.Xauthority"
-
-        # gdm3
-	for f in /var/run/gdm3/auth-for-Debian-gdm*/database ; do
-	    candidate="$candidate $f"
-	done
+        # 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
@@ -128,47 +145,28 @@ prepare_debconf() {
 
 	if [ "$XAUTHORITY" ] ; then
             info "found X authority file $XAUTHORITY, trying to start debconf with X frontend."
-            # Try to use kde frontend (require libqt-perl) or gnome frontend
-            # (libgtk3-perl).  debconf will fall back to dialog if either
-            # frontend fails to start.  The frontend need to be set before
-            # confmodule is sourced to have effect.
+            # 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 perl -MQtCore4 -e 'exit 0' ; then
+            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
-	elif [ -d /run/systemd/system ] ; then
-            # FIXME Figure out what to do under systemd, where no tty
-            # is available!  For now, just give up. :(
-            info "systemd and no X detected, not showing test status"
+	else
+            info "no X detected, not showing test status, send email"
             return 1
 	fi
     fi
     . /usr/share/debconf/confmodule
-
-    # Disable usplash if enabled and not using the X display, to get
-    # the debconf dialog to show up.  Need to do this after the
-    # $DISPLAY variable is set up, to detect if the X connection is
-    # working.
-    if [ -z "$DISPLAY" ] && type usplash_write >/dev/null 2>&1; then
-        clear >/dev/tty8
-        /sbin/usplash_write QUIT
-        chvt 8
-    fi
-}
-
-cleanup_debconf() {
-    # Move back to tty1, to get the login prompt
-    if [ -z "$DISPLAY" ] && type usplash_write >/dev/null 2>&1; then
-        chvt 1
-    fi
 }
 
 report_errors() {
@@ -190,8 +188,6 @@ report_errors() {
     db_fset debian-edu-install/errors-found seen false
     db_input critical debian-edu-install/errors-found || [ $? -eq 30 ]
     db_go
-
-    cleanup_debconf
 }
 
 report_success() {
@@ -203,8 +199,6 @@ report_success() {
     db_go
 
     log_end_msg 0 || true
-
-    cleanup_debconf
 }
 
 case "$1" in


=====================================
tools/edu-is-testinstall
=====================================
@@ -9,14 +9,8 @@ CDDISTRIBUTION="$RET"
 db_get mirror/distribution || true
 DISTRIBUTION="$RET"
 
-# Detect test installs over PXE
-db_get preseed/early_command || true
-EARLYCMD="$RET"
-
 if [ -f /tmp/debian-edu-profile-udeb-testinstall ] || \
-   grep -iq "/$CDDISTRIBUTION-test" /cdrom/.disk/mkisofs 2>/dev/null || \
-   grep -q testinstall /proc/cmdline || \
-   echo "$EARLYCMD" | grep -iq "/$DISTRIBUTION-test/" ; then
+   grep -q testinstall /proc/cmdline ; then
     logger -t edu-is-testinstall "detected test install"
     touch /tmp/debian-edu-profile-udeb-testinstall
     exit 0



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-install/compare/1a7e9838c300728c0882f5dfd2baf6a1b302434b...dc29818504ea63d921027e41bd18422835f1ec09

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-install/compare/1a7e9838c300728c0882f5dfd2baf6a1b302434b...dc29818504ea63d921027e41bd18422835f1ec09
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/20181113/9114457c/attachment-0001.html>


More information about the debian-edu-commits mailing list