MAKEDEV, postinst and udev
Hello, 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). Cheers, -- 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/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100609150436.ga26...@rivendell
Re: MAKEDEV, postinst and udev
On Jun 09, Raphael Hertzog hert...@debian.org wrote: 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. Patient: Doctor, it hurts when I do this. Doctor: Then stop doing it. If you remove udev then you are on your own. 1/ udev to keep mounting the on-disk /dev on /dev/.static/dev I removed this in 0.124-1, before lenny, and it will not be back. 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 makedev has extra priority and is not installed by default, it does not matter anymore. 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). This code should be removed. -- ciao, Marco signature.asc Description: Digital signature
Re: MAKEDEV, postinst and udev
On Wed, 09 Jun 2010, Marco d'Itri wrote: On Jun 09, Raphael Hertzog hert...@debian.org wrote: If you remove udev then you are on your own. There are still cases where not using udev is fine: chroots or in openvz containers. I would still want the packages requiring a device file to properly setup it in those cases. So it's still worth to document what they should do to support all use-cases... 1/ udev to keep mounting the on-disk /dev on /dev/.static/dev I removed this in 0.124-1, before lenny, and it will not be back. Why? Except for the additional mount point showing up in /proc/mounts it did not hurt IMO. Cheers, -- 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/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100609214453.gb1...@rivendell
Re: MAKEDEV, postinst and udev
On Wed, 2010-06-09 at 17:04 +0200, Raphael Hertzog wrote: Hello, 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. [...] They should do nothing. The device driver will generate a uevent when the device is created, and udev or other userland agent will create the device node. Since new device drivers do not get static device number assignments, there is no way to create their device nodes statically. Ben. -- Ben Hutchings Once a job is fouled up, anything done to improve it makes it worse. signature.asc Description: This is a digitally signed message part
Re: MAKEDEV, postinst and udev
On Jun 09, Raphael Hertzog hert...@debian.org wrote: There are still cases where not using udev is fine: chroots or in openvz containers. chroots can bind-mount the original /dev if needed and openvz containers generally do not need other devices than the ones which come in the template. 1/ udev to keep mounting the on-disk /dev on /dev/.static/dev I removed this in 0.124-1, before lenny, and it will not be back. Why? Except for the additional mount point showing up in /proc/mounts it did not hurt IMO. Too much pain, not enough gain. The details are in the changelog. Every feature has a cost in terms of development and support time. -- ciao, Marco signature.asc Description: Digital signature