Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. 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#13197 - [PATCH] initscripts/udev: Use the /lib/udev/devices/

Attached to Project: Arch Linux
Opened by Gerardo Exequiel Pozzi (djgera) - Wednesday, 11 February 2009, 02:56 GMT
Last edited by Thomas Bächler (brain0) - Monday, 09 March 2009, 08:17 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Architecture All
Severity Medium
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi

The udev documentation recommend to use the directory /lib/udev/devices/ for initial, static and custom devices.

Citation from README:
- The content of /lib/udev/devices/ directory which contains the nodes,
symlinks and directories, which are always expected to be in /dev, should
be copied over to the tmpfs mounted /dev, to provide the required nodes
to initialize udev and continue booting.

Also, this work with this rule defined at /lib/udev/rules.d/50-udev-default.rules:

# do not delete static device nodes
ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove"



I modified the rc.sysinit to complain with this, the patch is attached.
Also script is attached to make /lib/udev/devices/* these files maybe created at the udev "install scriptlet" or in "PKGBUILD".


I tested in my system and its work fine ;)

This task depends upon

Closed by  Thomas Bächler (brain0)
Monday, 09 March 2009, 08:17 GMT
Reason for closing:  Implemented
Comment by Aaron Griffin (phrakture) - Wednesday, 11 February 2009, 03:36 GMT
Would you be able to update the "make-devices" script to do the following:
a) check if the node exists first, for each node
b) create the actual dir if it doesn't exist
b) use the mount trick the current install script does - because a tmpfs is mounted on top of /dev

Then we can use that in place of the current install scriptlet

Otherwise, I like this
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 11 February 2009, 04:48 GMT
Hi Aaron,

I created a patch for the actual udev.install to create the special files under /lib/udev/devices at the post_install()

Please note that the udev.install create the chars devices "null" and "zero" with the incorrect permission "0644" should be "0666".

Need a post_remove() to delete these files under /lib/udev/devices/* in udev.install ? Then also provide a patch with it ;)

Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 11 February 2009, 14:57 GMT
Oops:
* fixed the "uninstall phase", post_remove() -> pre_remove().
* when upgrade create the devices if version < 135-2 in post_upgrade()
* create a funtion _make_devices_install() in the udev.install (this is good or bad practice in these files?)

The patch is attached
Comment by Aaron Griffin (phrakture) - Wednesday, 11 February 2009, 16:23 GMT
One note: in the removal step, you rmdir the 'devices' dir, but do not mkdir it in the install step. This dir _could_ be part of the package, but whoever controls it should control both addition and removal. I think we should make the dir in the PKGBUILD and skip the rmdir step.

Other than that, I like it - tpowa, what do you think?
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 11 February 2009, 16:35 GMT
Actually the /lib/udev/devices exists in udev-135-1

And yes, is better to create in the PKGBUILD "mkdir /lib/udev/devices/{pts,shm}" :)
Comment by Tobias Powalowski (tpowa) - Wednesday, 11 February 2009, 17:14 GMT
next udev bump will also include probably adding new default groups too,
so we could test this too :).
im pretty busy at the moment, so i don't expect to have time for doing this now.
Comment by Thomas Bächler (brain0) - Saturday, 07 March 2009, 19:23 GMT
Okay, tpowa included this in trunk, but I am curious: Why do we create these devices node in post_install? IMO, it would be easier and cleaner to create them in the udev package itself.

I commited the required change to initscripts.git and I am going to add some more magic to the udev package that is now possible with this trick.
Comment by Gerardo Exequiel Pozzi (djgera) - Monday, 09 March 2009, 01:03 GMT
Yes, now the files are within the devs tar.gz (udev-139-1), and I think the most appropriate.
I followed the line to put them on .install, because I thought maybe it was a philosophical question not put special files in a tar.gz
Comment by Thomas Bächler (brain0) - Monday, 09 March 2009, 08:17 GMT
Yes, I put them there and it works fine for me. I also added some static devices for convenience. The stock udev rule for not deleting the devices is broken, too, so I wrote one that works.

About special files in the package: You should not put files into a package that will go to /dev/, but special files in general seem to work fine. This should all be implemented and working fine, closing now.

Loading...