[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#283377: Should not copy installer account to /target if network-console-config not installed



Before I started testing the patch I realized that I had not covered one 
situation: if the user decides not to install over SSH after all, the 
network-console-config package should be purged during prebaseconfig.
In the old situation that package would not be installed, but now it will 
already have been installed (if available) during base-installation.

I have committed an additional patch to trunk to cover this situation.

I have tested the new version (including this latest patch) in 4 installs:
- s390 generic over ssh (build myself to include patched network-console)
- i386 netinst over ssh (network-console-config not available on CD)
- i386 netinst; selected network-console, but installed from console
- i386 businesscard over ssh

All installs resulted in the expected actions from the installer and 
correct messages in logs. The first and last installs resulted in 
base-installation being run over SSH; the second and third from the 
console (as expected).

I've attached the combined patch for this problem.

Joey: Could you upload the 0.0.10 version of network-console? TIA

Index: debian/changelog
===================================================================
--- debian/changelog	(revision 24006)
+++ debian/changelog	(working copy)
@@ -1,3 +1,23 @@
+network-console (0.0.10) UNRELEASED; urgency=low
+
+  * Frans Pop
+    - Forgot that now network-console-config should be purged if user
+      decided not to install over SSH after all
+    - Rewrite log messages in prebaseconfig
+
+ -- Frans Pop <aragorn@tiscali.nl>  Fri,  3 Dec 2004 21:11:22 +0100
+
+network-console (0.0.9) unstable; urgency=low
+
+  * Frans Pop
+    - Only copy SSH keys and installer account if network-console-config
+      is installed successfully. Closes: #283377.
+    - Queue installation of network-console-config in postinst as for
+      CD-based installations the CD will already be unmounted when the
+      prebaseconfig script is run (tanks to Colin Watson for spotting this).
+
+ -- Joey Hess <joeyh@debian.org>  Wed,  1 Dec 2004 14:09:07 -0500
+
 network-console (0.0.8) unstable; urgency=low
 
   * Frans Pop
Index: debian/network-console.postinst
===================================================================
--- debian/network-console.postinst	(revision 24006)
+++ debian/network-console.postinst	(working copy)
@@ -45,7 +45,9 @@
 
 sshd
 
+# Queue installation of network-console-config
+apt-install network-console-config || true
+
 db_subst $TEMPLATE_ROOT/start fingerprint $KEY_FINGERPRINT
 db_input critical $TEMPLATE_ROOT/start
 db_go
-
Index: prebaseconfig
===================================================================
--- prebaseconfig	(revision 24006)
+++ prebaseconfig	(working copy)
@@ -1,8 +1,6 @@
 #!/bin/sh
 set -e
 
-[ "$TERM_TYPE" != network ] && exit 0
-
 log() {
     logger -t prebaseconfig "$@"
 }
@@ -10,7 +8,30 @@
 . /usr/share/debconf/confmodule
 
 TEMPLATE_ROOT=debian-installer/network-console
+PACKAGE=network-console-config
 
+if [ "$TERM_TYPE" != network ]; then
+    # Apparently the user has decided not to install over SSH after all,
+    # so base-configuration should be started on the console from inittab.
+    # Purge the network-console-config package (if it was installed)
+    log "Installation is not over SSH; purging $PACKAGE from /target"
+    chroot /target dpkg --purge $PACKAGE >/dev/null 2>&1 || true
+    exit 0
+fi
+
+if chroot /target dpkg -l $PACKAGE 2>/dev/null | grep "^ii" ; then
+    log "Setting up the system to allow base-configuration to be run over SSH"
+    db_input critical $TEMPLATE_ROOT/prebaseconfig-reminder
+    db_go
+else
+    ## FIXME (see #279090) ##
+    # There really should be a dialog shown here
+    # Not implemented yet because of string freeze for RC2 release
+    log "Package $PACKAGE was not installed into /target;"
+    log "the system will not be set up to run base-configuration over SSH"
+    exit 0
+fi
+
 DIR=/etc/ssh/
 
 mkdir /target/$DIR
@@ -19,14 +40,3 @@
 
 echo 'installer:x:0:0:installer:/:/usr/sbin/base-config-network-console' >> /target/etc/passwd
 grep "^installer:" /etc/shadow >> /target/etc/shadow
-
-if apt-install network-console-config ; then
-    log "Installed network-console-config successfully into /target"
-    db_input critical $TEMPLATE_ROOT/prebaseconfig-reminder
-    db_go
-else
-    ## FIXME (see #279090) ##
-    # There really should be a dialog shown here
-    # Not implemented yet because of string freeze for RC2 release
-    log "Installation of network-console-config into /target failed"
-fi

Reply to: