[debian-edu-commits] debian-edu/ 01/01: Add new debconf preseeding value debian-edu-install/quick-install, allowing the installation to run within a eatmydata environment to disable all sync/fsync calls in tasksel/apt-get/aptitude/dpkg. This speed up the installation a lot. Preseed to false during initial testing.

Petter Reinholdtsen pere at moszumanska.debian.org
Mon Sep 15 12:58:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository debian-edu-install.

commit f05aadf767c7fa03184dfe71238474fd63c616ff
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Mon Sep 15 14:58:48 2014 +0200

    Add new debconf preseeding value debian-edu-install/quick-install, allowing the installation to run within a eatmydata environment to disable all sync/fsync calls in tasksel/apt-get/aptitude/dpkg. This speed up the installation a lot.  Preseed to false during initial testing.
---
 debian/changelog                         | 10 +++++++++
 debian/debian-edu-profile-udeb.templates |  7 +++++++
 finish-install                           | 19 +++++++++++++++++
 pre-pkgsel                               | 36 ++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8934541..b600c9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+debian-edu-install (1.801) UNRELEASED; urgency=low
+
+  * Add new debconf preseeding value debian-edu-install/quick-install,
+    allowing the installation to run within a eatmydata environment to
+    disable all sync/fsync calls in tasksel/apt-get/aptitude/dpkg.
+    This speed up the installation a lot.  Preseed to false during
+    initial testing.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Mon, 15 Sep 2014 14:54:37 +0200
+
 debian-edu-install (1.800) unstable; urgency=high
 
   [ Petter Reinholdtsen ]
diff --git a/debian/debian-edu-profile-udeb.templates b/debian/debian-edu-profile-udeb.templates
index d991e80..18cb447 100644
--- a/debian/debian-edu-profile-udeb.templates
+++ b/debian/debian-edu-profile-udeb.templates
@@ -169,3 +169,10 @@ _Description: Missing required network connectivity
  To install Debian Edu using PXE and NETINST CD, network
  connectivity is required.  It is currently missing, so this
  installation can not continue and will be aborted.
+
+Template: debian-edu-install/quick-install
+Type: boolean
+Default: false
+Description: for internal use - disable sync when installing packages
+ This value can be preseeded to true if tasksel/apt/dpkg should run
+ within a eatmydata environment disabling file system sync.
diff --git a/finish-install b/finish-install
index 41cdabd..debc98f 100755
--- a/finish-install
+++ b/finish-install
@@ -23,6 +23,23 @@ at_exit() {
 disable_exception() { trap - INT TERM EXIT; }
 trap at_exit INT TERM EXIT
 
+# Revert the divert we did in the pre-pkgsel.d fragment to speed up
+# the installation.
+remove_install_override() {
+    for bin in dpkg apt-get aptitude tasksel ; do
+	file=/target/usr/bin/$bin
+	if [ -x /target$file.edu ] ; then
+	    rm /target$file
+	    chroot /target dpkg-divert --package debian-edu-config \
+		--rename --quiet --remove $file
+	    rm /target$file.edu
+	else
+	    error "Missing divert for $file."
+	fi
+    done
+    sync # Flush file buffers before continuing
+}
+
 # Stop automatic lvm resize script set up before base-installer
 # started.
 rm -f /target/debian-edu-extend-file-systems
@@ -37,5 +54,7 @@ else
     error "Unable to find $hook"
 fi
 
+remove_install_override
+
 disable_exception
 exit 0
diff --git a/pre-pkgsel b/pre-pkgsel
index fa09da5..45ead2c 100755
--- a/pre-pkgsel
+++ b/pre-pkgsel
@@ -38,6 +38,35 @@ install_required_pkg() {
     fi
 }
 
+# Speed up apt/dpkg/tasksel intsallation by disabling all file system
+# flushing.  If something go wrong on first time installation,
+# reinstall.  This divert is undone in finish-install.  See also bug
+# #613428.
+# Install on Dell D505 07:46 - 08:50 54m (tasksel run at uio.no,
+#   installing lxde)
+# Install on Dell D505 11:27 - 12:11 44m (similar, but included
+#   waiting for me to answer two debconf questions)
+override_install() {
+    apt-install eatmydata || true
+    if [ -x /target/usr/bin/eatmydata ] ; then
+	for bin in dpkg apt-get aptitude tasksel ; do
+	    if [ -f /target/usr/bin/$bin ] ; then
+		log "diverting /usr/bin/$bin using eatmydata"
+		printf "#!/bin/sh\neatmydata $bin.distrib \"$@\"\n" \
+		    > /target/usr/bin/$bin.edu
+		chmod 755 /target/usr/bin/$bin.edu
+		chroot /target dpkg-divert --package debian-edu-config \
+		    --rename --quiet --add /usr/bin/$bin
+		ln -sf ./$bin.edu /target/usr/bin/$bin
+	    else
+		error "unable to divert /usr/bin/$bin, as it is missing."
+	    fi
+	done
+    else
+	error "unable to find /usr/bin/eatmydata after installing the eatmydata pacage"
+    fi
+}
+
 load_proxy_conf
 
 # Initialize etckeeper early
@@ -80,6 +109,13 @@ fi
 
 edu-etcvcs commit
 
+db_get debian-edu-install/quick-install
+if [ true = "$RET" ] ; then
+    override_install
+else
+    log "not enabling quick install, preseed debian-edu-install/quick-install=true to change this."
+fi
+
 log "asking for a few extra packages to be installed"
 
 # our local archive keyring, update apt database after it is installed

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-install.git



More information about the debian-edu-commits mailing list