[Pkg-voip-commits] r5092 - in /zaptel/trunk/debian: changelog zaptel.postinst

paravoid at alioth.debian.org paravoid at alioth.debian.org
Tue Dec 11 21:51:40 UTC 2007


Author: paravoid
Date: Tue Dec 11 21:51:40 2007
New Revision: 5092

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5092
Log:
* Correctly detect udev/devfsd and chrooted environments at postinst time.

Modified:
    zaptel/trunk/debian/changelog
    zaptel/trunk/debian/zaptel.postinst

Modified: zaptel/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/zaptel/trunk/debian/changelog?rev=5092&op=diff
==============================================================================
--- zaptel/trunk/debian/changelog (original)
+++ zaptel/trunk/debian/changelog Tue Dec 11 21:51:40 2007
@@ -23,11 +23,11 @@
   [ Faidon Liambotis ]
   * Don't delete old device nodes on installations since it's needed only for
     upgrades from <= sarge which isn't supported. Shuts up lintian error.
-  * Correctly detect udev and devfsd at postinst time.
+  * Correctly detect udev/devfsd and chrooted environments at postinst time.
   * Fix debian/watch by using a pkg-voip wrapper to avoid upstream's silly
     redirections. (Closes: #449673)
 
- -- Faidon Liambotis <paravoid at debian.org>  Sat, 01 Dec 2007 11:45:37 +0200
+ -- Faidon Liambotis <paravoid at debian.org>  Tue, 11 Dec 2007 23:50:42 +0200
 
 zaptel (1:1.4.5.1~dfsg-2) unstable; urgency=low
 

Modified: zaptel/trunk/debian/zaptel.postinst
URL: http://svn.debian.org/wsvn/pkg-voip/zaptel/trunk/debian/zaptel.postinst?rev=5092&op=diff
==============================================================================
--- zaptel/trunk/debian/zaptel.postinst (original)
+++ zaptel/trunk/debian/zaptel.postinst Tue Dec 11 21:51:40 2007
@@ -16,12 +16,23 @@
 	mknod "$@" || true
 }
 
+# stolen from udev
+chrooted() {
+  if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ];
+  then
+    # the devicenumber/inode pair of / is the same as that of /sbin/init's
+    # root, so we're *not* in a chroot and hence return false.
+    return 1
+  fi
+  return 0
+}
+
 case "$1" in
     configure)
 
         #MAKEDEV zaptel
 
-	if [ ! -e /dev/.devfsd -a ! -e /dev/.udevdb -a ! -e /dev/.udev ]; then
+	if [ ! chrooted -a ! -e /dev/.devfsd -a ! -e /dev/.udevdb -a ! -e /dev/.udev ]; then
         	mkdir -p /dev/zap
 	        mknod_safe /dev/zap/ctl c 196 0
         	mknod_safe /dev/zap/transcode c 196 250




More information about the Pkg-voip-commits mailing list