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

MAKEDEV, postinst and udev


what should package that require a specific device file do in their postinst ?

Many packages verify that the device does not exist and verify that
/dev/MAKEDEV exists and do "cd /dev && ./MAKEDEV something" only in
that case.

This works well in most cases but if you're using udev when installing the
package, MAKEDEV will not be called and the device has no chance to be
created on the on-disk filesystem. If you later remove udev, you will have
a broken system since the device won't be present.

Note that MAKEDEV has code to create the device in /dev/.static/dev/ if
that's a mount point and if udev is used.

Fixing this requires:
1/ udev to keep mounting the on-disk /dev on /dev/.static/dev
2/ fix packages to always call /dev/MAKEDEV if it exists (udev ensures it
   exists either as symlink to the real one or to /bin/true if makedev is
   not installed)

Should we do this?

In any case, I would like the result of this discussion to be summarized
in a README.Debian in makedev at the very least and possibly in the Debian
policy too. In that case, it should be mentionned that depending on
makedev is not necessary but that calling it on systems that have it
should always be done to support users that don't use udev.

In general this is not a very important scenario but I just stumbled on
the problem indirectly because I have a customized debian-installer where
chroots/virtual-machines are created during install and debian-installer
mount --bind his own udev-based /dev on /target/dev during initial
installation. When I reboot on the target system (that does not have
udev), the vtun service was not working properly (because its postinst
does not run MAKEDEV since /dev/net/tun was already existing).

Note that debian-installer was trying to do well and was mounting
the underlying /target/dev as /target/dev/.static/dev but the current code
is not working (see #585133).

Raphaël Hertzog

Like what I do? Sponsor me: http://ouaza.com/wp/2010/01/05/5-years-of-freexian/
My Debian goals: http://ouaza.com/wp/2010/01/09/debian-related-goals-for-2010/

Reply to: