All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivailo Monev <xakepa10@gmail.com>
To: alsa-devel@alsa-project.org
Subject: Re: udev rules prefix
Date: Thu, 14 Nov 2013 13:24:49 +0000	[thread overview]
Message-ID: <5284CF21.6070105@gmail.com> (raw)
In-Reply-To: <s5hwqkb9v5i.wl%tiwai@suse.de>

On 11/14/13 09:42, Takashi Iwai wrote:
> At Thu, 14 Nov 2013 12:08:47 +0000,
> Ivailo Monev wrote:
>> On 11/14/13 02:48, David Henningsson wrote:
>>> On 11/13/2013 09:36 PM, Ivailo wrote:
>>>> Hello,
>>>>
>>>> the default prefix for alsa-utils is /usr however the udev rules directory
>>>> is /lib/udev/rules.d thus on setups with separate partition for /usr the
>>>> binaries, from /usr/bin and /usr/sbin, will likely not be available during
>>>> the boot process and the udev rule will fail to restore the state.
>>>>
>>>> I suggest that the udev rules directory follows the prefix or append /usr
>>>> to it to resolve this.
>>>>
>>>> Cheers!
>>> Hi,
>>>
>>> ALSA merely follows what udev dictates, so I think your
>>> question/suggestion is better redirected on the udev (now systemd)
>>> mailinglist. Or potentially that of your distro.
>>>
>> Actually, you are not following what udev dictates (unless I'm missing
>> something).
>> By default, systemd (and more importantly udev) will be installed with
>> /usr prefix
>> (which is wrong in it self because it blindly assumes that /usr has been
>> mounted
>> via initrd/initramfs where separate /usr partition is in use but let's
>> not talk about
>> this here).
>>
>>
>> On 11/14/13 06:45, Takashi Iwai wrote:
>>> At Wed, 13 Nov 2013 20:36:48 +0000,
>>> Ivailo wrote:
>>>> Hello,
>>>>
>>>> the default prefix for alsa-utils is /usr however the udev rules directory
>>>> is /lib/udev/rules.d thus on setups with separate partition for /usr the
>>>> binaries, from /usr/bin and /usr/sbin, will likely not be available during
>>>> the boot process and the udev rule will fail to restore the state.
>>> Not true.  /lib must be always present at boot even if /usr isn't
>>> mounted.  That's the reason why /lib/udev was chosen as default in the
>>> past.
>>>
>>>
>>> Takashi
>> You got me wrong, I know that /lib should be available on early boot
>> (unless it's a
>> symlink, like in Arch Linux) but the point is that since the alsa-utils
>> binaries are
>> installed in /usr so should be the udev rules otherwise during boot
>> without /usr
>> being mounted you will see error message about /usr/sbin/alsactl.
> Theoretically yes, but this has been rather less problems than
> creating a non-existing /usr/lib/udev in the past.  That's the very
> reason of hard-coded /lib/udev.  Changing the default behavior is
> often worse unless you really do it carefully with consideration of
> compatibility with old systems.
>
> So, if you want to change the default, don't hard code again.  Make
> configure to guess the right place.  A patch achieving it is welcome.
>
>
> Takashi
Ok, here is the patch:

 From 74faeceb26c4730d6150e726792f6eb1f257b03e Mon Sep 17 00:00:00 2001
From: Ivailo Monev <xakepa10@gmail.com>
Date: Thu, 14 Nov 2013 13:13:43 +0000
Subject: [PATCH 1/1] detect udevdir via pkg-config

---
  configure.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index 3ae3209..74b891e 100644
--- a/configure.in
+++ b/configure.in
@@ -121,7 +121,7 @@ AM_CONDITIONAL(USE_XMLTO, test x"$xmlto" = xyes)
  AC_ARG_WITH(
          [udev-rules-dir],
          AS_HELP_STRING([--with-udev-rules-dir],[Directory where to 
install udev rules to (defaults to /lib/udev/rules.d)]),
-        [udevrulesdir=$withval], [udevrulesdir="/lib/udev/rules.d"])
+        [udevrulesdir=$withval], [udevrulesdir=$($PKG_CONFIG udev 
--variable=udevdir)"/rules.d"])
  AC_SUBST(udevrulesdir)

  dnl Checks for header files.
-- 
1.8.3.4

However, since udev must reside on root (/) in the first place
the alsa-utils rules will still be installed in /lib/udev/rules.d. So
this patch will improve the current rules placement but will
not solve the separate /usr issue I'm talking about. I know
that hard coding paths is not a good idea in general but the
way I see it it's the best option and this patch should not be
used. I'm providing it just in case you don't agree with me on
using /usr/lib/udev/rules.d as default rules placement directory.

  reply	other threads:[~2013-11-14 10:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 20:36 udev rules prefix Ivailo
2013-11-14  2:48 ` David Henningsson
2013-11-14  6:45 ` Takashi Iwai
2013-11-14 12:08   ` Ivailo Monev
2013-11-14  9:42     ` Takashi Iwai
2013-11-14 13:24       ` Ivailo Monev [this message]
2013-11-14 10:51         ` Takashi Iwai
2013-11-14 18:49           ` Ivailo Monev
2013-11-14 16:14             ` Takashi Iwai
2013-11-15 13:16               ` Ivailo Monev
2013-11-15 10:29                 ` Takashi Iwai
2013-11-16 14:00                   ` Ivailo Monev
2013-11-17  9:07                     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5284CF21.6070105@gmail.com \
    --to=xakepa10@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.