[debian-edu-commits] [Git][debian-edu/debian-edu-config][personal/sunweaver/fix-edu-profile-of-dlws] 3 commits: share/debian-edu-config/tools/run-at-firstboot: Add an environment check to...
Mike Gabriel (@sunweaver)
gitlab at salsa.debian.org
Fri Sep 4 22:24:55 BST 2026
Mike Gabriel pushed to branch personal/sunweaver/fix-edu-profile-of-dlws at Debian Edu / debian-edu-config
Commits:
c2ba0299 by Serhii Horichenko at 2026-09-04T19:26:12+02:00
share/debian-edu-config/tools/run-at-firstboot: Add an environment check to avoid starting the image creation on an LTSP-client (Closes: #1092123).
- - - - -
8b5765b6 by Serhii Horichenko at 2026-09-04T19:40:06+02:00
share/debian-edu-config/tools/run-at-firstboot: Add an ability to create a Diskless Workstation chroot and separate the creation of an image on an LTSP-server without the Main-Server role (Closes: #1092123).
- - - - -
1b3d05e6 by Mike Gabriel at 2026-09-04T21:24:53+00:00
sbin/debian-edu-ltsp-install: When creating a DLW, set PROFILE to 'Workstation' (Closes: #1092123).
- - - - -
2 changed files:
- sbin/debian-edu-ltsp-install
- share/debian-edu-config/tools/run-at-firstboot
Changes:
=====================================
sbin/debian-edu-ltsp-install
=====================================
@@ -607,11 +607,15 @@ EOF
rm -f /etc/resolv.conf
echo "nameserver $dns_server" > /etc/resolv.conf
echo "search intern" >> /etc/resolv.conf
+ # Temporary workaround needed to turn DLW images into machines of profile type 'Workstation'
+ sed -i /etc/debian-edu/config -e "s/^PROFILE=.*/PROFILE=\"Workstation\"/g"
# Create SqashFS image.
ltsp image /,,/boot,subdir=boot,,/usr,subdir=usr,,/var,subdir=var
# Revert resolver workaround from above.
rm -f /etc/resolv.conf
ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
+ # Revert temporary change to PROFILE in /etc/debian-edu/config
+ sed -i /etc/debian-edu/config -e "s/^PROFILE=.*/PROFILE=\"${PROFILE}\"/g"
# next modification avoids ltsp command error if lot of images are available.
ALL_IMAGES=1 ltsp kernel
ltsp initrd
@@ -675,7 +679,7 @@ EOF
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"
+ chroot /srv/ltsp/dlw sh -c "PROFILE=Workstation 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
=====================================
share/debian-edu-config/tools/run-at-firstboot
=====================================
@@ -26,6 +26,14 @@ at_exit() {
error "script $0 terminated unexpectedly."
}
disable_exception() { trap - INT TERM EXIT; }
+is_ltsp_client() {
+ if grep -q "initrd=ltsp.img" < /proc/cmdline; then
+ return 0
+ else
+ return 1
+ fi
+}
+
trap at_exit INT TERM EXIT
info "Executing run-at-firstboot script."
@@ -62,9 +70,23 @@ fi
# information from some daemons isn't available during installation. It's done
# for a combined server but not for a separate LTSP server because the image
# 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 --diskless_workstation yes
+if ! is_ltsp_client; then
+ # If this runs on a combi server (Main-Server + LTSP-Server), create
+ # Diskless Workstation chroot from scratch as clean environment.
+ if echo "$PROFILE" | grep -Eq 'Main-Server' && \
+ echo "$PROFILE" | grep -Eq 'LTSP-Server'; then
+ if [ ! -d /srv/ltsp/dlw ]; then
+ /usr/sbin/debian-edu-ltsp-install --dlw yes
+ fi
+ # else if this runs on a pure LTSP-Server (no Main-Server role), then
+ # let's use the file system of the LTSP-Server and generate the LTSP
+ # image directly from it (faster!).
+ elif echo "$PROFILE" | grep -Eqv 'Main-Server' && \
+ echo "$PROFILE" | grep -Eq 'LTSP-Server'; then
+ if [ ! -f /srv/ltsp/images/$ltspimg ] ; then
+ /usr/sbin/debian-edu-ltsp-install --diskless_workstation yes
+ fi
+ fi
fi
# Update PXE setup on LTSP servers with proxy values set in environment
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/ef8afacad07e0ed8f35b2e1614660348bbe1389c...1b3d05e62e136d7e9b944ffbcc978e8d69946624
--
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/ef8afacad07e0ed8f35b2e1614660348bbe1389c...1b3d05e62e136d7e9b944ffbcc978e8d69946624
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/20260904/ab8c5fc2/attachment-0001.htm>
More information about the debian-edu-commits
mailing list