Package: extlinux
Version: 2:4.05+dfsg-2
Severity: normal
Tags: patch

Upgrade of extlinux fails if the system works on AUFS and upgrade is being done
in an environment chrooted to the underlying real (persistent) filesystem. This
is because extlinux.postinst uses df to determine which block device contains
the /boot/extlinux directory. Df returns "aufs", while findmnt finds the block
device correctly. I propose a patch to use findmnt (from mount package).

There is a patch for findmnt being implemented upstream[1] which will simplify
the postinst script. It will then look like the df version now (no path
chopping). But it's going to need some time before it gets to Debian.

[1] http://article.gmane.org/gmane.linux.utilities.util-linux-ng/5690



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (600, 'testing'), (500, 'stable-updates'), (500, 'stable'), (50, 
'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages extlinux depends on:
ii  debconf [debconf-2.0]  1.5.42
ii  libc6                  2.13-27

Versions of packages extlinux recommends:
pn  syslinux-common         2:4.05+dfsg-2
pn  syslinux-themes-debian  <none>

extlinux suggests no packages.

-- debconf information excluded
>From 7073983154e962cbfea32aaa710eea0429413581 Mon Sep 17 00:00:00 2001
From: Marcin Szewczyk <marcin.szewc...@wodny.org>
Date: Thu, 12 Apr 2012 15:54:33 +0200
Subject: [PATCH] use findmnt instead of df for finding /'s device

---
 extlinux.postinst |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/extlinux.postinst b/extlinux.postinst
index b09f61b..86d33b5 100644
--- a/extlinux.postinst
+++ b/extlinux.postinst
@@ -15,7 +15,14 @@ case "${1}" in
 			true)
 				extlinux-update
 
-				_DEVICE="$(df -P /boot/extlinux | tail -1 | awk '{ print $1 }' | sed -e 's|[0-9]||g')"
+				_DEVICE=
+				_PATH=/boot/extlinux
+				while true; do
+					_DEVICE="$(findmnt -n --raw -c -o SOURCE "${_PATH}/" | sed -e 's|[0-9]||g')"
+					[ -n "${_DEVICE}" ] && break
+					[ -z "${_PATH}" ] && break
+					_PATH=${_PATH%/*}
+				done
 
 				extlinux-install "${_DEVICE}"
 				;;
-- 
1.7.9.1

Reply via email to