Linux Hotplug development
 help / color / mirror / Atom feed
* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: William Hubbs @ 2012-06-05 17:56 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

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

Hi Bryan,

On Mon, Jun 04, 2012 at 08:10:28PM -0700, Bryan Kadzban wrote:
> If you want to try to get systemd-tmpfiles to work, and figure out which
> extra dependencies are needed (like, oh for instance, selinux or
> libcap), feel free; that patch shouldn't be too hard to apply on top of
> this one, if this gets committed.
 
 I spoke with Kay on irc, and he expressed doubts that it will be
 committed. However, I did get another suggestion from one of the guys
 there.

 Automake supports includes, so it would be good to break up Makefile.am
 into several modules. That way it would be easy to include them based
 on condissionals.

 I have started breaking things apart, but if you want, I can send you
 the patch as I have it so far and we can collaborate on it. :-)

 William


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

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: Bryan Kadzban @ 2012-06-06  3:45 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

William Hubbs wrote:
> I spoke with Kay on irc, and he expressed doubts that it will be 
> committed.

Not being terribly inclined to set up an IRC client, were there any
issues with the patch itself?  Or does he just not like the idea at all
for some reason?  (Er, Kay?  Maybe I should ask you directly.  :-) )

> However, I did get another suggestion from one of the guys there.
> 
> Automake supports includes, so it would be good to break up 
> Makefile.am into several modules. That way it would be easy to 
> include them based on condissionals.
> 
> I have started breaking things apart, but if you want, I can send you
> the patch as I have it so far and we can collaborate on it. :-)

Sure, we can start poking at it off-list.  Though I don't have more than
a few hours a day to put into it.  :-)

(That does sound like a lot less-invasive of a change, once the files
are split.)

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: Bruce Dubbs @ 2012-06-06  4:23 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

Bryan Kadzban wrote:
> William Hubbs wrote:
>> I spoke with Kay on irc, and he expressed doubts that it will be 
>> committed.
> 
> Not being terribly inclined to set up an IRC client, were there any
> issues with the patch itself?  Or does he just not like the idea at all
> for some reason?  (Er, Kay?  Maybe I should ask you directly.  :-) )
> 
>> However, I did get another suggestion from one of the guys there.
>>
>> Automake supports includes, so it would be good to break up 
>> Makefile.am into several modules. That way it would be easy to 
>> include them based on condissionals.
>>
>> I have started breaking things apart, but if you want, I can send you
>> the patch as I have it so far and we can collaborate on it. :-)

I'm interested in this too.  However, I'm not sure what you are 
referring to when you mention modules.  Do you mean the automake 
instruction 'include'?

The problem with udev as it's currently embedded in systemd is that the 
udev programs require several systemd .c utility programs, although they 
all build without the problematic libraries required by systemd 
(intltool, d-bus, etc).  These object files could be combined into each 
of the udev programs without problems, but I'm having a problem 
understanding the concept of what is acceptable.

AFAICT, there still needs to be a change to configure.ac to optionally 
avoid all the extras that systemd needs.  That seems to be where to 
start, but we need support from upstream to get these changes into the 
main distribution.

   -- Bruce

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: Dan Nicholson @ 2012-06-06 12:38 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

On Tue, Jun 5, 2012 at 10:56 AM, William Hubbs <w.d.hubbs@gmail.com> wrote:
> Hi Bryan,
>
> On Mon, Jun 04, 2012 at 08:10:28PM -0700, Bryan Kadzban wrote:
>> If you want to try to get systemd-tmpfiles to work, and figure out which
>> extra dependencies are needed (like, oh for instance, selinux or
>> libcap), feel free; that patch shouldn't be too hard to apply on top of
>> this one, if this gets committed.
>
>  I spoke with Kay on irc, and he expressed doubts that it will be
>  committed. However, I did get another suggestion from one of the guys
>  there.
>
>  Automake supports includes, so it would be good to break up Makefile.am
>  into several modules. That way it would be easy to include them based
>  on condissionals.

Breaking up the Makefile.am into several files is probably cleaner,
but it doesn't actually change the problem you're trying to solve
here. You still have to wrap large parts of the build in
AM_CONDITIONALs. That doesn't change whether it's in one file or many.
The include happens at automake time, not build time, so conditionally
including the file won't do anything different for you. Everything
will get merge into the toplevel Makefile.in.

--
Dan

^ permalink raw reply

* timing of *.service start-up
From: Allin Cottrell @ 2012-06-06 14:22 UTC (permalink / raw)
  To: linux-hotplug

Using systemd-185 (kmod 8, kernel 3.3.7) I'm noticing that a 
few of my services are failing (sometimes, not perfectly 
predictably) at boot time. When the failures occur, a manual 
invocation of "systemctl restart <whatever>" always works fine 
to get the services going. So it seems there are some 
timing/race problems and I'd much appreciate any help with 
diagnosing them.

Take thinkfan for example. My unit
/etc/systemd/system/thinkfan.service looks like this:

[Unit]
Description=Thinkfan fan controller

[Service]
ExecStart=/usr/sbin/thinkfan -q -n -z

[Install]
WantedBy=multi-user.target

Sometimes thinkfan starts fine, but other times I'm seeing 
this sort of thing (extracted via journalctl):

systemd[1]: systemd 185 running in system mode.
udevd[60]: starting version 185
thinkfan[153]: thinkfan 0.7.3 starting...
thinkfan[153]: /sys/class/hwmon/hwmon2/device/pwm1_enable: \
  No such file or directory
systemd[1]: thinkfan.service: main process exited, \
  code=exited, status%4
systemd[1]: Unit thinkfan.service entered failed state.

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC


^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: William Hubbs @ 2012-06-06 16:52 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

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

On Tue, Jun 05, 2012 at 11:23:47PM -0500, Bruce Dubbs wrote:
> Bryan Kadzban wrote:
> > William Hubbs wrote:
> >> I spoke with Kay on irc, and he expressed doubts that it will be 
> >> committed.
> > 
> > Not being terribly inclined to set up an IRC client, were there any
> > issues with the patch itself?  Or does he just not like the idea at all
> > for some reason?  (Er, Kay?  Maybe I should ask you directly.  :-) )
> > 
> >> However, I did get another suggestion from one of the guys there.
> >>
> >> Automake supports includes, so it would be good to break up 
> >> Makefile.am into several modules. That way it would be easy to 
> >> include them based on condissionals.
> >>
> >> I have started breaking things apart, but if you want, I can send you
> >> the patch as I have it so far and we can collaborate on it. :-)
> 
> I'm interested in this too.  However, I'm not sure what you are 
> referring to when you mention modules.  Do you mean the automake 
> instruction 'include'?

Yes, that's correct. I am thinking we can break up the makefile using
includes then include them based on configure switches.

> AFAICT, there still needs to be a change to configure.ac to optionally 
> avoid all the extras that systemd needs.  That seems to be where to 
> start, but we need support from upstream to get these changes into the 
> main distribution.

Yes, there will also be changes to configure.ac as well to make this
work.

My thought is to make the makefile use includes as the first stage of
this then work on the changes to configure.ac.

William


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

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: William Hubbs @ 2012-06-06 17:15 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

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

On Wed, Jun 06, 2012 at 05:38:29AM -0700, Dan Nicholson wrote:
> Breaking up the Makefile.am into several files is probably cleaner,
> but it doesn't actually change the problem you're trying to solve
> here. You still have to wrap large parts of the build in
> AM_CONDITIONALs. That doesn't change whether it's in one file or many.
> The include happens at automake time, not build time, so conditionally
> including the file won't do anything different for you. Everything
> will get merge into the toplevel Makefile.in.

If the am_condissionals are controlled by configure switches, we can set
things up so that the packager or user who is building udev or systemd
has control over what gets built. If they want to build udev only, or
systemd, or just the tools in the distribution that don't require
systemd, they will be able to.

This is where I want to go once we have the Makefile broken up. This
will also require some work in configure.ac, but I think it will be
worth that because it will give packagers the flexability to build what
they want.

include Makefile-shared.am
if ENABLE_UDEV
include Makefile-udev.am
endif
if ENABLE_TOOLS
include Makefile-tools.am
endif
if ENABLE_SYSTEMD
include Makefile-systemd.am
endif

The first stage of this will be breaking up Makefile.am and using
includes without condissionals. Once everything builds cleanly in that
setup, we can  do the work in configure.ac and add condissionals to
Makefile.am.

William


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

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: Bruce Dubbs @ 2012-06-06 18:51 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

William Hubbs wrote:

> This is where I want to go once we have the Makefile broken up. This
> will also require some work in configure.ac, but I think it will be
> worth that because it will give packagers the flexability to build what
> they want.
> 
> include Makefile-shared.am
> if ENABLE_UDEV
> include Makefile-udev.am
> endif
> if ENABLE_TOOLS
> include Makefile-tools.am
> endif
> if ENABLE_SYSTEMD
> include Makefile-systemd.am
> endif

With this type of setup, ENABLE_SYSTEMD must imply ENABLE_TOOLS and 
ENABLE_UDEV.

> The first stage of this will be breaking up Makefile.am and using
> includes without condissionals. Once everything builds cleanly in that
> setup, we can  do the work in configure.ac and add condissionals to
> Makefile.am.

The first thing that will have to be done is to break up 
libsystemd_shared_la_SOURCES in Makefile.am.  That definition combines 
files incompatible with udev-only with files required by udev.  udev needs:

log
label
mkdir
cgroup-util
strv
path-util
conf-files
hashmap
set
exit-status
util
dev-setup

but does not need:

cgroup-show
conf-parser
hwclock
pager
ratelimit
socket-util
spawn-ask-password-agent
spawn-polkit-agent
specifier
utf8
virt
watchdog

Basically all of the above are combined into libsystemd-core.la and that 
needs to be split into two.  I'd just split the first group into 
libudev-core.la.

To link, udev also needs the file in libsystemd_daemon_la_SOURCES 
(sd-daumon) for udevd, but that probably could be removed with some 
appropriate ifdefs in udevd.c.

   -- Bruce

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: William Hubbs @ 2012-06-06 22:53 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

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

On Wed, Jun 06, 2012 at 01:51:05PM -0500, Bruce Dubbs wrote:
> William Hubbs wrote:
> 
> With this type of setup, ENABLE_SYSTEMD must imply ENABLE_TOOLS and 
> ENABLE_UDEV.

What I want is for all of the enable_* options to be true by default so
that we don't affect the result of the build unless a packager requests
it by disabling portions.

My goal for the tools option is to find the things in the distribution
that can be useful whether or not your distro is using systemd and set
up so you can build those separately from systemd and udev if you aren't
quite ready to make the jump to systemd.

> The first thing that will have to be done is to break up 
> libsystemd_shared_la_SOURCES in Makefile.am.  That definition combines 
> files incompatible with udev-only with files required by udev.  udev needs:
> 
> log
> label
> mkdir
> cgroup-util
> strv
> path-util
> conf-files
> hashmap
> set
> exit-status
> util
> dev-setup
> 
> but does not need:
> 
> cgroup-show
> conf-parser
> hwclock
> pager
> ratelimit
> socket-util
> spawn-ask-password-agent
> spawn-polkit-agent
> specifier
> utf8
> virt
> watchdog
> 
> Basically all of the above are combined into libsystemd-core.la and that 
> needs to be split into two.  I'd just split the first group into 
> libudev-core.la.

I'm confused here because you first refer to
libsystemd_shared_la_SOURCES then libsystemd_core.la. What about
libsystemd_shared.la? Also, there is already a libudev-core.la. I will
look at it and see what it includes.

> 
> To link, udev also needs the file in libsystemd_daemon_la_SOURCES 
> (sd-daumon) for udevd, but that probably could be removed with some 
> appropriate ifdefs in udevd.c.

I'''m not seeing where udev needs this off the top of my head. Actually
I just ran "git grep -i sd.daumon" on the tree and that turns up
nothing.


 Thanks,

 William


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

^ permalink raw reply

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
From: Dan Nicholson @ 2012-06-07 13:34 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FC9B938.6020608@kadzban.is-a-geek.net>

On Wed, Jun 6, 2012 at 10:15 AM, William Hubbs <w.d.hubbs@gmail.com> wrote:
> On Wed, Jun 06, 2012 at 05:38:29AM -0700, Dan Nicholson wrote:
>> Breaking up the Makefile.am into several files is probably cleaner,
>> but it doesn't actually change the problem you're trying to solve
>> here. You still have to wrap large parts of the build in
>> AM_CONDITIONALs. That doesn't change whether it's in one file or many.
>> The include happens at automake time, not build time, so conditionally
>> including the file won't do anything different for you. Everything
>> will get merge into the toplevel Makefile.in.
>
> If the am_condissionals are controlled by configure switches, we can set
> things up so that the packager or user who is building udev or systemd
> has control over what gets built. If they want to build udev only, or
> systemd, or just the tools in the distribution that don't require
> systemd, they will be able to.
>
> This is where I want to go once we have the Makefile broken up. This
> will also require some work in configure.ac, but I think it will be
> worth that because it will give packagers the flexability to build what
> they want.
>
> include Makefile-shared.am
> if ENABLE_UDEV
> include Makefile-udev.am
> endif
> if ENABLE_TOOLS
> include Makefile-tools.am
> endif
> if ENABLE_SYSTEMD
> include Makefile-systemd.am
> endif
>
> The first stage of this will be breaking up Makefile.am and using
> includes without condissionals. Once everything builds cleanly in that
> setup, we can  do the work in configure.ac and add condissionals to
> Makefile.am.

What do you know, that works. I had thought automake didn't support
that, but it works nicely. The one thing I was trying to do when I was
starting this patch was keep dist working regardless of your configure
flags. Usually that just mean leaving EXTRA_DIST out of the
conditionals. That's painful, though, and you can probably just bring
out a big hammer during dist. I have something like this in
pkg-config:

if !ENABLE_SYSTEMD
dist-hook:
        @echo "error: you need to enable systemd for dist"
        @exit 1
endif

--
Dan

^ permalink raw reply

* [PATCH] Always populate EXTRA_DIST
From: Bryan Kadzban @ 2012-06-08  6:03 UTC (permalink / raw)
  To: linux-hotplug

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

"make dist" can build a different tarball depending on the flags passed
to ./configure and the (optional) dependencies found on the system.
Move all append-to-EXTRA_DIST operations out of automake conditionals to
fix this.

Introduce a polkitpolicy_files so that the policy files built still
correctly depend on the automake conditionals, but the .in files that
get distributed do not.

Signed-Off-By: Bryan Kadzban <bryan.kadzban.is-a-geek.net>

[-- Attachment #2: systemd-always-populate-extra_dist.patch --]
[-- Type: text/plain, Size: 8335 bytes --]

diff --git a/Makefile.am b/Makefile.am
index f45fa27..6991391 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1714,9 +1714,6 @@ lib_LTLIBRARIES += libgudev-1.0.la
 pkgconfiglib_DATA += \
 	src/gudev/gudev-1.0.pc
 
-EXTRA_DIST += \
-	src/gudev/gudev-1.0.pc.in
-
 CLEANFILES += \
 	src/gudev/gudev-1.0.pc
 
@@ -1767,14 +1764,6 @@ libgudev_1_0_la_LDFLAGS = \
 	-export-dynamic -no-undefined \
 	-export-symbols-regex '^g_udev_.*'
 
-EXTRA_DIST += \
-	src/gudev/gudevmarshal.list \
-	src/gudev/gudevenumtypes.h.template \
-	src/gudev/gudevenumtypes.c.template \
-	src/gudev/gjs-example.js \
-	src/gudev/seed-example-enum.js \
-	src/gudev/seed-example.js
-
 CLEANFILES += \
 	$(nodist_libgudev_1_0_la_SOURCES)
 
@@ -1858,6 +1847,15 @@ INSTALL_EXEC_HOOKS += libgudev-install-move-hook
 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
 endif
 
+EXTRA_DIST += \
+	src/gudev/gudev-1.0.pc.in \
+	src/gudev/gudevmarshal.list \
+	src/gudev/gudevenumtypes.h.template \
+	src/gudev/gudevenumtypes.c.template \
+	src/gudev/gjs-example.js \
+	src/gudev/seed-example-enum.js \
+	src/gudev/seed-example.js
+
 # ------------------------------------------------------------------------------
 if ENABLE_KEYMAP
 keymap_SOURCES = \
@@ -1893,10 +1891,6 @@ dist_udevhome_SCRIPTS = \
 TESTS += \
 	src/udev/keymap/check-keymaps.sh
 
-EXTRA_DIST += \
-	src/udev/keymap/check-keymaps.sh \
-	src/udev/keymap/keyboard-force-release.sh.in
-
 CLEANFILES += \
 	$(nodist_keymap_SOURCES) \
 	src/udev/keymap/keys.txt \
@@ -1987,6 +1981,10 @@ src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
 	$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
 endif
 
+EXTRA_DIST += \
+	src/udev/keymap/check-keymaps.sh \
+	src/udev/keymap/keyboard-force-release.sh.in
+
 # ------------------------------------------------------------------------------
 mtd_probe_SOURCES =  \
 	src/udev/mtd_probe/mtd_probe.c \
@@ -2288,13 +2286,13 @@ rootlibexec_PROGRAMS += \
 sysctl_DATA = \
 	sysctl.d/coredump.conf
 
-EXTRA_DIST += \
-	sysctl.d/coredump.conf.in
-
 CLEANFILES += \
 	sysctl.d/coredump.conf
 endif
 
+EXTRA_DIST += \
+	sysctl.d/coredump.conf.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_BINFMT
 systemd_binfmt_SOURCES = \
@@ -2335,10 +2333,10 @@ MANPAGES_ALIAS +=  \
 	man/systemd-binfmt.8
 
 man/systemd-binfmt.8: man/systemd-binfmt.service.8
+endif
 
 EXTRA_DIST += \
 	units/systemd-binfmt.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_VCONSOLE
@@ -2366,10 +2364,10 @@ INSTALL_DATA_HOOKS += \
 
 MANPAGES += \
 	man/vconsole.conf.5
+endif
 
 EXTRA_DIST += \
 	units/systemd-vconsole-setup.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_READAHEAD
@@ -2416,16 +2414,16 @@ nodist_systemunit_DATA += \
 	units/systemd-readahead-replay.service \
 	units/systemd-readahead-done.service
 
-EXTRA_DIST += \
-	units/systemd-readahead-collect.service.in \
-	units/systemd-readahead-replay.service.in \
-	units/systemd-readahead-done.service.in
-
 MANPAGES += \
 	man/sd_readahead.3 \
 	man/sd-readahead.7
 endif
 
+EXTRA_DIST += \
+	units/systemd-readahead-collect.service.in \
+	units/systemd-readahead-replay.service.in \
+	units/systemd-readahead-done.service.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_QUOTACHECK
 rootlibexec_PROGRAMS += \
@@ -2434,9 +2432,6 @@ rootlibexec_PROGRAMS += \
 nodist_systemunit_DATA += \
 	units/quotacheck.service
 
-EXTRA_DIST += \
-	units/quotacheck.service.in
-
 systemd_quotacheck_SOURCES = \
 	src/quotacheck/quotacheck.c
 
@@ -2444,6 +2439,9 @@ systemd_quotacheck_LDADD = \
 	libsystemd-shared.la
 endif
 
+EXTRA_DIST += \
+	units/quotacheck.service.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_RANDOMSEED
 rootlibexec_PROGRAMS += \
@@ -2453,10 +2451,6 @@ nodist_systemunit_DATA += \
 	units/systemd-random-seed-save.service \
 	units/systemd-random-seed-load.service
 
-EXTRA_DIST += \
-	units/systemd-random-seed-save.service.in \
-	units/systemd-random-seed-load.service.in
-
 systemd_random_seed_SOURCES = \
 	src/random-seed/random-seed.c
 
@@ -2479,6 +2473,10 @@ INSTALL_DATA_HOOKS += \
 	randomseed-install-data-hook
 endif
 
+EXTRA_DIST += \
+	units/systemd-random-seed-save.service.in \
+	units/systemd-random-seed-load.service.in
+
 # ------------------------------------------------------------------------------
 if HAVE_LIBCRYPTSETUP
 rootlibexec_PROGRAMS += \
@@ -2547,8 +2545,8 @@ dist_dbuspolicy_DATA += \
 dist_dbussystemservice_DATA += \
 	src/hostname/org.freedesktop.hostname1.service
 
-polkitpolicy_in_files += \
-	src/hostname/org.freedesktop.hostname1.policy.in
+polkitpolicy_files += \
+	src/hostname/org.freedesktop.hostname1.policy
 
 dbusinterface_DATA += \
 	org.freedesktop.hostname1.xml
@@ -2565,10 +2563,13 @@ hostnamed-install-data-hook:
 
 INSTALL_DATA_HOOKS += \
 	hostnamed-install-data-hook
+endif
+
+polkitpolicy_in_files += \
+	src/hostname/org.freedesktop.hostname1.policy.in
 
 EXTRA_DIST += \
 	units/systemd-hostnamed.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOCALED
@@ -2597,8 +2598,8 @@ dist_dbuspolicy_DATA += \
 dist_dbussystemservice_DATA += \
 	src/locale/org.freedesktop.locale1.service
 
-polkitpolicy_in_files += \
-	src/locale/org.freedesktop.locale1.policy.in
+polkitpolicy_files += \
+	src/locale/org.freedesktop.locale1.policy
 
 dbusinterface_DATA += \
 	org.freedesktop.locale1.xml
@@ -2616,9 +2617,6 @@ localed-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	localed-install-data-hook
 
-EXTRA_DIST += \
-	units/systemd-localed.service.in
-
 dist_pkgdata_DATA = \
 	src/locale/kbd-model-map
 
@@ -2630,6 +2628,12 @@ update-kbd-model-map:
 
 endif
 
+polkitpolicy_in_files += \
+	src/locale/org.freedesktop.locale1.policy.in
+
+EXTRA_DIST += \
+	units/systemd-localed.service.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_TIMEDATED
 systemd_timedated_SOURCES = \
@@ -2656,8 +2660,8 @@ dist_dbuspolicy_DATA += \
 nodist_systemunit_DATA += \
 	units/systemd-timedated.service
 
-polkitpolicy_in_files += \
-	src/timedate/org.freedesktop.timedate1.policy.in
+polkitpolicy_files += \
+	src/timedate/org.freedesktop.timedate1.policy
 
 org.freedesktop.timedate1.xml: systemd-timedated
 	$(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.timedate1 $< $@.tmp && \
@@ -2674,10 +2678,13 @@ timedated-install-data-hook:
 
 INSTALL_DATA_HOOKS += \
 	timedated-install-data-hook
+endif
+
+polkitpolicy_in_files += \
+	src/timedate/org.freedesktop.timedate1.policy.in
 
 EXTRA_DIST += \
 	units/systemd-timedated.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOGIND
@@ -2873,8 +2880,8 @@ lib_LTLIBRARIES += \
 pkgconfiglib_DATA += \
 	src/login/libsystemd-login.pc
 
-polkitpolicy_in_files += \
-	src/login/org.freedesktop.login1.policy.in
+polkitpolicy_files += \
+	src/login/org.freedesktop.login1.policy
 
 logind-install-data-hook:
 	$(MKDIR_P) -m 0755 \
@@ -2963,6 +2970,15 @@ man/sd_seat_can_multi_session.3: man/sd_seat_get_active.3
 man/sd_get_sessions.3: man/sd_get_seats.3
 man/sd_get_uids.3: man/sd_get_seats.3
 
+CLEANFILES += \
+	src/login/logind-gperf.c \
+	src/login/71-seat.rules \
+	src/login/73-seat-late.rules
+endif
+
+polkitpolicy_in_files += \
+	src/login/org.freedesktop.login1.policy.in
+
 EXTRA_DIST += \
 	src/login/logind-gperf.gperf \
 	src/login/libsystemd-login.pc.in \
@@ -2972,11 +2988,6 @@ EXTRA_DIST += \
 	units/systemd-logind.service.in \
 	units/systemd-user-sessions.service.in
 
-CLEANFILES += \
-	src/login/logind-gperf.c \
-	src/login/71-seat.rules \
-	src/login/73-seat-late.rules
-endif
 # ------------------------------------------------------------------------------
 
 SED_PROCESS = \
@@ -3050,7 +3061,7 @@ units/user/%: units/%.m4 Makefile
 	$(M4_PROCESS_USER)
 
 nodist_polkitpolicy_DATA = \
-	$(polkitpolicy_in_files:.policy.in=.policy) \
+	$(polkitpolicy_files) \
 	$(polkitpolicy_in_in_files:.policy.in.in=.policy)
 
 EXTRA_DIST += \

^ permalink raw reply related

* Re: [PATCH] Always populate EXTRA_DIST
From: Bryan Kadzban @ 2012-06-08  6:24 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FD195C7.6010808@kadzban.is-a-geek.net>

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

Bryan Kadzban wrote:
> "make dist" can build a different tarball depending on the flags passed
> to ./configure and the (optional) dependencies found on the system.
> Move all append-to-EXTRA_DIST operations out of automake conditionals to
> fix this.
> 
> Introduce a polkitpolicy_files so that the policy files built still
> correctly depend on the automake conditionals, but the .in files that
> get distributed do not.
> 
> Signed-Off-By: Bryan Kadzban <bryan.kadzban.is-a-geek.net>

Arg, always compile-check.  Tested, this time.

v2, fixing warnings about polkitpolicy_files not being defined.

[-- Attachment #2: systemd-always-populate-extra_dist.patch --]
[-- Type: text/plain, Size: 8523 bytes --]

diff --git a/Makefile.am b/Makefile.am
index f45fa27..0d39f88 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -91,6 +91,7 @@ lib_LTLIBRARIES =
 include_HEADERS =
 pkgconfiglib_DATA =
 polkitpolicy_in_files =
+polkitpolicy_files =
 dist_udevrules_DATA =
 nodist_udevrules_DATA =
 dist_man_MANS =
@@ -1714,9 +1715,6 @@ lib_LTLIBRARIES += libgudev-1.0.la
 pkgconfiglib_DATA += \
 	src/gudev/gudev-1.0.pc
 
-EXTRA_DIST += \
-	src/gudev/gudev-1.0.pc.in
-
 CLEANFILES += \
 	src/gudev/gudev-1.0.pc
 
@@ -1767,14 +1765,6 @@ libgudev_1_0_la_LDFLAGS = \
 	-export-dynamic -no-undefined \
 	-export-symbols-regex '^g_udev_.*'
 
-EXTRA_DIST += \
-	src/gudev/gudevmarshal.list \
-	src/gudev/gudevenumtypes.h.template \
-	src/gudev/gudevenumtypes.c.template \
-	src/gudev/gjs-example.js \
-	src/gudev/seed-example-enum.js \
-	src/gudev/seed-example.js
-
 CLEANFILES += \
 	$(nodist_libgudev_1_0_la_SOURCES)
 
@@ -1858,6 +1848,15 @@ INSTALL_EXEC_HOOKS += libgudev-install-move-hook
 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
 endif
 
+EXTRA_DIST += \
+	src/gudev/gudev-1.0.pc.in \
+	src/gudev/gudevmarshal.list \
+	src/gudev/gudevenumtypes.h.template \
+	src/gudev/gudevenumtypes.c.template \
+	src/gudev/gjs-example.js \
+	src/gudev/seed-example-enum.js \
+	src/gudev/seed-example.js
+
 # ------------------------------------------------------------------------------
 if ENABLE_KEYMAP
 keymap_SOURCES = \
@@ -1893,10 +1892,6 @@ dist_udevhome_SCRIPTS = \
 TESTS += \
 	src/udev/keymap/check-keymaps.sh
 
-EXTRA_DIST += \
-	src/udev/keymap/check-keymaps.sh \
-	src/udev/keymap/keyboard-force-release.sh.in
-
 CLEANFILES += \
 	$(nodist_keymap_SOURCES) \
 	src/udev/keymap/keys.txt \
@@ -1987,6 +1982,10 @@ src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
 	$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
 endif
 
+EXTRA_DIST += \
+	src/udev/keymap/check-keymaps.sh \
+	src/udev/keymap/keyboard-force-release.sh.in
+
 # ------------------------------------------------------------------------------
 mtd_probe_SOURCES =  \
 	src/udev/mtd_probe/mtd_probe.c \
@@ -2288,13 +2287,13 @@ rootlibexec_PROGRAMS += \
 sysctl_DATA = \
 	sysctl.d/coredump.conf
 
-EXTRA_DIST += \
-	sysctl.d/coredump.conf.in
-
 CLEANFILES += \
 	sysctl.d/coredump.conf
 endif
 
+EXTRA_DIST += \
+	sysctl.d/coredump.conf.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_BINFMT
 systemd_binfmt_SOURCES = \
@@ -2335,10 +2334,10 @@ MANPAGES_ALIAS +=  \
 	man/systemd-binfmt.8
 
 man/systemd-binfmt.8: man/systemd-binfmt.service.8
+endif
 
 EXTRA_DIST += \
 	units/systemd-binfmt.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_VCONSOLE
@@ -2366,10 +2365,10 @@ INSTALL_DATA_HOOKS += \
 
 MANPAGES += \
 	man/vconsole.conf.5
+endif
 
 EXTRA_DIST += \
 	units/systemd-vconsole-setup.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_READAHEAD
@@ -2416,16 +2415,16 @@ nodist_systemunit_DATA += \
 	units/systemd-readahead-replay.service \
 	units/systemd-readahead-done.service
 
-EXTRA_DIST += \
-	units/systemd-readahead-collect.service.in \
-	units/systemd-readahead-replay.service.in \
-	units/systemd-readahead-done.service.in
-
 MANPAGES += \
 	man/sd_readahead.3 \
 	man/sd-readahead.7
 endif
 
+EXTRA_DIST += \
+	units/systemd-readahead-collect.service.in \
+	units/systemd-readahead-replay.service.in \
+	units/systemd-readahead-done.service.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_QUOTACHECK
 rootlibexec_PROGRAMS += \
@@ -2434,9 +2433,6 @@ rootlibexec_PROGRAMS += \
 nodist_systemunit_DATA += \
 	units/quotacheck.service
 
-EXTRA_DIST += \
-	units/quotacheck.service.in
-
 systemd_quotacheck_SOURCES = \
 	src/quotacheck/quotacheck.c
 
@@ -2444,6 +2440,9 @@ systemd_quotacheck_LDADD = \
 	libsystemd-shared.la
 endif
 
+EXTRA_DIST += \
+	units/quotacheck.service.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_RANDOMSEED
 rootlibexec_PROGRAMS += \
@@ -2453,10 +2452,6 @@ nodist_systemunit_DATA += \
 	units/systemd-random-seed-save.service \
 	units/systemd-random-seed-load.service
 
-EXTRA_DIST += \
-	units/systemd-random-seed-save.service.in \
-	units/systemd-random-seed-load.service.in
-
 systemd_random_seed_SOURCES = \
 	src/random-seed/random-seed.c
 
@@ -2479,6 +2474,10 @@ INSTALL_DATA_HOOKS += \
 	randomseed-install-data-hook
 endif
 
+EXTRA_DIST += \
+	units/systemd-random-seed-save.service.in \
+	units/systemd-random-seed-load.service.in
+
 # ------------------------------------------------------------------------------
 if HAVE_LIBCRYPTSETUP
 rootlibexec_PROGRAMS += \
@@ -2547,8 +2546,8 @@ dist_dbuspolicy_DATA += \
 dist_dbussystemservice_DATA += \
 	src/hostname/org.freedesktop.hostname1.service
 
-polkitpolicy_in_files += \
-	src/hostname/org.freedesktop.hostname1.policy.in
+polkitpolicy_files += \
+	src/hostname/org.freedesktop.hostname1.policy
 
 dbusinterface_DATA += \
 	org.freedesktop.hostname1.xml
@@ -2565,10 +2564,13 @@ hostnamed-install-data-hook:
 
 INSTALL_DATA_HOOKS += \
 	hostnamed-install-data-hook
+endif
+
+polkitpolicy_in_files += \
+	src/hostname/org.freedesktop.hostname1.policy.in
 
 EXTRA_DIST += \
 	units/systemd-hostnamed.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOCALED
@@ -2597,8 +2599,8 @@ dist_dbuspolicy_DATA += \
 dist_dbussystemservice_DATA += \
 	src/locale/org.freedesktop.locale1.service
 
-polkitpolicy_in_files += \
-	src/locale/org.freedesktop.locale1.policy.in
+polkitpolicy_files += \
+	src/locale/org.freedesktop.locale1.policy
 
 dbusinterface_DATA += \
 	org.freedesktop.locale1.xml
@@ -2616,9 +2618,6 @@ localed-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	localed-install-data-hook
 
-EXTRA_DIST += \
-	units/systemd-localed.service.in
-
 dist_pkgdata_DATA = \
 	src/locale/kbd-model-map
 
@@ -2630,6 +2629,12 @@ update-kbd-model-map:
 
 endif
 
+polkitpolicy_in_files += \
+	src/locale/org.freedesktop.locale1.policy.in
+
+EXTRA_DIST += \
+	units/systemd-localed.service.in
+
 # ------------------------------------------------------------------------------
 if ENABLE_TIMEDATED
 systemd_timedated_SOURCES = \
@@ -2656,8 +2661,8 @@ dist_dbuspolicy_DATA += \
 nodist_systemunit_DATA += \
 	units/systemd-timedated.service
 
-polkitpolicy_in_files += \
-	src/timedate/org.freedesktop.timedate1.policy.in
+polkitpolicy_files += \
+	src/timedate/org.freedesktop.timedate1.policy
 
 org.freedesktop.timedate1.xml: systemd-timedated
 	$(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.timedate1 $< $@.tmp && \
@@ -2674,10 +2679,13 @@ timedated-install-data-hook:
 
 INSTALL_DATA_HOOKS += \
 	timedated-install-data-hook
+endif
+
+polkitpolicy_in_files += \
+	src/timedate/org.freedesktop.timedate1.policy.in
 
 EXTRA_DIST += \
 	units/systemd-timedated.service.in
-endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOGIND
@@ -2873,8 +2881,8 @@ lib_LTLIBRARIES += \
 pkgconfiglib_DATA += \
 	src/login/libsystemd-login.pc
 
-polkitpolicy_in_files += \
-	src/login/org.freedesktop.login1.policy.in
+polkitpolicy_files += \
+	src/login/org.freedesktop.login1.policy
 
 logind-install-data-hook:
 	$(MKDIR_P) -m 0755 \
@@ -2963,6 +2971,15 @@ man/sd_seat_can_multi_session.3: man/sd_seat_get_active.3
 man/sd_get_sessions.3: man/sd_get_seats.3
 man/sd_get_uids.3: man/sd_get_seats.3
 
+CLEANFILES += \
+	src/login/logind-gperf.c \
+	src/login/71-seat.rules \
+	src/login/73-seat-late.rules
+endif
+
+polkitpolicy_in_files += \
+	src/login/org.freedesktop.login1.policy.in
+
 EXTRA_DIST += \
 	src/login/logind-gperf.gperf \
 	src/login/libsystemd-login.pc.in \
@@ -2972,11 +2989,6 @@ EXTRA_DIST += \
 	units/systemd-logind.service.in \
 	units/systemd-user-sessions.service.in
 
-CLEANFILES += \
-	src/login/logind-gperf.c \
-	src/login/71-seat.rules \
-	src/login/73-seat-late.rules
-endif
 # ------------------------------------------------------------------------------
 
 SED_PROCESS = \
@@ -3050,7 +3062,7 @@ units/user/%: units/%.m4 Makefile
 	$(M4_PROCESS_USER)
 
 nodist_polkitpolicy_DATA = \
-	$(polkitpolicy_in_files:.policy.in=.policy) \
+	$(polkitpolicy_files) \
 	$(polkitpolicy_in_in_files:.policy.in.in=.policy)
 
 EXTRA_DIST += \

^ permalink raw reply related

* [PATCH] Allow configuring without systemd-only dependencies
From: Bryan Kadzban @ 2012-06-08  6:35 UTC (permalink / raw)
  To: linux-hotplug

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

Some dependencies (intltool, m4, dbus, pkg-config, PAM) are only
required or useful for systemd, not for udev.  Leave these required by
default, but allow them to be made optional if the right flag is used to
./configure.

Signed-Off-By: Bryan Kadzban <bryan@kadzban.is-a-geek.net>

-----

This is necessary for anyone who wants to build udev only.  It's not
sufficient, but without this or something like it, ./configure fails
hard.  This change touches *only* configure; if the dependencies are
made optional in a ./configure run, and they don't exist on the system
(or in some cases, even if they do) make will fail hard.

I'm not attached to the --with-X flag's name; coming up with a better
one would be fine.

Unfortunately there's no "use intltool if it's present, otherwise don't
bother" variant of IT_PROG_INTLTOOL.  If that's wanted, I could hack it
together with another invocation of AC_PATH_PROG, but this is slightly
simpler.

[-- Attachment #2: systemd-make-systemd-dependencies-optional.patch --]
[-- Type: text/plain, Size: 4453 bytes --]

diff --git a/configure.ac b/configure.ac
index 70f3e96..446fb95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,15 @@ AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
 LT_PREREQ(2.2)
 LT_INIT
 
+AC_ARG_WITH([require-systemd-deps],
+            [AS_HELP_STRING([--without-require-systemd-deps],
+                            [make systemd configure dependencies optional @<:@default: required@:>@])],
+            [with_require_systemd_deps=$withval], [with_require_systemd_deps=yes])
+
 # i18n stuff for the PolicyKit policy files
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
 IT_PROG_INTLTOOL([0.40.0])
+])
 
 GETTEXT_PACKAGE=systemd
 AC_SUBST(GETTEXT_PACKAGE)
@@ -61,7 +68,9 @@ AC_PROG_CC_C99
 AM_PROG_CC_C_O
 AC_PROG_GCC_TRADITIONAL
 
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
 AC_PATH_PROG([M4], [m4])
+])
 
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
 m4_ifdef([GTK_DOC_CHECK], [
@@ -75,7 +84,7 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
 AC_CHECK_TOOL(OBJCOPY, objcopy)
 AC_CHECK_TOOL(STRINGS, strings)
 AC_CHECK_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
+if test -z "$GPERF" && test "x$with_require_systemd_deps" = "xyes" ; then
         AC_MSG_ERROR([*** gperf not found])
 fi
 
@@ -132,6 +141,7 @@ AC_SUBST([GCLDFLAGS], $with_ldflags)
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
 
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
 save_LIBS="$LIBS"
 LIBS=
 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
@@ -139,11 +149,14 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
 CAP_LIBS="$LIBS"
 LIBS="$save_LIBS"
 AC_SUBST(CAP_LIBS)
+])
 
 # This makes sure pkg.m4 is available.
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
+])
 PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
 PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
 
@@ -648,22 +661,22 @@ AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
 AC_ARG_WITH([dbuspolicydir],
         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
         [],
-        [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
+        [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])])
 
 AC_ARG_WITH([dbussessionservicedir],
         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
         [],
-        [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
+        [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])])
 
 AC_ARG_WITH([dbussystemservicedir],
         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
         [],
-        [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
+        [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])])
 
 AC_ARG_WITH([dbusinterfacedir],
         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
         [],
-        [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
+        [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])])
 
 AC_ARG_WITH([rootprefix],
         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
@@ -677,7 +690,7 @@ AC_ARG_WITH([rootlibdir],
 AC_ARG_WITH([pamlibdir],
         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
         [],
-        [with_pamlibdir=${with_rootlibdir}/security])
+        [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_pamlibdir=${with_rootlibdir}/security])])
 
 AC_ARG_ENABLE([split-usr],
         AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),

^ permalink raw reply related

* Re: [PATCH] Allow configuring without systemd-only dependencies
From: William Hubbs @ 2012-06-08 16:15 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FD19D14.2070109@kadzban.is-a-geek.net>

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

On Thu, Jun 07, 2012 at 11:35:00PM -0700, Bryan Kadzban wrote:
> Some dependencies (intltool, m4, dbus, pkg-config, PAM) are only
> required or useful for systemd, not for udev.  Leave these required by
> default, but allow them to be made optional if the right flag is used to
> ./configure.

How about using --disable-systemd to take out these dependencies instead
of adding another switch?

William


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

^ permalink raw reply

* breaking up Makefile.am
From: William Hubbs @ 2012-06-08 18:26 UTC (permalink / raw)
  To: linux-hotplug

All,

this series of patches will break up Makefile.am into 3 modules which
are included by the main Makefile.

This is designed to make it possible to enable or disable the udev or
systemd portions of the build using configure switches.

Currently everything is still built, because there are no configure
switches in place. This however is the next phase of this project.

[PATCH 1/3] build-sys: move common libraries to separate Makefile
[PATCH 2/3] build-sys: move udev build to a separate makefile
[PATCH 3/3] build-sys: move systemd build to a separate makefile

These are meant to be applied directly to git as of commit
7a5498fe926eb41520c3e4b0e97ff8359ae37e9e.

Thanks,

William


^ permalink raw reply

* [PATCH 1/3] build-sys: move common libraries to separate Makefile
From: William Hubbs @ 2012-06-08 18:26 UTC (permalink / raw)
  To: linux-hotplug

---
 Makefile-shared.am |   98 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am        |   99 +---------------------------------------------------
 2 files changed, 99 insertions(+), 98 deletions(-)
 create mode 100644 Makefile-shared.am

diff --git a/Makefile-shared.am b/Makefile-shared.am
new file mode 100644
index 0000000..40dda24
--- /dev/null
+++ b/Makefile-shared.am
@@ -0,0 +1,98 @@
+# ------------------------------------------------------------------------------
+if HAVE_ACL
+noinst_LTLIBRARIES += \
+	libsystemd-acl.la
+
+libsystemd_acl_la_SOURCES = \
+	src/shared/acl-util.c \
+	src/shared/acl-util.h
+
+libsystemd_acl_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	$(ACL_CFLAGS)
+
+libsystemd_acl_la_LIBADD = \
+	$(ACL_LIBS)
+endif
+
+# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+	libsystemd-label.la
+
+libsystemd_label_la_SOURCES = \
+	src/shared/cgroup-label.c \
+	src/shared/socket-label.c \
+	src/shared/label.c \
+	src/shared/label.h \
+	src/shared/mkdir.c \
+	src/shared/mkdir.h \
+	src/shared/ask-password-api.c \
+	src/shared/ask-password-api.h \
+	src/shared/dev-setup.c \
+	src/shared/dev-setup.h
+
+libsystemd_label_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	$(SELINUX_CFLAGS)
+
+libsystemd_label_la_LIBADD = \
+	$(SELINUX_LIBS)
+
+# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+	libsystemd-shared.la
+
+libsystemd_shared_la_SOURCES = \
+	src/shared/linux/auto_dev-ioctl.h \
+	src/shared/linux/fanotify.h \
+	src/shared/missing.h \
+	src/shared/list.h \
+	src/shared/macro.h \
+	src/shared/def.h \
+	src/shared/util.c \
+	src/shared/util.h \
+	src/shared/virt.c \
+	src/shared/virt.h \
+	src/shared/path-util.c \
+	src/shared/path-util.h \
+	src/shared/hashmap.c \
+	src/shared/hashmap.h \
+	src/shared/set.c \
+	src/shared/set.h \
+	src/shared/strv.c \
+	src/shared/strv.h \
+	src/shared/conf-parser.c \
+	src/shared/conf-parser.h \
+	src/shared/log.c \
+	src/shared/log.h \
+	src/shared/ratelimit.h \
+	src/shared/ratelimit.c \
+	src/shared/exit-status.c \
+	src/shared/exit-status.h \
+	src/shared/utf8.c \
+	src/shared/utf8.h \
+	src/shared/pager.c \
+	src/shared/pager.h \
+	src/shared/ioprio.h \
+	src/shared/socket-util.c \
+	src/shared/socket-util.h \
+	src/shared/conf-files.c \
+	src/shared/conf-files.h \
+	src/shared/cgroup-util.c \
+	src/shared/cgroup-util.h \
+	src/shared/cgroup-show.c \
+	src/shared/cgroup-show.h \
+	src/shared/unit-name.c \
+	src/shared/unit-name.h \
+	src/shared/utmp-wtmp.c \
+	src/shared/utmp-wtmp.h \
+	src/shared/watchdog.c \
+	src/shared/watchdog.h \
+	src/shared/spawn-ask-password-agent.c \
+	src/shared/spawn-ask-password-agent.h \
+	src/shared/specifier.c \
+	src/shared/specifier.h \
+	src/shared/spawn-polkit-agent.c \
+	src/shared/spawn-polkit-agent.h \
+	src/shared/hwclock.c \
+	src/shared/hwclock.h
diff --git a/Makefile.am b/Makefile.am
index f45fa27..d4bc9eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -519,64 +519,7 @@ EXTRA_DIST += \
 	$(MANPAGES) \
 	$(MANPAGES_ALIAS)
 
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
-	libsystemd-shared.la
-
-libsystemd_shared_la_SOURCES = \
-	src/shared/linux/auto_dev-ioctl.h \
-	src/shared/linux/fanotify.h \
-	src/shared/missing.h \
-	src/shared/list.h \
-	src/shared/macro.h \
-	src/shared/def.h \
-	src/shared/util.c \
-	src/shared/util.h \
-	src/shared/virt.c \
-	src/shared/virt.h \
-	src/shared/path-util.c \
-	src/shared/path-util.h \
-	src/shared/hashmap.c \
-	src/shared/hashmap.h \
-	src/shared/set.c \
-	src/shared/set.h \
-	src/shared/strv.c \
-	src/shared/strv.h \
-	src/shared/conf-parser.c \
-	src/shared/conf-parser.h \
-	src/shared/log.c \
-	src/shared/log.h \
-	src/shared/ratelimit.h \
-	src/shared/ratelimit.c \
-	src/shared/exit-status.c \
-	src/shared/exit-status.h \
-	src/shared/utf8.c \
-	src/shared/utf8.h \
-	src/shared/pager.c \
-	src/shared/pager.h \
-	src/shared/ioprio.h \
-	src/shared/socket-util.c \
-	src/shared/socket-util.h \
-	src/shared/conf-files.c \
-	src/shared/conf-files.h \
-	src/shared/cgroup-util.c \
-	src/shared/cgroup-util.h \
-	src/shared/cgroup-show.c \
-	src/shared/cgroup-show.h \
-	src/shared/unit-name.c \
-	src/shared/unit-name.h \
-	src/shared/utmp-wtmp.c \
-	src/shared/utmp-wtmp.h \
-	src/shared/watchdog.c \
-	src/shared/watchdog.h \
-	src/shared/spawn-ask-password-agent.c \
-	src/shared/spawn-ask-password-agent.h \
-	src/shared/specifier.c \
-	src/shared/specifier.h \
-	src/shared/spawn-polkit-agent.c \
-	src/shared/spawn-polkit-agent.h \
-	src/shared/hwclock.c \
-	src/shared/hwclock.h
+include Makefile-shared.am
 
 #-------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -613,29 +556,6 @@ libsystemd_units_la_CFLAGS = \
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
-	libsystemd-label.la
-
-libsystemd_label_la_SOURCES = \
-	src/shared/cgroup-label.c \
-	src/shared/socket-label.c \
-	src/shared/label.c \
-	src/shared/label.h \
-	src/shared/mkdir.c \
-	src/shared/mkdir.h \
-	src/shared/ask-password-api.c \
-	src/shared/ask-password-api.h \
-	src/shared/dev-setup.c \
-	src/shared/dev-setup.h
-
-libsystemd_label_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	$(SELINUX_CFLAGS)
-
-libsystemd_label_la_LIBADD = \
-	$(SELINUX_LIBS)
-
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
 	libsystemd-logs.la
 
 libsystemd_logs_la_SOURCES = \
@@ -676,23 +596,6 @@ libsystemd_audit_la_LIBADD = \
 	libsystemd-capability.la
 
 # ------------------------------------------------------------------------------
-if HAVE_ACL
-noinst_LTLIBRARIES += \
-	libsystemd-acl.la
-
-libsystemd_acl_la_SOURCES = \
-	src/shared/acl-util.c \
-	src/shared/acl-util.h
-
-libsystemd_acl_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	$(ACL_CFLAGS)
-
-libsystemd_acl_la_LIBADD = \
-	$(ACL_LIBS)
-endif
-
-# ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-core.la
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 2/3] build-sys: move udev build to a separate makefile
From: William Hubbs @ 2012-06-08 18:26 UTC (permalink / raw)
  To: linux-hotplug

---
 Makefile-udev.am |  671 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 Makefile.am      |  675 +-----------------------------------------------------
 2 files changed, 674 insertions(+), 672 deletions(-)
 create mode 100644 Makefile-udev.am

diff --git a/Makefile-udev.am b/Makefile-udev.am
new file mode 100644
index 0000000..b8b5f63
--- /dev/null
+++ b/Makefile-udev.am
@@ -0,0 +1,671 @@
+LIBUDEV_CURRENT=1
+LIBUDEV_REVISION=1
+LIBUDEV_AGE=0
+
+LIBGUDEV_CURRENT=1
+LIBGUDEV_REVISION=1
+LIBGUDEV_AGE=1
+
+# ------------------------------------------------------------------------------
+if ENABLE_GTK_DOC
+SUBDIRS += \
+	docs/libudev
+endif
+
+include_HEADERS += \
+	src/libudev/libudev.h
+
+lib_LTLIBRARIES += \
+	libudev.la
+
+libudev_la_SOURCES =\
+	src/libudev/libudev-private.h \
+	src/libudev/libudev.c \
+	src/libudev/libudev-list.c \
+	src/libudev/libudev-util.c \
+	src/libudev/libudev-device.c \
+	src/libudev/libudev-enumerate.c \
+	src/libudev/libudev-monitor.c \
+	src/libudev/libudev-queue.c
+
+libudev_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	-fvisibility=hidden
+
+libudev_la_LDFLAGS = \
+	$(AM_LDFLAGS) \
+	-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
+	-Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
+
+libudev_la_LIBADD = \
+	libsystemd-shared.la
+
+pkgconfiglib_DATA += \
+	src/libudev/libudev.pc
+
+EXTRA_DIST += \
+	src/libudev/libudev.pc.in \
+	src/libudev/libudev.sym
+
+CLEANFILES += \
+	src/libudev/libudev.pc
+
+# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
+libudev-install-move-hook:
+	if test "$(libdir)" != "$(rootlibdir)"; then \
+		mkdir -p $(DESTDIR)$(rootlibdir) && \
+		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
+		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+		ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
+		mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlibdir); \
+	fi
+
+libudev-uninstall-move-hook:
+	rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
+
+INSTALL_EXEC_HOOKS += libudev-install-move-hook
+UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
+
+# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+	libudev-private.la
+
+libudev_private_la_SOURCES =\
+	$(libudev_la_SOURCES) \
+	src/libudev/libudev-device-private.c \
+	src/libudev/libudev-queue-private.c
+
+libudev_private_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	-fvisibilityfifault
+
+libudev_private_la_LIBADD = \
+	libsystemd-shared.la
+
+# ------------------------------------------------------------------------------
+MANPAGES += \
+	man/udev.7 \
+	man/udevadm.8 \
+	man/systemd-udevd.8
+
+udev-confdirs:
+	-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
+	-mkdir -p $(DESTDIR)$(libexecdir)/udev/devices
+
+INSTALL_DATA_HOOKS += udev-confdirs
+
+dist_udevrules_DATA += \
+	rules/99-systemd.rules \
+	rules/42-usb-hid-pm.rules \
+	rules/50-udev-default.rules \
+	rules/60-persistent-storage-tape.rules \
+	rules/60-persistent-serial.rules \
+	rules/60-persistent-input.rules \
+	rules/60-persistent-alsa.rules \
+	rules/60-persistent-storage.rules \
+	rules/75-net-description.rules \
+	rules/75-tty-description.rules \
+	rules/78-sound-card.rules \
+	rules/80-drivers.rules \
+	rules/95-udev-late.rules
+
+udevconfdir = $(sysconfdir)/udev
+dist_udevconf_DATA = \
+	src/udev/udev.conf
+
+sharepkgconfigdir = $(datadir)/pkgconfig
+sharepkgconfig_DATA = \
+	src/udev/udev.pc
+
+EXTRA_DIST += \
+	rules/99-systemd.rules.in \
+	src/udev/udev.pc.in
+
+CLEANFILES += \
+	rules/99-systemd.rules \
+	src/udev/udev.pc
+
+EXTRA_DIST += \
+	units/systemd-udev.service.in \
+	units/systemd-udev-trigger.service.in \
+	units/systemd-udev-settle.service.in
+
+CLEANFILES += \
+	units/systemd-udev.service \
+	units/systemd-udev-trigger.service \
+	units/systemd-udev-settle.service
+
+systemd-install-hook:
+	mkdir -p $(DESTDIR)$(systemunitdir)/sockets.target.wants
+	ln -sf ../systemd-udev-control.socket $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-control.socket
+	ln -sf ../systemd-udev-kernel.socket $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-kernel.socket
+	mkdir -p $(DESTDIR)$(systemunitdir)/sysinit.target.wants
+	ln -sf ../systemd-udev.service $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev.service
+	ln -sf ../systemd-udev-trigger.service $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev-trigger.service
+
+INSTALL_DATA_HOOKS += systemd-install-hook
+
+bin_PROGRAMS += \
+	udevadm
+
+rootlibexec_PROGRAMS += \
+	systemd-udevd
+
+noinst_LTLIBRARIES += \
+	libudev-core.la
+
+libudev_core_la_SOURCES = \
+	src/udev/udev.h \
+	src/udev/udev-event.c \
+	src/udev/udev-watch.c \
+	src/udev/udev-node.c \
+	src/udev/udev-rules.c \
+	src/udev/udev-ctrl.c \
+	src/udev/udev-builtin.c \
+	src/udev/udev-builtin-blkid.c \
+	src/udev/udev-builtin-firmware.c \
+	src/udev/udev-builtin-hwdb.c \
+	src/udev/udev-builtin-input_id.c \
+	src/udev/udev-builtin-kmod.c \
+	src/udev/udev-builtin-path_id.c \
+	src/udev/udev-builtin-usb_id.c \
+	src/libsystemd-daemon/sd-daemon.c
+
+libudev_core_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	$(BLKID_CFLAGS) \
+	$(KMOD_CFLAGS)
+
+libudev_core_la_LIBADD = \
+	libudev-private.la \
+	libsystemd-label.la \
+	libsystemd-shared.la \
+	$(BLKID_LIBS) \
+	$(KMOD_LIBS)
+
+libudev_core_la_CPPFLAGS = \
+	$(AM_CPPFLAGS) \
+	-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
+	-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
+
+if HAVE_ACL
+libudev_core_la_SOURCES += \
+	src/udev/udev-builtin-uaccess.c \
+	src/login/logind-acl.c \
+	src/login/sd-login.c
+
+libudev_core_la_LIBADD += \
+	libsystemd-acl.la
+endif
+
+systemd_udevd_SOURCES = \
+	src/udev/udevd.c
+
+systemd_udevd_LDADD = \
+	libudev-core.la
+
+udevadm_SOURCES = \
+	src/udev/udevadm.c \
+	src/udev/udevadm-info.c \
+	src/udev/udevadm-control.c \
+	src/udev/udevadm-monitor.c \
+	src/udev/udevadm-settle.c \
+	src/udev/udevadm-trigger.c \
+	src/udev/udevadm-test.c \
+	src/udev/udevadm-test-builtin.c
+
+udevadm_LDADD = \
+	libudev-core.la \
+	libsystemd-shared.la
+
+# ------------------------------------------------------------------------------
+TESTS += \
+	test/udev-test.pl \
+	test/rules-test.sh
+
+noinst_PROGRAMS += \
+	test-libudev \
+	test-udev
+
+test_libudev_SOURCES = \
+	src/test/test-libudev.c
+
+test_libudev_LDADD = \
+	libsystemd-label.la \
+	libsystemd-shared.la \
+	libudev.la
+
+test_udev_SOURCES = \
+	src/test/test-udev.c \
+	$(libudev_core_la_SOURCES) \
+	$(libudev_private_la_SOURCES)
+
+# The test-udev program needs everything compiled with relative path
+# names for /sys, /dev, /run prefixed, pointing to our test/ directory.
+test_udev_CFLAGS = \
+	-DTEST_PREFIX=\"test\" \
+	$(libudev_core_la_CFLAGS) \
+	$(libudev_private_la_CFLAGS)
+
+test_udev_CPPFLAGS =\
+	$(libudev_core_la_CPPFLAGS)
+
+test_udev_LDADD = \
+	libsystemd-label.la \
+	libsystemd-shared.la \
+	$(BLKID_LIBS) \
+	$(KMOD_LIBS) \
+	$(SELINUX_LIBS)
+
+if HAVE_ACL
+test_udev_LDADD += \
+	libsystemd-acl.la
+endif
+
+check_DATA += \
+	test/sys
+
+# packed sysfs test tree
+test/sys:
+	$(AM_V_GEN)mkdir -p test && tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
+
+test-sys-distclean:
+	-rm -rf test/sys
+DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
+
+EXTRA_DIST += \
+	test/sys.tar.xz \
+	test/udev-test.pl \
+	test/rules-test.sh \
+	test/rule-syntax-check.py
+
+# ------------------------------------------------------------------------------
+ata_id_SOURCES = \
+	src/udev/ata_id/ata_id.c
+
+ata_id_LDADD = \
+	libudev-private.la \
+	libsystemd-shared.la
+
+udevlibexec_PROGRAMS += \
+	ata_id
+
+# ------------------------------------------------------------------------------
+cdrom_id_SOURCES = \
+	src/udev/cdrom_id/cdrom_id.c
+
+cdrom_id_LDADD = \
+	libudev.la \
+	libsystemd-shared.la
+
+udevlibexec_PROGRAMS += \
+	cdrom_id
+
+dist_udevrules_DATA += \
+	rules/60-cdrom_id.rules
+
+# ------------------------------------------------------------------------------
+collect_SOURCES = \
+	src/udev/collect/collect.c
+
+collect_LDADD = \
+	libudev-private.la
+
+udevlibexec_PROGRAMS += \
+	collect
+
+# ------------------------------------------------------------------------------
+scsi_id_SOURCES =\
+	src/udev/scsi_id/scsi_id.c \
+	src/udev/scsi_id/scsi_serial.c \
+	src/udev/scsi_id/scsi.h \
+	src/udev/scsi_id/scsi_id.h
+
+scsi_id_LDADD = \
+	libudev-private.la \
+	libsystemd-shared.la
+
+udevlibexec_PROGRAMS += \
+	scsi_id
+
+EXTRA_DIST += \
+	src/udev/scsi_id/README
+
+# ------------------------------------------------------------------------------
+v4l_id_SOURCES = \
+	src/udev/v4l_id/v4l_id.c
+
+v4l_id_LDADD = \
+	libudev.la
+
+udevlibexec_PROGRAMS += \
+	v4l_id
+
+dist_udevrules_DATA += \
+	rules/60-persistent-v4l.rules
+
+# ------------------------------------------------------------------------------
+accelerometer_SOURCES = \
+	src/udev/accelerometer/accelerometer.c
+
+accelerometer_LDADD = \
+	libudev.la -lm \
+	libsystemd-shared.la
+
+udevlibexec_PROGRAMS += \
+	accelerometer
+
+dist_udevrules_DATA += \
+	rules/61-accelerometer.rules
+
+# ------------------------------------------------------------------------------
+if ENABLE_GUDEV
+if ENABLE_GTK_DOC
+SUBDIRS += \
+	docs/gudev
+endif
+
+libgudev_includedir = \
+	$(includedir)/gudev-1.0/gudev
+
+libgudev_include_HEADERS = \
+	src/gudev/gudev.h \
+	src/gudev/gudevenums.h \
+	src/gudev/gudevenumtypes.h \
+	src/gudev/gudevtypes.h \
+	src/gudev/gudevclient.h \
+	src/gudev/gudevdevice.h \
+	src/gudev/gudevenumerator.h
+
+lib_LTLIBRARIES += libgudev-1.0.la
+
+pkgconfiglib_DATA += \
+	src/gudev/gudev-1.0.pc
+
+EXTRA_DIST += \
+	src/gudev/gudev-1.0.pc.in
+
+CLEANFILES += \
+	src/gudev/gudev-1.0.pc
+
+libgudev_1_0_la_SOURCES = \
+	src/gudev/gudevenums.h \
+	src/gudev/gudevenumtypes.h \
+	src/gudev/gudevenumtypes.h\
+	src/gudev/gudevtypes.h \
+	src/gudev/gudevclient.h \
+	src/gudev/gudevclient.c \
+	src/gudev/gudevdevice.h \
+	src/gudev/gudevdevice.c \
+	src/gudev/gudevenumerator.h \
+	src/gudev/gudevenumerator.c \
+	src/gudev/gudevprivate.h
+
+nodist_libgudev_1_0_la_SOURCES = \
+	src/gudev/gudevmarshal.h \
+	src/gudev/gudevmarshal.c \
+	src/gudev/gudevenumtypes.h \
+	src/gudev/gudevenumtypes.c
+
+BUILT_SOURCES += \
+	$(nodist_libgudev_1_0_la_SOURCES)
+
+libgudev_1_0_la_CPPFLAGS = \
+	$(AM_CPPFLAGS) \
+	-I$(top_builddir)/src\
+	-I$(top_srcdir)/src\
+	-I$(top_builddir)/src/gudev \
+	-I$(top_srcdir)/src/gudev \
+	-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
+	-D_GUDEV_COMPILATION \
+	-DG_LOG_DOMAIN=\"GUdev\"
+
+libgudev_1_0_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	-fvisibilityfifault \
+	$(GLIB_CFLAGS)
+
+libgudev_1_0_la_LIBADD = \
+	libudev.la \
+	$(GLIB_LIBS)
+
+libgudev_1_0_la_LDFLAGS = \
+	$(AM_LDFLAGS) \
+	-version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
+	-export-dynamic -no-undefined \
+	-export-symbols-regex '^g_udev_.*'
+
+EXTRA_DIST += \
+	src/gudev/gudevmarshal.list \
+	src/gudev/gudevenumtypes.h.template \
+	src/gudev/gudevenumtypes.c.template \
+	src/gudev/gjs-example.js \
+	src/gudev/seed-example-enum.js \
+	src/gudev/seed-example.js
+
+CLEANFILES += \
+	$(nodist_libgudev_1_0_la_SOURCES)
+
+src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
+	$(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
+
+src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
+	$(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
+	glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
+
+src/gudev/gudevenumtypes.h: src/gudev/gudevenumtypes.h.template src/gudev/gudevenums.h
+	$(AM_V_GEN)glib-mkenums --template $^ > \
+	    $@.tmp && mv $@.tmp $@
+
+src/gudev/gudevenumtypes.c: src/gudev/gudevenumtypes.c.template src/gudev/gudevenums.h
+	$(AM_V_GEN)glib-mkenums --template $^ > \
+	    $@.tmp && mv $@.tmp $@
+
+if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+
+src/gudev/GUdev-1.0.gir: libgudev-1.0.la
+
+src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
+
+src_gudev_GUdev_1_0_gir_CFLAGS = \
+	$(INCLUDES) \
+	-D_GUDEV_COMPILATION \
+	-D_GUDEV_WORK_AROUND_DEV_T_BUG \
+	-I$(top_srcdir)/src \
+	-I$(top_builddir)/src \
+	-I$(top_srcdir)/src/gdev \
+	-I$(top_builddir)/src/gdev
+
+src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
+
+src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
+	--pkg-export=gudev-1.0 \
+	--warn-all
+
+src_gudev_GUdev_1_0_gir_FILES = \
+	$(top_srcdir)/src/gudev/gudev.h \
+	$(top_srcdir)/src/gudev/gudevtypes.h \
+	$(top_srcdir)/src/gudev/gudevenums.h \
+	$(or $(wildcard $(top_builddir)/src/gudev/gudevenumtypes.h),$(top_srcdir)/src/gudev/gudevenumtypes.h) \
+	$(top_srcdir)/src/gudev/gudevclient.h \
+	$(top_srcdir)/src/gudev/gudevdevice.h \
+	$(top_srcdir)/src/gudev/gudevenumerator.h \
+	$(top_srcdir)/src/gudev/gudevclient.c \
+	$(top_srcdir)/src/gudev/gudevdevice.c \
+	$(top_srcdir)/src/gudev/gudevenumerator.c
+
+INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
+INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = \
+	src/gudev/GUdev-1.0.gir
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = \
+	src/gudev/GUdev-1.0.typelib
+
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+endif # HAVE_INTROSPECTION
+
+# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
+libgudev-install-move-hook:
+	if test "$(libdir)" != "$(rootlibdir)"; then \
+		mkdir -p $(DESTDIR)$(rootlibdir) && \
+		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
+		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+		ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
+		mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlibdir); \
+	fi
+
+libgudev-uninstall-move-hook:
+	rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
+
+INSTALL_EXEC_HOOKS += libgudev-install-move-hook
+UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
+endif
+
+# ------------------------------------------------------------------------------
+if ENABLE_KEYMAP
+keymap_SOURCES = \
+	src/udev/keymap/keymap.c
+
+keymap_CPPFLAGS = \
+	$(AM_CPPFLAGS) -I src/udev/keymap
+
+keymap_LDADD = \
+	libsystemd-shared.la
+
+nodist_keymap_SOURCES = \
+	src/udev/keymap/keys-from-name.h \
+	src/udev/keymap/keys-to-name.h
+
+BUILT_SOURCES += \
+	$(nodist_keymap_SOURCES)
+
+udevlibexec_PROGRAMS += \
+	keymap
+
+dist_doc_DATA += \
+	src/udev/keymap/README.keymap.txt
+
+dist_udevrules_DATA += \
+	src/udev/keymap/95-keymap.rules \
+	src/udev/keymap/95-keyboard-force-release.rules
+
+dist_udevhome_SCRIPTS = \
+	src/udev/keymap/findkeyboards \
+	src/udev/keymap/keyboard-force-release.sh
+
+TESTS += \
+	src/udev/keymap/check-keymaps.sh
+
+EXTRA_DIST += \
+	src/udev/keymap/check-keymaps.sh \
+	src/udev/keymap/keyboard-force-release.sh.in
+
+CLEANFILES += \
+	$(nodist_keymap_SOURCES) \
+	src/udev/keymap/keys.txt \
+	src/udev/keymap/keys-from-name.gperf \
+	src/udev/keymap/keyboard-force-release.sh
+
+udevkeymapdir = $(libexecdir)/udev/keymaps
+dist_udevkeymap_DATA = \
+	keymaps/acer \
+	keymaps/acer-aspire_5720 \
+	keymaps/acer-aspire_8930 \
+	keymaps/acer-aspire_5920g \
+	keymaps/acer-aspire_6920 \
+	keymaps/acer-travelmate_c300 \
+	keymaps/asus \
+	keymaps/compaq-e_evo \
+	keymaps/dell \
+	keymaps/dell-latitude-xt2 \
+	keymaps/everex-xt5000 \
+	keymaps/fujitsu-amilo_li_2732 \
+	keymaps/fujitsu-amilo_pa_2548 \
+	keymaps/fujitsu-amilo_pro_edition_v3505 \
+	keymaps/fujitsu-amilo_pro_v3205 \
+	keymaps/fujitsu-amilo_si_1520 \
+	keymaps/fujitsu-esprimo_mobile_v5 \
+	keymaps/fujitsu-esprimo_mobile_v6 \
+	keymaps/genius-slimstar-320 \
+	keymaps/hewlett-packard \
+	keymaps/hewlett-packard-2510p_2530p \
+	keymaps/hewlett-packard-compaq_elitebook \
+	keymaps/hewlett-packard-pavilion \
+	keymaps/hewlett-packard-presario-2100 \
+	keymaps/hewlett-packard-tablet \
+	keymaps/hewlett-packard-tx2 \
+	keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
+	keymaps/inventec-symphony_6.0_7.0 \
+	keymaps/lenovo-3000 \
+	keymaps/lenovo-ideapad \
+	keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
+	keymaps/lenovo-thinkpad_x6_tablet \
+	keymaps/lenovo-thinkpad_x200_tablet \
+	keymaps/lg-x110 \
+	keymaps/logitech-wave \
+	keymaps/logitech-wave-cordless \
+	keymaps/logitech-wave-pro-cordless \
+	keymaps/maxdata-pro_7000 \
+	keymaps/medion-fid2060 \
+	keymaps/medionnb-a555 \
+	keymaps/micro-star \
+	keymaps/module-asus-w3j \
+	keymaps/module-ibm \
+	keymaps/module-lenovo \
+	keymaps/module-sony \
+	keymaps/module-sony-old \
+	keymaps/module-sony-vgn \
+	keymaps/olpc-xo \
+	keymaps/onkyo \
+	keymaps/oqo-model2 \
+	keymaps/samsung-other \
+	keymaps/samsung-90x3a \
+	keymaps/samsung-sq1us \
+	keymaps/samsung-sx20s \
+	keymaps/toshiba-satellite_a100 \
+	keymaps/toshiba-satellite_a110 \
+	keymaps/toshiba-satellite_m30x \
+	keymaps/zepto-znote
+
+udevkeymapforcereldir = $(libexecdir)/udev/keymaps/force-release
+dist_udevkeymapforcerel_DATA = \
+	keymaps-force-release/dell-touchpad \
+	keymaps-force-release/dell-xps \
+	keymaps-force-release/hp-other \
+	keymaps-force-release/samsung-other \
+	keymaps-force-release/samsung-90x3a \
+	keymaps-force-release/common-volume-keys
+
+src/udev/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
+	$(AM_V_at)mkdir -p src/udev/keymap
+	$(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
+
+src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt
+	$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
+
+src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf Makefile
+	$(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
+
+src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
+	$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
+endif
+
+# ------------------------------------------------------------------------------
+mtd_probe_SOURCES =  \
+	src/udev/mtd_probe/mtd_probe.c \
+	src/udev/mtd_probe/mtd_probe.h \
+	src/udev/mtd_probe/probe_smartmedia.c
+
+mtd_probe_CPPFLAGS = \
+	$(AM_CPPFLAGS)
+
+dist_udevrules_DATA += \
+	rules/75-probe_mtd.rules
+
+udevlibexec_PROGRAMS += \
+	mtd_probe
diff --git a/Makefile.am b/Makefile.am
index d4bc9eb..0cfddd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,14 +23,6 @@ AM_MAKEFLAGS = --no-print-directory
 
 SUBDIRS = . po
 
-LIBUDEV_CURRENT=1
-LIBUDEV_REVISION=1
-LIBUDEV_AGE=0
-
-LIBGUDEV_CURRENT=1
-LIBGUDEV_REVISION=1
-LIBGUDEV_AGE=1
-
 LIBSYSTEMD_LOGIN_CURRENT=2
 LIBSYSTEMD_LOGIN_REVISION=4
 LIBSYSTEMD_LOGIN_AGE=2
@@ -85,6 +77,8 @@ INSTALL_EXEC_HOOKS  UNINSTALL_EXEC_HOOKS  INSTALL_DATA_HOOKS  DISTCLEAN_LOCAL_HOOKS +MANPAGES +MANPAGES_ALIAS  pkginclude_HEADERS  noinst_LTLIBRARIES  lib_LTLIBRARIES @@ -520,6 +514,7 @@ EXTRA_DIST += \
 	$(MANPAGES_ALIAS)
 
 include Makefile-shared.am
+include Makefile-udev.am
 
 #-------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -1242,670 +1237,6 @@ EXTRA_DIST += \
 	src/libsystemd-daemon/libsystemd-daemon.sym
 
 # ------------------------------------------------------------------------------
-if ENABLE_GTK_DOC
-SUBDIRS += \
-	docs/libudev
-endif
-
-include_HEADERS += \
-	src/libudev/libudev.h
-
-lib_LTLIBRARIES += \
-	libudev.la
-
-libudev_la_SOURCES =\
-	src/libudev/libudev-private.h \
-	src/libudev/libudev.c \
-	src/libudev/libudev-list.c \
-	src/libudev/libudev-util.c \
-	src/libudev/libudev-device.c \
-	src/libudev/libudev-enumerate.c \
-	src/libudev/libudev-monitor.c \
-	src/libudev/libudev-queue.c
-
-libudev_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	-fvisibility=hidden
-
-libudev_la_LDFLAGS = \
-	$(AM_LDFLAGS) \
-	-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
-	-Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
-
-libudev_la_LIBADD = \
-	libsystemd-shared.la
-
-pkgconfiglib_DATA += \
-	src/libudev/libudev.pc
-
-EXTRA_DIST += \
-	src/libudev/libudev.pc.in \
-	src/libudev/libudev.sym
-
-CLEANFILES += \
-	src/libudev/libudev.pc
-
-# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
-libudev-install-move-hook:
-	if test "$(libdir)" != "$(rootlibdir)"; then \
-		mkdir -p $(DESTDIR)$(rootlibdir) && \
-		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
-		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
-		ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
-		mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlibdir); \
-	fi
-
-libudev-uninstall-move-hook:
-	rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
-
-INSTALL_EXEC_HOOKS += libudev-install-move-hook
-UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
-
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
-	libudev-private.la
-
-libudev_private_la_SOURCES =\
-	$(libudev_la_SOURCES) \
-	src/libudev/libudev-device-private.c \
-	src/libudev/libudev-queue-private.c
-
-libudev_private_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	-fvisibilityfifault
-
-libudev_private_la_LIBADD = \
-	libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-MANPAGES += \
-	man/udev.7 \
-	man/udevadm.8 \
-	man/systemd-udevd.8
-
-udev-confdirs:
-	-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
-	-mkdir -p $(DESTDIR)$(libexecdir)/udev/devices
-
-INSTALL_DATA_HOOKS += udev-confdirs
-
-dist_udevrules_DATA += \
-	rules/99-systemd.rules \
-	rules/42-usb-hid-pm.rules \
-	rules/50-udev-default.rules \
-	rules/60-persistent-storage-tape.rules \
-	rules/60-persistent-serial.rules \
-	rules/60-persistent-input.rules \
-	rules/60-persistent-alsa.rules \
-	rules/60-persistent-storage.rules \
-	rules/75-net-description.rules \
-	rules/75-tty-description.rules \
-	rules/78-sound-card.rules \
-	rules/80-drivers.rules \
-	rules/95-udev-late.rules
-
-udevconfdir = $(sysconfdir)/udev
-dist_udevconf_DATA = \
-	src/udev/udev.conf
-
-sharepkgconfigdir = $(datadir)/pkgconfig
-sharepkgconfig_DATA = \
-	src/udev/udev.pc
-
-EXTRA_DIST += \
-	rules/99-systemd.rules.in \
-	src/udev/udev.pc.in
-
-CLEANFILES += \
-	rules/99-systemd.rules \
-	src/udev/udev.pc
-
-EXTRA_DIST += \
-	units/systemd-udev.service.in \
-	units/systemd-udev-trigger.service.in \
-	units/systemd-udev-settle.service.in
-
-CLEANFILES += \
-	units/systemd-udev.service \
-	units/systemd-udev-trigger.service \
-	units/systemd-udev-settle.service
-
-systemd-install-hook:
-	mkdir -p $(DESTDIR)$(systemunitdir)/sockets.target.wants
-	ln -sf ../systemd-udev-control.socket $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-control.socket
-	ln -sf ../systemd-udev-kernel.socket $(DESTDIR)$(systemunitdir)/sockets.target.wants/systemd-udev-kernel.socket
-	mkdir -p $(DESTDIR)$(systemunitdir)/sysinit.target.wants
-	ln -sf ../systemd-udev.service $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev.service
-	ln -sf ../systemd-udev-trigger.service $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev-trigger.service
-
-INSTALL_DATA_HOOKS += systemd-install-hook
-
-bin_PROGRAMS += \
-	udevadm
-
-rootlibexec_PROGRAMS += \
-	systemd-udevd
-
-noinst_LTLIBRARIES += \
-	libudev-core.la
-
-libudev_core_la_SOURCES = \
-	src/udev/udev.h \
-	src/udev/udev-event.c \
-	src/udev/udev-watch.c \
-	src/udev/udev-node.c \
-	src/udev/udev-rules.c \
-	src/udev/udev-ctrl.c \
-	src/udev/udev-builtin.c \
-	src/udev/udev-builtin-blkid.c \
-	src/udev/udev-builtin-firmware.c \
-	src/udev/udev-builtin-hwdb.c \
-	src/udev/udev-builtin-input_id.c \
-	src/udev/udev-builtin-kmod.c \
-	src/udev/udev-builtin-path_id.c \
-	src/udev/udev-builtin-usb_id.c \
-	src/libsystemd-daemon/sd-daemon.c
-
-libudev_core_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	$(BLKID_CFLAGS) \
-	$(KMOD_CFLAGS)
-
-libudev_core_la_LIBADD = \
-	libudev-private.la \
-	libsystemd-label.la \
-	libsystemd-shared.la \
-	$(BLKID_LIBS) \
-	$(KMOD_LIBS)
-
-libudev_core_la_CPPFLAGS = \
-	$(AM_CPPFLAGS) \
-	-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
-	-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
-
-if HAVE_ACL
-libudev_core_la_SOURCES += \
-	src/udev/udev-builtin-uaccess.c \
-	src/login/logind-acl.c \
-	src/login/sd-login.c
-
-libudev_core_la_LIBADD += \
-	libsystemd-acl.la
-endif
-
-systemd_udevd_SOURCES = \
-	src/udev/udevd.c
-
-systemd_udevd_LDADD = \
-	libudev-core.la
-
-udevadm_SOURCES = \
-	src/udev/udevadm.c \
-	src/udev/udevadm-info.c \
-	src/udev/udevadm-control.c \
-	src/udev/udevadm-monitor.c \
-	src/udev/udevadm-settle.c \
-	src/udev/udevadm-trigger.c \
-	src/udev/udevadm-test.c \
-	src/udev/udevadm-test-builtin.c
-
-udevadm_LDADD = \
-	libudev-core.la \
-	libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-TESTS += \
-	test/udev-test.pl \
-	test/rules-test.sh
-
-noinst_PROGRAMS += \
-	test-libudev \
-	test-udev
-
-test_libudev_SOURCES = \
-	src/test/test-libudev.c
-
-test_libudev_LDADD = \
-	libsystemd-label.la \
-	libsystemd-shared.la \
-	libudev.la
-
-test_udev_SOURCES = \
-	src/test/test-udev.c \
-	$(libudev_core_la_SOURCES) \
-	$(libudev_private_la_SOURCES)
-
-# The test-udev program needs everything compiled with relative path
-# names for /sys, /dev, /run prefixed, pointing to our test/ directory.
-test_udev_CFLAGS = \
-	-DTEST_PREFIX=\"test\" \
-	$(libudev_core_la_CFLAGS) \
-	$(libudev_private_la_CFLAGS)
-
-test_udev_CPPFLAGS =\
-	$(libudev_core_la_CPPFLAGS)
-
-test_udev_LDADD = \
-	libsystemd-label.la \
-	libsystemd-shared.la \
-	$(BLKID_LIBS) \
-	$(KMOD_LIBS) \
-	$(SELINUX_LIBS)
-
-if HAVE_ACL
-test_udev_LDADD += \
-	libsystemd-acl.la
-endif
-
-check_DATA += \
-	test/sys
-
-# packed sysfs test tree
-test/sys:
-	$(AM_V_GEN)mkdir -p test && tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
-
-test-sys-distclean:
-	-rm -rf test/sys
-DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
-
-EXTRA_DIST += \
-	test/sys.tar.xz \
-	test/udev-test.pl \
-	test/rules-test.sh \
-	test/rule-syntax-check.py
-
-# ------------------------------------------------------------------------------
-ata_id_SOURCES = \
-	src/udev/ata_id/ata_id.c
-
-ata_id_LDADD = \
-	libudev-private.la \
-	libsystemd-shared.la
-
-udevlibexec_PROGRAMS += \
-	ata_id
-
-# ------------------------------------------------------------------------------
-cdrom_id_SOURCES = \
-	src/udev/cdrom_id/cdrom_id.c
-
-cdrom_id_LDADD = \
-	libudev.la \
-	libsystemd-shared.la
-
-udevlibexec_PROGRAMS += \
-	cdrom_id
-
-dist_udevrules_DATA += \
-	rules/60-cdrom_id.rules
-
-# ------------------------------------------------------------------------------
-collect_SOURCES = \
-	src/udev/collect/collect.c
-
-collect_LDADD = \
-	libudev-private.la
-
-udevlibexec_PROGRAMS += \
-	collect
-
-# ------------------------------------------------------------------------------
-scsi_id_SOURCES =\
-	src/udev/scsi_id/scsi_id.c \
-	src/udev/scsi_id/scsi_serial.c \
-	src/udev/scsi_id/scsi.h \
-	src/udev/scsi_id/scsi_id.h
-
-scsi_id_LDADD = \
-	libudev-private.la \
-	libsystemd-shared.la
-
-udevlibexec_PROGRAMS += \
-	scsi_id
-
-EXTRA_DIST += \
-	src/udev/scsi_id/README
-
-# ------------------------------------------------------------------------------
-v4l_id_SOURCES = \
-	src/udev/v4l_id/v4l_id.c
-
-v4l_id_LDADD = \
-	libudev.la
-
-udevlibexec_PROGRAMS += \
-	v4l_id
-
-dist_udevrules_DATA += \
-	rules/60-persistent-v4l.rules
-
-# ------------------------------------------------------------------------------
-accelerometer_SOURCES = \
-	src/udev/accelerometer/accelerometer.c
-
-accelerometer_LDADD = \
-	libudev.la -lm \
-	libsystemd-shared.la
-
-udevlibexec_PROGRAMS += \
-	accelerometer
-
-dist_udevrules_DATA += \
-	rules/61-accelerometer.rules
-
-# ------------------------------------------------------------------------------
-if ENABLE_GUDEV
-if ENABLE_GTK_DOC
-SUBDIRS += \
-	docs/gudev
-endif
-
-libgudev_includedir = \
-	$(includedir)/gudev-1.0/gudev
-
-libgudev_include_HEADERS = \
-	src/gudev/gudev.h \
-	src/gudev/gudevenums.h \
-	src/gudev/gudevenumtypes.h \
-	src/gudev/gudevtypes.h \
-	src/gudev/gudevclient.h \
-	src/gudev/gudevdevice.h \
-	src/gudev/gudevenumerator.h
-
-lib_LTLIBRARIES += libgudev-1.0.la
-
-pkgconfiglib_DATA += \
-	src/gudev/gudev-1.0.pc
-
-EXTRA_DIST += \
-	src/gudev/gudev-1.0.pc.in
-
-CLEANFILES += \
-	src/gudev/gudev-1.0.pc
-
-libgudev_1_0_la_SOURCES = \
-	src/gudev/gudevenums.h \
-	src/gudev/gudevenumtypes.h \
-	src/gudev/gudevenumtypes.h\
-	src/gudev/gudevtypes.h \
-	src/gudev/gudevclient.h \
-	src/gudev/gudevclient.c \
-	src/gudev/gudevdevice.h \
-	src/gudev/gudevdevice.c \
-	src/gudev/gudevenumerator.h \
-	src/gudev/gudevenumerator.c \
-	src/gudev/gudevprivate.h
-
-nodist_libgudev_1_0_la_SOURCES = \
-	src/gudev/gudevmarshal.h \
-	src/gudev/gudevmarshal.c \
-	src/gudev/gudevenumtypes.h \
-	src/gudev/gudevenumtypes.c
-
-BUILT_SOURCES += \
-	$(nodist_libgudev_1_0_la_SOURCES)
-
-libgudev_1_0_la_CPPFLAGS = \
-	$(AM_CPPFLAGS) \
-	-I$(top_builddir)/src\
-	-I$(top_srcdir)/src\
-	-I$(top_builddir)/src/gudev \
-	-I$(top_srcdir)/src/gudev \
-	-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
-	-D_GUDEV_COMPILATION \
-	-DG_LOG_DOMAIN=\"GUdev\"
-
-libgudev_1_0_la_CFLAGS = \
-	$(AM_CFLAGS) \
-	-fvisibilityfifault \
-	$(GLIB_CFLAGS)
-
-libgudev_1_0_la_LIBADD = \
-	libudev.la \
-	$(GLIB_LIBS)
-
-libgudev_1_0_la_LDFLAGS = \
-	$(AM_LDFLAGS) \
-	-version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
-	-export-dynamic -no-undefined \
-	-export-symbols-regex '^g_udev_.*'
-
-EXTRA_DIST += \
-	src/gudev/gudevmarshal.list \
-	src/gudev/gudevenumtypes.h.template \
-	src/gudev/gudevenumtypes.c.template \
-	src/gudev/gjs-example.js \
-	src/gudev/seed-example-enum.js \
-	src/gudev/seed-example.js
-
-CLEANFILES += \
-	$(nodist_libgudev_1_0_la_SOURCES)
-
-src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
-	$(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
-
-src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
-	$(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
-	glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
-
-src/gudev/gudevenumtypes.h: src/gudev/gudevenumtypes.h.template src/gudev/gudevenums.h
-	$(AM_V_GEN)glib-mkenums --template $^ > \
-	    $@.tmp && mv $@.tmp $@
-
-src/gudev/gudevenumtypes.c: src/gudev/gudevenumtypes.c.template src/gudev/gudevenums.h
-	$(AM_V_GEN)glib-mkenums --template $^ > \
-	    $@.tmp && mv $@.tmp $@
-
-if HAVE_INTROSPECTION
--include $(INTROSPECTION_MAKEFILE)
-
-src/gudev/GUdev-1.0.gir: libgudev-1.0.la
-
-src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
-
-src_gudev_GUdev_1_0_gir_CFLAGS = \
-	$(INCLUDES) \
-	-D_GUDEV_COMPILATION \
-	-D_GUDEV_WORK_AROUND_DEV_T_BUG \
-	-I$(top_srcdir)/src \
-	-I$(top_builddir)/src \
-	-I$(top_srcdir)/src/gdev \
-	-I$(top_builddir)/src/gdev
-
-src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
-
-src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
-	--pkg-export=gudev-1.0 \
-	--warn-all
-
-src_gudev_GUdev_1_0_gir_FILES = \
-	$(top_srcdir)/src/gudev/gudev.h \
-	$(top_srcdir)/src/gudev/gudevtypes.h \
-	$(top_srcdir)/src/gudev/gudevenums.h \
-	$(or $(wildcard $(top_builddir)/src/gudev/gudevenumtypes.h),$(top_srcdir)/src/gudev/gudevenumtypes.h) \
-	$(top_srcdir)/src/gudev/gudevclient.h \
-	$(top_srcdir)/src/gudev/gudevdevice.h \
-	$(top_srcdir)/src/gudev/gudevenumerator.h \
-	$(top_srcdir)/src/gudev/gudevclient.c \
-	$(top_srcdir)/src/gudev/gudevdevice.c \
-	$(top_srcdir)/src/gudev/gudevenumerator.c
-
-INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
-INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = \
-	src/gudev/GUdev-1.0.gir
-
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = \
-	src/gudev/GUdev-1.0.typelib
-
-CLEANFILES += $(gir_DATA) $(typelibs_DATA)
-endif # HAVE_INTROSPECTION
-
-# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
-libgudev-install-move-hook:
-	if test "$(libdir)" != "$(rootlibdir)"; then \
-		mkdir -p $(DESTDIR)$(rootlibdir) && \
-		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
-		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
-		ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
-		mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlibdir); \
-	fi
-
-libgudev-uninstall-move-hook:
-	rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
-
-INSTALL_EXEC_HOOKS += libgudev-install-move-hook
-UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
-endif
-
-# ------------------------------------------------------------------------------
-if ENABLE_KEYMAP
-keymap_SOURCES = \
-	src/udev/keymap/keymap.c
-
-keymap_CPPFLAGS = \
-	$(AM_CPPFLAGS) -I src/udev/keymap
-
-keymap_LDADD = \
-	libsystemd-shared.la
-
-nodist_keymap_SOURCES = \
-	src/udev/keymap/keys-from-name.h \
-	src/udev/keymap/keys-to-name.h
-
-BUILT_SOURCES += \
-	$(nodist_keymap_SOURCES)
-
-udevlibexec_PROGRAMS += \
-	keymap
-
-dist_doc_DATA += \
-	src/udev/keymap/README.keymap.txt
-
-dist_udevrules_DATA += \
-	src/udev/keymap/95-keymap.rules \
-	src/udev/keymap/95-keyboard-force-release.rules
-
-dist_udevhome_SCRIPTS = \
-	src/udev/keymap/findkeyboards \
-	src/udev/keymap/keyboard-force-release.sh
-
-TESTS += \
-	src/udev/keymap/check-keymaps.sh
-
-EXTRA_DIST += \
-	src/udev/keymap/check-keymaps.sh \
-	src/udev/keymap/keyboard-force-release.sh.in
-
-CLEANFILES += \
-	$(nodist_keymap_SOURCES) \
-	src/udev/keymap/keys.txt \
-	src/udev/keymap/keys-from-name.gperf \
-	src/udev/keymap/keyboard-force-release.sh
-
-udevkeymapdir = $(libexecdir)/udev/keymaps
-dist_udevkeymap_DATA = \
-	keymaps/acer \
-	keymaps/acer-aspire_5720 \
-	keymaps/acer-aspire_8930 \
-	keymaps/acer-aspire_5920g \
-	keymaps/acer-aspire_6920 \
-	keymaps/acer-travelmate_c300 \
-	keymaps/asus \
-	keymaps/compaq-e_evo \
-	keymaps/dell \
-	keymaps/dell-latitude-xt2 \
-	keymaps/everex-xt5000 \
-	keymaps/fujitsu-amilo_li_2732 \
-	keymaps/fujitsu-amilo_pa_2548 \
-	keymaps/fujitsu-amilo_pro_edition_v3505 \
-	keymaps/fujitsu-amilo_pro_v3205 \
-	keymaps/fujitsu-amilo_si_1520 \
-	keymaps/fujitsu-esprimo_mobile_v5 \
-	keymaps/fujitsu-esprimo_mobile_v6 \
-	keymaps/genius-slimstar-320 \
-	keymaps/hewlett-packard \
-	keymaps/hewlett-packard-2510p_2530p \
-	keymaps/hewlett-packard-compaq_elitebook \
-	keymaps/hewlett-packard-pavilion \
-	keymaps/hewlett-packard-presario-2100 \
-	keymaps/hewlett-packard-tablet \
-	keymaps/hewlett-packard-tx2 \
-	keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
-	keymaps/inventec-symphony_6.0_7.0 \
-	keymaps/lenovo-3000 \
-	keymaps/lenovo-ideapad \
-	keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
-	keymaps/lenovo-thinkpad_x6_tablet \
-	keymaps/lenovo-thinkpad_x200_tablet \
-	keymaps/lg-x110 \
-	keymaps/logitech-wave \
-	keymaps/logitech-wave-cordless \
-	keymaps/logitech-wave-pro-cordless \
-	keymaps/maxdata-pro_7000 \
-	keymaps/medion-fid2060 \
-	keymaps/medionnb-a555 \
-	keymaps/micro-star \
-	keymaps/module-asus-w3j \
-	keymaps/module-ibm \
-	keymaps/module-lenovo \
-	keymaps/module-sony \
-	keymaps/module-sony-old \
-	keymaps/module-sony-vgn \
-	keymaps/olpc-xo \
-	keymaps/onkyo \
-	keymaps/oqo-model2 \
-	keymaps/samsung-other \
-	keymaps/samsung-90x3a \
-	keymaps/samsung-sq1us \
-	keymaps/samsung-sx20s \
-	keymaps/toshiba-satellite_a100 \
-	keymaps/toshiba-satellite_a110 \
-	keymaps/toshiba-satellite_m30x \
-	keymaps/zepto-znote
-
-udevkeymapforcereldir = $(libexecdir)/udev/keymaps/force-release
-dist_udevkeymapforcerel_DATA = \
-	keymaps-force-release/dell-touchpad \
-	keymaps-force-release/dell-xps \
-	keymaps-force-release/hp-other \
-	keymaps-force-release/samsung-other \
-	keymaps-force-release/samsung-90x3a \
-	keymaps-force-release/common-volume-keys
-
-src/udev/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
-	$(AM_V_at)mkdir -p src/udev/keymap
-	$(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
-
-src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt
-	$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
-
-src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf Makefile
-	$(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
-
-src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
-	$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
-endif
-
-# ------------------------------------------------------------------------------
-mtd_probe_SOURCES =  \
-	src/udev/mtd_probe/mtd_probe.c \
-	src/udev/mtd_probe/mtd_probe.h \
-	src/udev/mtd_probe/probe_smartmedia.c
-
-mtd_probe_CPPFLAGS = \
-	$(AM_CPPFLAGS)
-
-dist_udevrules_DATA += \
-	rules/75-probe_mtd.rules
-
-udevlibexec_PROGRAMS += \
-	mtd_probe
-
-# ------------------------------------------------------------------------------
 libsystemd_id128_la_SOURCES = \
 	src/libsystemd-id128/sd-id128.c
 
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH] Allow configuring without systemd-only dependencies
From: Bryan Kadzban @ 2012-06-09  7:01 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <4FD19D14.2070109@kadzban.is-a-geek.net>

William Hubbs wrote:
> On Thu, Jun 07, 2012 at 11:35:00PM -0700, Bryan Kadzban wrote:
>> Some dependencies (intltool, m4, dbus, pkg-config, PAM) are only
>> required or useful for systemd, not for udev.  Leave these required by
>> default, but allow them to be made optional if the right flag is used to
>> ./configure.
> 
> How about using --disable-systemd to take out these dependencies instead
> of adding another switch?

Well, this is the minimum to let us (LFS) at least get a build process
together to upgrade from udev-182.  systemd as-is has too many build
dependencies for us to use it the way it is today.  I figured I'd see
what upstream thought about just doing the minimum we need first.  (We
can override variables at make time to build just the udev binary and
helpers.)

But if a --disable-systemd switch ends up getting committed, sure,
that'd work too.

^ permalink raw reply

* Race condition that a serio driver would not be loaded
From: Eric Miao @ 2012-06-15  9:18 UTC (permalink / raw)
  To: linux-hotplug

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

Hi Kay & Greg,

There's a problem with udev's default 80-drivers.rules, that a modprobe be
only done when DRIVER!="?*". Here is a race condition that we recently
identified where psmouse would not be correctly loaded, and thus causing
the touchpad not usable. Below is my theory:

1. serio ports (e.g. AUX port for touchpad) are different than other
devices that:
   - the kernel is using a dedicated kernel thread kseriod to handle the events
   - interrupts on serio port will trigger connect attempt, as the OS
has no idea
     when a keyboard/mouse could be plugged into the computer

2. The AT keyboard driver atkbd.c is by default built-in to the kernel for speed
up as there will be normally an AT keyboard present, however, as on a normal
PC, the keyboard can be connected to either the keyboard PS/2 port (i.e. KBD
port), or the mouse PS/2 port (i.e. AUX port), the atkbd driver will be probed
each time an interrupt is generated on the AUX port, in case there is a plug.

3. When doing the probing, the serio1 device will be temporarily binded with
atkbd, and this is in the context of kseriod

4. udev has the chance of being launched at the same time, the time that
udev is launched, there will be a trigger to replay all uevents

5. that trigger will request uevents to be generated from the kernel, and if
serio1 happens to be in the middle of a probing (most likely with atkbd),
the uevent generated will have DRIVER=atkbd with it

6. psmouse is being built as a module, udev is following the rule below to load
psmouse on demand:

  /lib/udev/rules.d/80-drivers.rules:
  ...
  DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv $env{MODALIAS}"

7. So if uevent for serio1 happens to be with DRIVER entry, this rule
will _not_ be
performed as DRIVER!="?*" is _not_ matched, thus modprobe will not load psmouse

8. One simple fix is to add one additional rule to 80-drivers.rules,
so that serio
events are treated special that modprobe will anyway be performed, e.g.

  SUBSYSTEM=="serio", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv
$env{MODALIAS}"

I'm using udev-173 to generate the  attached diff, think the same theory applies
to the latest udev as well.

The fix is still under testing, as the race condition itself is rarely
happening (chance
will be more likely if manually generating activities on the touchpad
during startup)
but so far (50+ reboot) no further issue has been observed.

[-- Attachment #2: fix-race-condition-of-serio-driver-module-not-loading.patch --]
[-- Type: application/octet-stream, Size: 636 bytes --]

diff --git a/rules/rules.d/80-drivers.rules b/rules/rules.d/80-drivers.rules
index 04a86bd..740c67e 100644
--- a/rules/rules.d/80-drivers.rules
+++ b/rules/rules.d/80-drivers.rules
@@ -3,6 +3,7 @@
 ACTION=="remove", GOTO="drivers_end"
 
 DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv $env{MODALIAS}"
+SUBSYSTEM=="serio", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv $env{MODALIAS}"
 SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -bv tifm_sd"
 SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe -bv tifm_ms"
 SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -bv --all ms_block mspro_block"

^ permalink raw reply related

* Re: Getting Hot Plug/Unplug Notification
From: Greg KH @ 2012-06-18 18:23 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Jun 18, 2012 at 11:49:32PM +0530, madhav chauhan wrote:
> Hi All,
> I want to get hot plug event  in my  C code whenever USB device is
> plugged in/out.

Link to libudev for this.

> How can i get VID/PID of USB device plugged out/in??

Yes.

> Can somebody help me for the same, any  sample code available??

Look at the libudev examples, they should help you out.

Hope this helps,

greg k-h

^ permalink raw reply

* Getting Hot Plug/Unplug Notification
From: madhav chauhan @ 2012-06-18 18:31 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <20120618182313.GA11591@kroah.com>

Hi All,
I want to get hot plug event  in my  C code whenever USB device is
plugged in/out.
How can i get VID/PID of USB device plugged out/in??
Can somebody help me for the same, any  sample code available??


Regards,
Madhav

^ permalink raw reply

* [ANNOUNCE] kmod 9
From: Lucas De Marchi @ 2012-06-19 22:57 UTC (permalink / raw)
  To: linux-modules; +Cc: LKML, linux-hotplug

Hey!

kmod 9 is out:

ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-9.tar.xz
ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-9.tar.sign

Mainly improvements to the testsuite but users will mostly notice the
bugfixes and that now depmod checks for errors while writing the
indexes. Also some small fixes to libkmod while dealing with
compressed modules. Check the NEWS file fora additional information.

Shortlog is below

Lucas De Marchi

---

Dan McGee (3):
      testsuite: ship testsuite/rootfs unzipped
      test-conversion: convert test-blacklist to new infrastructure
      test-conversion: convert test-get-dependencies to new infrastructure

Dave Reisner (4):
      libkmod-file: gracefully handle errors from zlib
      depmod: report failures in loading symbols
      bootstrap-configure: quote command line arg expansion
      bootstrap: remove unnecessary echo

Josh Boyer (1):
      doc: Don't reference /etc/modprobe.conf

Lucas De Marchi (44):
      Remove dead assignment
      Return error instead of always 0
      Remove dead increment
      Revert "libkmod: make sure to export kmod_log"
      build: remove private symbol from linker script
      build-sys: distribute testsuite
      build-sys: copy rootfs to another directory
      libkmod-util: copy macros for unaligned access from BlueZ
      libkmod-hash: use generic function for unaligned access
      libkmod-index: use generic function for unaligned access
      Don't use __ for attribute defines
      Silence clang warnings with __unused__ attribute
      testsuite: fix find_module() finding wrong module
      build-sys: provide --sysconfdir to make distcheck flags
      testsuite: rename rootfs dir
      libkmod-util: add missing stdbool.h include
      testsuite: separate insert and delete rootfs from modinfo
      testsuite: check if rootfs dir is dirty before running
      testsuite: trap calls to mkdir
      testsuite: add mkdir_p implementation
      testsuite: create initstate file upon fake init_module()
      testsuite: set default init_module behavior to mimic kernel's
      testsuite: check if module is in kernel for return code
      testsuite: add test for softdep loops
      libkmod-util: split function for usec conversion
      testsuite: create additional pipe to monitor child
      testsuite: add timeout for each test
      testsuite: allow to export custom env vars
      testsuite: add test for install-commands loop
      libkmod-index: protect ourselves from corrupted indexes
      testsuite: Fix test description
      TODO: update tasks
      libkmod-config: refactor functions to get config
      tools: rename source files
      build-sys: add missing header to fix distcheck
      Remove ifdef for building tools not bundled
      depmod: don't return error if modules.builtin don't exist
      depmod: fail if any index could not be created
      depmod: fix coding-style issue in array declaration
      depmod: return error when index is truncated due to ENOSPC
      depmod: use ferror and fclose to check for error
      build-sys: Make dirs writable on rootfs creation
      build-sys: allow compressed modules in testsuite
      kmod 9

Mike Frysinger (2):
      libkmod: make sure to export kmod_log
      libkmod: move function to the only file using it

^ permalink raw reply

* add loop device backing file in udev database
From: quidame @ 2012-06-28 10:39 UTC (permalink / raw)
  To: linux-hotplug

Hi,

Since kernel 2.6.37, some infos are available in /sys for associated 
loop devices, especially the backing file. Is it poosible to introduce 
the BACKING_FILE variable for associated loop devices ?

This sample

ACTION="add|change", \
         KERNEL="loop?*", \
         SUBSYSTEM="block", \
         TEST="%S/block/%k/loop/backing_file", \
         PROGRAM="/bin/cat %S/block/%k/loop/backing_file", \
         ENV{BACKING_FILE}="%c"

works fine.

I have already send a bug report to the Debian maintainer 
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bugg1546) who has 
recommended me to directly propose this change to the upstream 
maintainer.

Thanks
quidame

^ permalink raw reply

* Re: add loop device backing file in udev database
From: Kay Sievers @ 2012-06-28 11:11 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <5deaf9514b7dafac35d4cdef91260ba1@poivron.org>

On Thu, Jun 28, 2012 at 12:39 PM,  <quidame@poivron.org> wrote:
> Since kernel 2.6.37, some infos are available in /sys for associated loop
> devices, especially the backing file. Is it poosible to introduce the
> BACKING_FILE variable for associated loop devices ?

Why would you *ever* want to mirror easily in /sys accessible kernel variables?

That is usually the wrong thing to do, because it can get out-of-sync,
and udev would pretend something that is not true anymore.

Kay

^ permalink raw reply

* Re: add loop device backing file in udev database
From: quidame @ 2012-06-28 14:38 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <5deaf9514b7dafac35d4cdef91260ba1@poivron.org>

Hi,

Le 2012-06-28 13:11, Kay Sievers a écrit :
> On Thu, Jun 28, 2012 at 12:39 PM,  <quidame@poivron.org> wrote:
>> Since kernel 2.6.37, some infos are available in /sys for associated 
>> loop
>> devices, especially the backing file. Is it poosible to introduce 
>> the
>> BACKING_FILE variable for associated loop devices ?
>
> Why would you *ever* want to mirror easily in /sys accessible kernel
> variables?

Because it reflects the status of a block device. If I run
# losetup /dev/loop0 /dev/sda1
# udevadm info --attribute-walk --name loop0
[...]
      ATTR{removable}="0"
      ATTR{ro}="0"
      ATTR{size}="4096512"
[...]
Nothing about the backing file, except we know the loop device is 
associated because its size is not "0". Its a poor and unusable 
information. And yes, the backing file name is easily accessible in 
/sys; but it is also the case for "removable", "ro" and "size". (OK, 
this is not about "ENV{BACKING_FILE}", but "ATTR{backing_file}". The 
first one was a suggestion, the second one is another.)

> That is usually the wrong thing to do, because it can get 
> out-of-sync,
> and udev would pretend something that is not true anymore.

Not sure:

# losetup -d /dev/loop0
# losetup /dev/loop0 /dev/sdc1  # sdc is USB stick
# udevadm info --export --query property --name loop0
BACKING_FILE='/dev/sdc1'
DEVLINKS='/dev/disk/by-label/mini /dev/disk/by-uuid/7B55-DC7E'
DEVNAME='/dev/loop0'
DEVPATH='/devices/virtual/block/loop0'
DEVTYPE='disk'
ID_FS_LABEL='mini'
ID_FS_LABEL_ENC='mini'
ID_FS_TYPE='vfat'
ID_FS_USAGE='filesystem'
ID_FS_UUID='7B55-DC7E'
ID_FS_UUID_ENC='7B55-DC7E'
ID_FS_VERSION='FAT32'
MAJOR='7'
MINOR='0'
SUBSYSTEM='block'
UDEV_LOG='3'
UDISKS_PRESENTATION_NOPOLICY='1'
USEC_INITIALIZED='96227881'

I wildly remove the usb stick, and the same command leads to the same 
results. This means BACKING_FILE, DEVLINKS and ID_FS_* variables are 
'out-of-sync'.
But:
# udevadm trigger --sysname-match=loop0
# udevadm info --export --query=property --name=loop0
BACKING_FILE='/dev/sdc1 _deleted_'
DEVNAME='/dev/loop0'
DEVPATH='/devices/virtual/block/loop0'
DEVTYPE='disk'
MAJOR='7'
MINOR='0'
SUBSYSTEM='block'
UDEV_LOG='3'
UDISKS_PRESENTATION_NOPOLICY='1'
USEC_INITIALIZED='96227881'

And:
# losetup /dev/loop0
/dev/loop0: [0005]:39712 (/dev/sdc1)

Here you can see that the only one relevant information is
BACKING_FILE='/dev/sdc1 _deleted_'

But, really I don't care: if 'udevadm info --attribute-walk --name 
loop0' can provide something as
[...]
      ATTR{removable}="0"
      ATTR{ro}="0"
      ATTR{size}="7813120"
      ATTR{backing_file}="/dev/sdc1 (deleted)"
[...]
it' s the same for me. What do you think about that ?

Cheers,
quidame

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox