All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs
       [not found] ` <1355684720-25274-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
@ 2012-12-16 19:05   ` Amadeusz Żołnowski
  0 siblings, 0 replies; 6+ messages in thread
From: Amadeusz Żołnowski @ 2012-12-16 19:05 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Amadeusz Żołnowski

To avoid need of rebuild after udev update/downgrade let udevdir= be set
dynamically with pkg-config.  Use udevaltdirs to search for rules both
in old and new locations.
---
 dracut.conf.d/gentoo.conf.example | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
index 1361a30..b78e5c6 100644
--- a/dracut.conf.d/gentoo.conf.example
+++ b/dracut.conf.d/gentoo.conf.example
@@ -1,7 +1,8 @@
 # /etc/dracut.conf.d/gentoo.conf
 # dracut config file customized for Gentoo Base System release 2
 
-udevdir=/lib/udev
+udevdir=
+udevaltdirs="/lib/udev /usr/lib/udev"
 ro_mnt=yes
 
 #
-- 
1.8.0.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs
       [not found] ` <1358020128-20693-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
@ 2013-01-12 19:48   ` Amadeusz Żołnowski
  0 siblings, 0 replies; 6+ messages in thread
From: Amadeusz Żołnowski @ 2013-01-12 19:48 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Amadeusz Żołnowski

To avoid need of rebuild after udev update/downgrade let udevdir= be set
dynamically with pkg-config.  Use udevaltdirs to search for rules both
in old and new locations.
---
 dracut.conf.d/gentoo.conf.example | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
index 1361a30..b78e5c6 100644
--- a/dracut.conf.d/gentoo.conf.example
+++ b/dracut.conf.d/gentoo.conf.example
@@ -1,7 +1,8 @@
 # /etc/dracut.conf.d/gentoo.conf
 # dracut config file customized for Gentoo Base System release 2
 
-udevdir=/lib/udev
+udevdir=
+udevaltdirs="/lib/udev /usr/lib/udev"
 ro_mnt=yes
 
 #
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] dracut-functions.sh: support for alternative udev dirs - udevaltdirs
@ 2013-01-23 18:37 Amadeusz Żołnowski
       [not found] ` <1358966239-19496-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Amadeusz Żołnowski @ 2013-01-23 18:37 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Amadeusz Żołnowski

It is required for Gentoo which moves udev from / to /usr and supports
both /lib/udev and /usr/lib/udev for compatibility with other packages.

Credits go to Alexander Tsoy <alexander-EP/B3+myoZc@public.gmane.org>.
---
 dracut-functions.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dracut-functions.sh b/dracut-functions.sh
index e23db76..812ea2b 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -941,6 +941,15 @@ inst_rules() {
     inst_dir "$_target"
     for _rule in "$@"; do
         if [ "${_rule#/}" = "$_rule" ]; then
+            for r in ${udevaltdirs}; do
+                [[ "$r" = "${udevdir}" ]] && continue
+                if [[ -f $r/rules.d/$_rule ]]; then
+                    _found="$r/rules.d/$_rule"
+                    inst_rule_programs "$_found"
+                    inst_rule_group_owner "$_found"
+                    inst_simple "$_found" "${udevdir}/rules.d/${_found##*/}"
+                fi
+            done
             for r in ${udevdir}/rules.d /etc/udev/rules.d; do
                 if [[ -f $r/$_rule ]]; then
                     _found="$r/$_rule"
-- 
1.8.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs
       [not found] ` <1358966239-19496-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
@ 2013-01-23 18:37   ` Amadeusz Żołnowski
       [not found]     ` <1358966239-19496-2-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Amadeusz Żołnowski @ 2013-01-23 18:37 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Amadeusz Żołnowski

To avoid need of rebuild after udev update/downgrade let udevdir= be set
dynamically with pkg-config.  Use udevaltdirs to search for rules both
in old and new locations.
---
 dracut.conf.d/gentoo.conf.example | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
index 1361a30..b78e5c6 100644
--- a/dracut.conf.d/gentoo.conf.example
+++ b/dracut.conf.d/gentoo.conf.example
@@ -1,7 +1,8 @@
 # /etc/dracut.conf.d/gentoo.conf
 # dracut config file customized for Gentoo Base System release 2
 
-udevdir=/lib/udev
+udevdir=
+udevaltdirs="/lib/udev /usr/lib/udev"
 ro_mnt=yes
 
 #
-- 
1.8.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs
       [not found]     ` <1358966239-19496-2-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
@ 2013-01-23 19:45       ` Colin Guthrie
  2013-01-27  9:38         ` Amadeusz Żołnowski
  0 siblings, 1 reply; 6+ messages in thread
From: Colin Guthrie @ 2013-01-23 19:45 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

'Twas brillig, and Amadeusz Żołnowski at 23/01/13 18:37 did gyre and gimble:
> To avoid need of rebuild after udev update/downgrade let udevdir= be set
> dynamically with pkg-config.  Use udevaltdirs to search for rules both
> in old and new locations.
> ---
>  dracut.conf.d/gentoo.conf.example | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
> index 1361a30..b78e5c6 100644
> --- a/dracut.conf.d/gentoo.conf.example
> +++ b/dracut.conf.d/gentoo.conf.example
> @@ -1,7 +1,8 @@
>  # /etc/dracut.conf.d/gentoo.conf
>  # dracut config file customized for Gentoo Base System release 2
>  
> -udevdir=/lib/udev
> +udevdir=
> +udevaltdirs="/lib/udev /usr/lib/udev"
>  ro_mnt=yes


FWIW, I carry a couple patches downstream for this too in Mageia.

Due to their transnational nature, I figured it wasn't something that
would be wanted upstream (it was only needed during a window when users
had updates some packages which moved their udev rules to /usr/lib
rather than /lib, but hadn't yet completed the usrmove (which isn't
wise/advisable/supported, but some users did it so I didn't want to
actively break initrd building, especially as this was a key part of
actually performing the usrmove ;))

Attached is the patch I use for this which is much the same but doesn't
require any specific config. It might not work in your case if /lib is
not a symlink to /usr/lib.

I wouldn't recommend this is committed as it is purely transitional as I
said.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

[-- Attachment #2: 0511-udev-rules-Pre-usrmove-systemd-installs-might-not-fi.patch --]
[-- Type: text/x-patch, Size: 2260 bytes --]

From a04eb301f3f1d64361886e13acc10f0d3b701c9e Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin-odJJhXpcy38dnm+yROfE0A@public.gmane.org>
Date: Thu, 16 Aug 2012 14:27:22 +0100
Subject: [PATCH 511/511] udev-rules: Pre usrmove systemd installs might not
 find system udev rules.

If users had switched to systemd-183+ but have not completed
the usrmove, the udevdir variable might not properly point to
where the system rules are really kept, so include another
path in the search there if needed.

If the user systemd has been half updated (e.g. some packages using the
new udev rules dir, but some olders ones not) before the usrmove is
completed then we want this patch. It's arguably one that is not needed
upstream however.
---
 dracut-functions.sh | 7 +++++--
 dracut.sh           | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dracut-functions.sh b/dracut-functions.sh
index e23db76..b28eff5 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -935,13 +935,16 @@ inst_rule_group_owner() {
 # udev rules always get installed in the same place, so
 # create a function to install them to make life simpler.
 inst_rules() {
-    local _target=/etc/udev/rules.d _rule _found
+    local _target=/etc/udev/rules.d _rule _found _extrapath=""
 
     inst_dir "${udevdir}/rules.d"
     inst_dir "$_target"
+    if [ "${udevdir}" = "/lib/udev" -a -d "/usr/lib/udev/rules.d" ]; then
+        _extrapath="/usr/lib/udev/rules.d"
+    fi
     for _rule in "$@"; do
         if [ "${_rule#/}" = "$_rule" ]; then
-            for r in ${udevdir}/rules.d /etc/udev/rules.d; do
+            for r in ${udevdir}/rules.d ${_extrapath} /etc/udev/rules.d; do
                 if [[ -f $r/$_rule ]]; then
                     _found="$r/$_rule"
                     inst_rule_programs "$_found"
diff --git a/dracut.sh b/dracut.sh
index 9941caa..c8b1676 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -812,8 +812,8 @@ done
 [[ -d $udevdir ]] \
     || udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
 if ! [[ -d "$udevdir" ]]; then
-    [[ -d /lib/udev ]] && udevdir=/lib/udev
     [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
+    [[ ! -L /lib ]] && [[ -d /lib/udev ]] && udevdir=/lib/udev
 fi
 
 [[ -d $systemdutildir ]] \
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs
  2013-01-23 19:45       ` Colin Guthrie
@ 2013-01-27  9:38         ` Amadeusz Żołnowski
  0 siblings, 0 replies; 6+ messages in thread
From: Amadeusz Żołnowski @ 2013-01-27  9:38 UTC (permalink / raw)
  To: Colin Guthrie; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

Quoting Colin Guthrie (2013-01-23 20:45:13)
> I wouldn't recommend this is committed as it is purely transitional as
> I said.

Why not support transitional scenarios, too?  Who knows if somebody is
not going to move udev around once again in the future?  This patch
isn't intrusive.


-- 
Amadeusz Żołnowski

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQEcBAABAgAGBQJRBPWtAAoJEPATRTHh2/q1sKYH/08pwRJtm4OhrwTu8x8mczkI
iBfqCFY40BD4VDaPUYUv6HRjibhM3lL6Q/Oc0r08P+ez6LnYfAQ8DImJXsL1uKjD
dpr1/YeDdINPd+InpAL3OsMlBxlAr4HllwHtENDbgSmur2tWIQk5cuGXxrMt+QJL
cXRsh7d0gfnFlB9s1N2a/ziyl7g0k4D4ttQMsw3OENBp+8EPRb2w6mOvgcOZo4z+
oYhEY0qD1zvmXb73MQJd0LoJiLzp/ioxghGBkAjIux33JAE/pLhQILx81r0gPOTy
S15W2ZG130v0kkbdeti50Jjru6fFmg08oA0IafpbyvX8z1hcfASYxe5oSPXJi4A=
=napQ
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-27  9:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23 18:37 [PATCH 1/2] dracut-functions.sh: support for alternative udev dirs - udevaltdirs Amadeusz Żołnowski
     [not found] ` <1358966239-19496-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2013-01-23 18:37   ` [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs Amadeusz Żołnowski
     [not found]     ` <1358966239-19496-2-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2013-01-23 19:45       ` Colin Guthrie
2013-01-27  9:38         ` Amadeusz Żołnowski
  -- strict thread matches above, loose matches on Subject: below --
2013-01-12 19:48 [PATCH 1/2] dracut-functions.sh: support for alternative udev dirs - udevaltdirs Amadeusz Żołnowski
     [not found] ` <1358020128-20693-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2013-01-12 19:48   ` [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs Amadeusz Żołnowski
2012-12-16 19:05 [PATCH 1/2] dracut-functions.sh: support for alternative udev dirs - udevaltdirs Amadeusz Żołnowski
     [not found] ` <1355684720-25274-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2012-12-16 19:05   ` [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and use udevaltdirs Amadeusz Żołnowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.