Description of problem: The %pre script of 'dev' checks for devfs by parsing /proc/mounts. This is wrong since: - chroot-installations will fail when host-system has devfs, although 'dev' could be installed into the chroot without problems - installations will fail were /dev is on an own, writable partition (this is again a chroot issue; e.g. /dev in build-chroot environments could be a commonly shared, read-only mountpoint) IMO a better way to decide whether /dev is devfs, is to check the device-number. E.g. a better %pre scriptlet could be | N=$(stat -c '%D' /dev) | test "$N" != 6 || { | echo $"Cannot install the dev package: mounted devfs detected." | exit 1 | } Version-Release number of selected component (if applicable): MAKEDEV-3.3.8-2
I agree that this is a problem case, but I don't think that checking for a magic device number will work dependably enough. Device numbers appear to be assigned as-needed for non-device mount points (on my test system, /dev/pts is device 6, /proc/bus/usb got 7, /dev/shm is 8, and so on), and 6 happens to be the first-available at this time.
Mmmh, you are right. But checking for major==0 should be enough. Additionally, atime==0 could be checked also: | D=$(stat -c '%X' /dev) | test "$N" -lt 256 -a $D = 0 ... Usual harddisks are 0x300 or 0x800, loop is 0x700 and RAID is 0x900, so all relevant cases are catched. NFS (which gets major==0 also) will have atime > 0.
Does 3.7-1 improve things?
3.12.1-1 does away with dev completely, %pre and all.