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

Bug#694928: asks for confirmation on config-file change on /etc/default/rcS, while file didn't change



On Sun, Dec 02, 2012 at 11:49:44PM +0000, Roger Leigh wrote:
> On Sun, Dec 02, 2012 at 11:47:37PM +0000, Roger Leigh wrote:
> > clone 694928 -1
> > reassign -1 initscripts
> > thanks
> > 
> > On Sun, Dec 02, 2012 at 12:23:07PM +0100, Martin Zobel-Helas wrote:
> > 
> > Please find attached an example patch for flash-kernel to
> > support old and new (rcS and fsck) locations for FSCKFIX
> > as discussed on #debian-devel earlier.
> 
> Hmm, actually attached now.

Slight update to cope with commented-out lines (as provided
by default).

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
>From 4db3a50a7bd6b11f3a4fa425e5e2c9b7cf1c9673 Mon Sep 17 00:00:00 2001
From: Roger Leigh <rleigh@debian.org>
Date: Sun, 2 Dec 2012 23:34:57 +0000
Subject: [PATCH] debian: Update /etc/default/fsck in flash-kernel-installer
 postinst

---
 debian/changelog                       |   10 ++++++++++
 debian/flash-kernel-installer.postinst |    7 ++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 68c673b..526f1ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+flash-kernel (3.4) UNRELEASED; urgency=low
+
+  [ Roger Leigh ]
+  * flash-kernel-installer postinst: Update FSCKFIX in
+    /etc/default/fsck as well as /etc/default/rcS for backward
+    compatibility.  The purpose is to use /etc/default/fsck for
+    new installations.
+
+ -- Roger Leigh <rleigh@debian.org>  Sun, 02 Dec 2012 23:33:24 +0000
+
 flash-kernel (3.3) unstable; urgency=low
 
   * Replace XC-Package-Type by Package-Type
diff --git a/debian/flash-kernel-installer.postinst b/debian/flash-kernel-installer.postinst
index c07dee5..e9b88c7 100755
--- a/debian/flash-kernel-installer.postinst
+++ b/debian/flash-kernel-installer.postinst
@@ -35,7 +35,12 @@ db_progress INFO flash-kernel-installer/prepare
 
 # Stop fsck from prompting the user for input since most users don't
 # have a serial console.
-sed -i "s/^FSCKFIX=no$/FSCKFIX=yes/" /target/etc/default/rcS || true
+if [ -e /target/etc/default/rcS ]; then
+	sed -i -e "s/^FSCKFIX=no$/FSCKFIX=yes/" /target/etc/default/rcS || true
+fi
+if [ -e /target/etc/default/fsck ]; then
+	sed -i -e "s/^#FSCKFIX=no$/FSCKFIX=yes/" -e "s/^FSCKFIX=no$/FSCKFIX=yes/" /target/etc/default/fsck || true
+fi
 
 if ! apt-install flash-kernel; then
 	error "apt-install flash-kernel failed"
-- 
1.7.10.4


Reply to: