FS#3984 - udev install script - failing with pacman -r

Attached to Project: Arch Linux
Opened by Michael Towers (gradgrind) - Thursday, 16 February 2006, 17:54 GMT
Last edited by Tobias Powalowski (tpowa) - Thursday, 16 February 2006, 18:31 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.1 Noodle
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Concerns udev-084-4:
Using 'pacman -r $DESTDIR -S <all base packages>' to install the base packages in a clean directory:
...
installing udev... done.
sbin/migrate-udev: line 8: mktemp: command not found
sbin/migrate-udev: line 12: mount: command not found
sbin/migrate-udev: line 13: cd: /root: No such file or directory
creating device nodes: console null zero
sbin/migrate-udev: line 28: umount: command not found
...

I'm pretty sure this worked before!

This task depends upon

Closed by  Tobias Powalowski (tpowa)
Tuesday, 21 February 2006, 07:42 GMT
Reason for closing:  Fixed
Comment by Tobias Powalowski (tpowa) - Thursday, 16 February 2006, 18:31 GMT
is this pacman related?
i don'T think the errors will cause any harm though
Comment by Jan de Groot (JGC) - Thursday, 16 February 2006, 19:25 GMT
It looks like the udev installation script uses utilities not listed as dependency. On a chroot installation this will break when not everything is installed in the correct order.
Comment by Tobias Powalowski (tpowa) - Friday, 17 February 2006, 07:36 GMT
i don't think that this migration script is needed at all. judd can you look at it please?
Comment by Michael Towers (gradgrind) - Friday, 17 February 2006, 08:15 GMT
The device nodes must be created, I suppose ...

I tried rebuilding udev with extra depends (mktemp and util-linux), fiddled my package repo to accept the new package, and it seemed to work fine (apart from a warning about not finding /etc/fstab).

Would this be an option?
Comment by Tobias Powalowski (tpowa) - Friday, 17 February 2006, 08:20 GMT
i think these nodes are not necessary? they already exists, udev is started with next boot
Comment by Michael Towers (gradgrind) - Friday, 17 February 2006, 11:01 GMT
Sorry, I didn't quite understand the last (tpowa) comment.
These are the nodes that must be there before udev starts, aren't they?
And if "they already exist", how do they get there? Something must create them (I mean in the case of a completely fresh install).
Comment by Tobias Powalowski (tpowa) - Friday, 17 February 2006, 11:05 GMT
no i mean if you do a freas install there is not udev running it runs on first time you boot the new system.
these nodes are created when you call /etc/start_udev i don't know why this migration script is needed anymore.
Comment by Michael Towers (gradgrind) - Saturday, 18 February 2006, 14:13 GMT
I've considered this a bit more and still think there's a problem here.
Firstly, the device nodes must be there or else the init script can't open a console and dies - /etc/start_udev never gets called.
Secondly, I think the nodes will only be created by the migration script when the 'filesystem' package has not yet been installed (it seems to try to cd to /root, which doesn't yet exist because that is in 'filesystem', so 'by accident' the nodes are created in /dev ...). Can one rely on pacman installing 'udev' before 'filesystem'? Can one be happy with such a bodged solution?
Alternatively, 'mktemp' and 'util-linux' can be installed before 'udev'.
I guess the reason the mktemp/mount/umount stuff is there is to handle the case when udev is already running during the installation (and so the raw /dev is hidden). But surely in this case the device nodes must already be present on the raw /dev, or else the system would never have started in the first place ...
So actually one would surely only need to create the nodes for a pacman -r install. Wouldn't there be a neater way of doing this?
Comment by Michael Towers (gradgrind) - Sunday, 19 February 2006, 07:01 GMT
How about something along these lines in the install file instead of the call to migrate-udev?

if [ ! -c dev/console ]; then
echo -n "creating device nodes: "
mknod dev/console c 5 1
echo -n "console "
mknod -m 666 dev/null c 1 3
echo -n "null "
mknod -m 666 dev/zero c 1 5
echo -n "zero "
echo
fi

Or are there cases this would not cover?

Comment by Judd Vinet (judd) - Monday, 20 February 2006, 05:16 GMT
/dev/null is used by the rc scripts, so it's pretty important to have it before udev starts.

Same with console, otherwise you wouldn't see anything. /dev/zero is along for the ride.
Comment by Tobias Powalowski (tpowa) - Monday, 20 February 2006, 08:32 GMT
judd couls you please fix this in cvs then i can update udev, i'm also waiting for a feedback for ide-cs problems then i'll update udev again.

Loading...