Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.rules to .act #72

Open
Obarun opened this issue Oct 13, 2015 · 10 comments
Open

.rules to .act #72

Obarun opened this issue Oct 13, 2015 · 10 comments

Comments

@Obarun
Copy link
Contributor

Obarun commented Oct 13, 2015

hello,
First, thank you for your hard work, it's very appreciate.
I'm working on a archlinux based system with Runit as services manager and obviously without systemd. For the moment i use eudev.
I have made a pkgbuild based on https://aur.archlinux.org/cgit/aur.git/tree/?h=vdev-git for arch and change some files for example libudev.pc to better correspond to the archlinux structure, added license, create a good symlink, etc..... I will provide as soon as possible on my github.
So i try to make a hook for building an initramfs to run earlier vdev. If i understand you're concept i need to replace .rules provide by eudev by a .act and include it in my hook. But i'm little be confused when i look your example of .act. For example in the 50-udev-defaults.rules i have this KERNEL== or this GOTO=. How can i know your corresponding option? Do you have a parser to convert directly .rules to .act?
Onemore when i try to compile the tools udev_to_vdev with the makefile i have this error :
g++ -o udev2vdev
g++: fatal error: no input files
May be i make a mistake.

Sorry for my english and once again thank you for your work.

@jcnelson
Copy link
Owner

Hi @Obarun,

Vdev does not use udev rules at all. Vdev is a lot more like mdev than udev--you use .act files to identify a class of device events and the program(s) for vdev to run to handle them. For example, the file example/actions/loop.act matches all device-add events from the disk subsystem whose names start with loop and end in a number. When it finds such an event, vdev exports a few environment variables and runs the permissions.sh helper program (installed /lib/vdev/) to set its ownership to root.disk and mode to 0660. More details can be found in https://github.com/jcnelson/vdev/blob/master/how-to-test.md.

The udev2vdev tool currently does nothing. If you want to add new behaviors, you'll need to create new .act files.

Thanks,
Jude

@suedi
Copy link
Contributor

suedi commented Oct 13, 2015

I oogled your PKGBUILD for vdev and saw that you had lvm2 as depends

I think that should be optdepends
vdev can run without it.

Logiacallly it may put device-mapper in optdepends also

Mr Nelson, please correct me if I'm wrong.

EDIT
Ahha the referenced PKGBUILD was fbt's so my comment may or may not apply to your PKGBUILD

@jcnelson
Copy link
Owner

@suedi is right. lvm2 is an optional dependency. You only need it if you want vdev to handle LVM volumes. Similarly, vdev only needs device-mapper if you make use of it already.

@fbt
Copy link
Contributor

fbt commented Oct 13, 2015

Fair enough, I've moved both packages to optdepends.

@Obarun wanna email me or comment on the AUR page for me to merge the improvements?

@Obarun
Copy link
Contributor Author

Obarun commented Oct 14, 2015

thank for your reply, i understand a little bit how to do my work.
@fbt you can find my pkgbuild here https://github.com/Obarun/obarun-pkgbuild/tree/master/vdev-obarun

@fbt
Copy link
Contributor

fbt commented Oct 14, 2015

@Obarun thx, I've incorporated some of your work into the PKGBUILD (and added you as a contributor).

On that note, @jcnelson, I think the example target needs some more flexibility. We need RUNDIR and LOGDIR. They are currently hardcoded as being under PREFIX in the config.

@fbt
Copy link
Contributor

fbt commented Oct 14, 2015

I've made a pull request: #73

@Obarun
Copy link
Contributor Author

Obarun commented Oct 14, 2015

@fbt Great thank for this features

@fbt
Copy link
Contributor

fbt commented Oct 14, 2015

@Obarun btw you go over the .pc file with sed, but it doesn't seem to be necessary at all, as without it the result is sane:

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib
includedir=/usr/include

@Obarun
Copy link
Contributor Author

Obarun commented Oct 14, 2015

@fbt yep i saw it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants