severity 429437 minor
tags 429437 = patch
thanks

On Tue, Jun 19, 2007 at 01:13:08PM +0200, Aurélien GÉRÔME wrote:
>On Tue, Jun 19, 2007 at 06:17:14PM +1000, Kel Modderman wrote:
>>On Tue, 19 Jun 2007 08:38:30 am Ludovic RESLINGER wrote:
>>> It is not a solution to apply your patch because if /dev/MAKEDEV doesn't
>>> exist, /dev/raw1394 won't be created and libraw1394 won't work.
>>>
>>> I don't know how udev work in chroot, I think that you should ask it at
>>> udev's maitainer.
>>
>>Or your postinst could get smarter. Unconditionally calling
>>      "cd /dev && ./MAKEDEV"
>>*assumes* udev is active. That condition is not true in all cases.
>
>Not necessarily, as you are using a chroot, the makedev package
>is present inside by default just after debootstrapping. It also
>provides a symlink from /dev/MAKEDEV to /sbin/MAKEDEV created by its
>init script which is called by its postinst maintainer script.
>
>To wit, makedev and udev conflict, so you have to make a choice.
>
>If you choose to use udev in a chroot, you *have* to run it, otherwise
>/dev/MAKEDEV will not exist and hence libraw1394 is bound to fail
>without the raw1394 character device. Silently hiding the non-creation
>of /dev/raw1394 is a bug and I advise the maintainer not to do so.
>
>If you do not want to run udev in your chroot, please choose makedev
>instead.

With udev, /dev/MAKEDEV is a symlink to /bin/true, so it actually
does nothing, as it is udev which will create the chardev if necessary.

However, with makedev, we must create the chardev, so I came up
with the attached patch which will launch MAKEDEV only if makedev
is installed.

Cheers,
-- 
 .''`.   Aurélien GÉRÔME
: :'  :
`. `'`   Free Software Developer
  `-     Unix Sys & Net Admin
diff -ruN libraw1394-1.2.1.orig/debian/libraw1394-8.postinst 
libraw1394-1.2.1/debian/libraw1394-8.postinst
--- libraw1394-1.2.1.orig/debian/libraw1394-8.postinst  2007-06-19 
14:07:06.000000000 +0000
+++ libraw1394-1.2.1/debian/libraw1394-8.postinst       2007-06-19 
14:15:54.841329316 +0000
@@ -1,9 +1,15 @@
 #!/bin/sh -e
 
 if [ "$1" = "configure" ]; then
-       echo -n "Creating device node /dev/raw1394... "
-       cd /dev && ./MAKEDEV raw1394
-       echo "done."
+  # If makedev is installed, use it to create the chardev.
+  # Otherwise, udev is installed and nothing needs to be done.
+  makedev=$(dpkg -l makedev 2>/dev/null|sed -n '$p')
+  if [ "$makedev" != "${makedev#i}" ]
+  then
+    echo -n "Creating device node /dev/raw1394... "
+    cd /dev && ./MAKEDEV raw1394
+    echo "done."
+  fi
 fi
 
 #DEBHELPER#

Attachment: signature.asc
Description: Digital signature

Reply via email to