[debian-edu-commits] [Git][debian-edu/debian-edu-install][rclobus/etckeeperinit] 4 commits: Fixed network card counting

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Fri Sep 25 08:07:36 BST 2026



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


Commits:
45968c3e by Roland Clobus at 2026-09-18T19:21:02+02:00
Fixed network card counting

Network cards are not always ethN any more

- - - - -
d6e4aa3f by Roland Clobus at 2026-09-18T19:26:31+02:00
Profile: do not always select LTSP-Server (Closes: 1148259)

The LTSP-Server will only be enabled if at least 2 non-wireless network
cards are detected

- - - - -
d1532f5e by Roland Clobus at 2026-09-25T07:07:31+00:00
Whitespace: normalisation

- - - - -
1d2f3990 by Roland Clobus at 2026-09-25T07:07:31+00:00
etckeeper: nicer log messages

* Avoid `/.gitconfig`. (Closes: #1117842)
* Warn about misuse of direct `git commit` commands

- - - - -


2 changed files:

- debian-edu-profile
- tools/edu-etcvcs


Changes:

=====================================
debian-edu-profile
=====================================
@@ -117,7 +117,7 @@ check_profiles() {
 # Return the number of non-wireless network interfaces
 non_wifi_iface_count() {
     count=0
-    for iface in $(ip -o link | grep '^.: eth'|cut -d: -f2) ; do
+    for iface in $(ip -o link | cut -d: -f2 | grep -v '^ lo$'); do
 	if [ -d /sys/class/net/$iface/wireless ] ; then
 	    :
 	else
@@ -166,12 +166,11 @@ else
 	defaultprofile="Standalone"
 	laptop=true
     else
-	defaultprofile="Main-Server, LTSP-Server, Workstation"
-	mainserver=true
+	defaultprofile="Main-Server, Workstation"
     fi
 fi
 
-if [ true != "$mainserver" ] && [ true != "$laptop" ] \
+if [ true != "$laptop" ] \
     && [ 1 -lt $(non_wifi_iface_count) ] ; then
     log "several network cards detected, preselecting ltsp-server"
     defaultprofile="$defaultprofile, LTSP-Server"


=====================================
tools/edu-etcvcs
=====================================
@@ -17,23 +17,39 @@ error() {
 commit() {
     info "Running etckeeper commit"
     if [ -x /target/usr/bin/etckeeper ] ; then
-	in-target /usr/bin/etckeeper \
-	    commit "Automatic commit during installation" || true
+        in-target /usr/bin/etckeeper \
+            commit "Automatic commit during installation" || true
     fi
 }
 
 init() {
     if [ -x /target/usr/bin/etckeeper ] && [ -d /target/etc/.git ]; then
-	return
+        # Already installed and initialised
+        return
     fi
+    if [ ! -x /target/usr/bin/git ]; then
+        apt-install git || true
+    fi
+    # Configure git to prevent messages about the default branch
+    OLD_DEFAULTBRANCH=$(in-target --pass-stdout git config get --global init.defaultBranch || true)
+    in-target git config set --global init.defaultBranch main
+    # The postinst of etckeeper initialises /etc/.git
     apt-install etckeeper || true
+    # Restore the original git configuration
+    if [ -z ${OLDDEFAULTBRANCH} ]; then
+        in-target git config unset --global init.defaultBranch
+    else
+        in-target git config set --global init.defaultBranch "${OLD_DEFAULTBRANCH}"
+    fi
+    # If this was a fresh installation, $HOME was not set and the configuration file is empty
+    if [ ! -s /target/.gitconfig ]; then
+        rm -f /target/.gitconfig
+    fi
     if [ -x /target/usr/bin/etckeeper ] ; then
-        if in-target /usr/bin/etckeeper init ; then
-            in-target /usr/bin/etckeeper vcs config --global user.name "Local Administrator"
-	    in-target /usr/bin/etckeeper vcs config --global user.email "root at localhost"
-	else
-	    info "Running etckeeper init failed"
-	fi
+        echo -e "#!/bin/sh\ncd /etc\ngit config user.name \"STOP! Use 'etckeeper commit' instead\"" > /target/set_git_username.sh
+        chmod a+x /target/set_git_username.sh
+        in-target /set_git_username.sh
+        rm -f /target/set_git_username.sh
     else
         error "Unable to install and enable etckeeper"
     fi
@@ -41,9 +57,9 @@ init() {
 
 case "$1" in
     init)
-	init
-	;;
+        init
+        ;;
     commit)
-	commit
-	;;
+        commit
+        ;;
 esac



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-install/-/compare/99f4d4b4910b2df4e457634dfd60cf0b8d574ce2...1d2f399011113f3b5e850210170beda59cef0b36

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-install/-/compare/99f4d4b4910b2df4e457634dfd60cf0b8d574ce2...1d2f399011113f3b5e850210170beda59cef0b36
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


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


More information about the debian-edu-commits mailing list