-
Notifications
You must be signed in to change notification settings - Fork 6k
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
ceph.spec.in: use %_udevrulesdir to eliminate conditionals #5079
Conversation
Looks good! We could simplify this a tiny bit by defining Something like this:
... and then the macro's available for use elsewhere. |
edb38cc
to
180ae88
Compare
revamped to use |
%if 0%{?rhel} >= 7 || 0%{?fedora} | ||
install -m 0644 -D udev/50-rbd.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/50-rbd.rules | ||
install -m 0644 -D udev/60-ceph-partuuid-workaround.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/60-ceph-partuuid-workaround.rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move both 50-rbd.rules
and 60-ceph-partuuid-workaround.rules
up, now, and eliminate this particular conditional entirely :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install -m 0644 -D udev/60-ceph-partuuid-workaround.rules $RPM_BUILD_ROOT%{_udevrulesdir}/60-ceph-partuuid-workaround.rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but I was trying to keep the commit small and atomic
d82c79a
to
8ecbe61
Compare
@ktdreyer rebased and expanded. |
cool, looks good to me. Let's be sure this passes on gitbuilder, then merge
|
@ktdreyer did it pass on gitbuilder? |
@smithfarm pushed under the branch SUSE-wip-12166 in gitbuilder |
I'm just wondering whether the PR is not redefining _udevrulesdir somewhere where it is already defined or if there is a platform left where it is not defined at all? Maybe, something like
would be a safer solution? |
@BRANTO1: that seems to be saying that the udev rules directory is |
@smithfarm: Yes, it should cover all the cases that are covered by the patch with rhel and suse conditionals though. |
Maybe this would address @BRANTO1 's concern?
|
@smithfarm: That looks like it should work, I just wanted to avoid complicated conditions with that one-liner. :-) My rationale was simply that the _udevrulesdir macro was introduced when the udev files were moved to the new location so if it is not defined then they are probably in the old location (i.e. /lib/udev/rules.d). There might have been some fedoras where this did not hold but those are no longer supported. Not sure about suse here though. |
By adding the What if we moved it to the bottom, ie
|
Or, we could just assume that modern platforms will define _udevrulesdir, and just go with the original one-line proposal:
I don't know of any platforms where that would cause issues. |
The conditionals governing where 50-rbd.rules is installed were not doing the right thing on SUSE distros. Start using the %_udevrulesdir RPM macro, while taking care that it is defined and set to the right value. Use it to eliminate some conditionals around other udev rules files as well. http://tracker.ceph.com/issues/12166 Fixes: ceph#12166 Signed-off-by: Nathan Cutler <ncutler@suse.com>
OK, replaced three-line conditional with @BRANTO1 's one-liner. |
Looks good to me, if the patch passes the gitbuilders, you can consider this
|
ceph.spec.in: use %_udevrulesdir to eliminate conditionals Reviewed-by: Ken Dreyer <kdreyer@redhat.com> Reviewed-by: Boris Ranto <branto@redhat.com>
Awesome! I've pushed this to https://github.com/ceph/ceph/tree/wip-12166 in order to run it on the gitbuilders. |
I wonder if the same applies to |
oh, and by the way, |
gitbuilder-squeeze-amd64? yeah, looks like that one's just broken :( |
ceph.spec.in: use %_udevrulesdir to eliminate conditionals
@smithfarm: %_sbindir is a different thing. The location of %_sbindir has been configurable for a long time (you can usually supply --sbindir= to ./configure script). I suppose it was originally introduced to cover exactly this. The switch from /sbin to /usr/sbin is just a relatively new thing and is an attempt to unify the location of (system) binaries (i.e. to no longer have /sbin and /usr/sbin but only one of them). The original idea behind /bin and /sbin was to have an ability to do a basic boot of the system before mounting /usr (a pretty common scenario in the olden days) -- i.e. /bin and /sbin contained things like shell, mount, init and similar essential binaries that allowed the system to boot before /usr was mounted. AFAIK, the locations of these few binaries that went to /bin and /sbin were hard-coded -- it was up to developer/packager to decide whether a given binary is essential for boot. |
The conditionals governing where 50-rbd.rules is installed were
not doing the right thing on SUSE distros.
http://tracker.ceph.com/issues/12166 Fixes: #12166
Signed-off-by: Nathan Cutler ncutler@suse.com