Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#18232 - [udev] post_install: mknod fails to create basic char devices if the files exist.

Attached to Project: Arch Linux
Opened by jonathan (wide-eye) - Monday, 08 February 2010, 06:56 GMT-4
Last edited by Gerardo Exequiel Pozzi (djgera) - Sunday, 28 February 2010, 14:51 GMT-4
Task Type Bug Report
Category Packages: Core
Status Assigned
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Description:
in udev.install mknod will fail to create /dev/{null,console,zero} if one of the files exists because mknod does not replace existing files.

this occurs for /dev/null during an install with pacman -S base -r /mnt/:

( 53/108) installing udev [##########################################################################################################] 100%
sh: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
mknod: `/dev/null': File exists

this results in an error at boot as /dev/null is not a special file and cannot be written to:
/etc/rc.d/functions: line 34: /dev/null: Read-Only file system

Additional info:
udev 151-2



Steps to reproduce:

install a system with pacman -S base -r /mnt and examine /mnt/dev/null

or test the logic of post_install() when /dev/null has been created by previously run install scripts:

$ touch null
$ [ -c null ] || mknod -m644 null c 1 3
mknod: `null': File exists
$ ls -la null
-rw-r--r-- 1 root root 0 Feb 8 06:08 null

null should be: "crw-r--r-- root root 1, 3"
This task depends upon

Comment by Gerardo Exequiel Pozzi (djgera) - Monday, 08 February 2010, 13:04 GMT-4
This is because is assumed that "/dev" (and "/proc" "/sys") are mounted on target directory when install the "base" group. Previous install scripts (before udev install) that do "> /dev/null" will write a normal file because does not exists. When udev install script checks that "/dev" and "/" are on the same FS, does not mount (bind) "/".

Comment by jonathan (wide-eye) - Tuesday, 09 February 2010, 03:18 GMT-4
What part of installing base packages with pacman requires these partitions to be mounted? having read through the post_install functions in core I do not see a reason for it. After installing base with and without dev, proc and sys mounted I find 2 errors: mknod fails as I have described, and the autodetect hook in mkinitcpio fails to search /sys/devices. mkinitcpio after the error leaves extra modules in the initramfs so it is just like the fallback initramfs, remaining perfectly usable. This mknod is the only thing which requires user action to repair. I am suggesting to change udev.install to remove a bad /dev/null if it exists before running mknod. with this change pacman -Sy base -r /mnt will work with or without /dev mounted.

attached is a diff of the pacman output for two installs, with and without proc, sys, and dev mounted. and a diff -ur of the two install directories. the install timestamp differences from pacman.log and pacman db have been removed.
Comment by Thomas Bächler (brain0) - Sunday, 28 February 2010, 14:58 GMT-4
I experienced this problem myself recently when creating a chroot with pacman -S base.

We could move the post_install from udev to filesystem. Or/And we could make the procedure more robust.

Loading...