<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.hotplug.devel">
    <title>gmane.linux.hotplug.devel</title>
    <link>http://blog.gmane.org/gmane.linux.hotplug.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17716"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17715"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17714"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17713"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17712"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17711"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17710"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17706"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17704"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17702"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17701"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17700"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17698"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17696"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17695"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17694"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17693"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17691"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17690"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.hotplug.devel/17682"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17716">
    <title>Re: Lenovo IdeaPad S206</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17716</link>
    <description>&lt;pre&gt;Hi,

In the previous post, I had confused the "win" key with the "switch video"
key.  This is corrected now.  See attached.

I still have several questions:

switch video
------------
The key meant to switch video (mod F10) produces two scan codes.
In man showkey, there are some remarks, but I don't know what they mean.

$ keymap -i /input/event4
scan code: 0xDB
scan code: 0x19
(both scancodes emitted together only once on press,
nothing on longer hold, nothing on release)
$ showkey -s
0x19 on press
0x99 on release

** What does this mean, and how are such results to be used with udev rules?

camera off-on
-------------
I can't see that this key (mod F9) generates anything on any device,
although it does in fact seem to kill the USB-based camera.

** Any ideas?

kill key
----------
The kill key (mod F4) very effectively kills any terminal it's running
in, so I have yet to determine what scan codes it generates.

** Any ideas?
# key codes on Lenovo IdeaPad S206, and presumably the S200
0x81 reserved           # disable lenovo-ideapad mapping
0xB9 reserved           # disable lenovo-ideapad mapping
0xBA reserved           # disable lenovo-ideapad mapping
0xF1 f6                 # mod F6 touchpad toggle (disabled)
0x83 rfkill             # mod F7 handled in module-lenovo-ideapad-s206
0xCE micmute            # mod F8
#???? camera            # mod F9 can't find this in udev
#???? switchvideomode   # mod F10 emits multiple scancodes?
0xF0 display_off        # mod F11 
0xCC brightnessdown     # mod F12
0xD4 brightnessup       # mod ins
0xDB menu               # win key 
0x82 unknown            # QS key
&lt;/pre&gt;</description>
    <dc:creator>Steve White</dc:creator>
    <dc:date>2013-04-27T16:15:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17715">
    <title>RE:</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17715</link>
    <description>&lt;pre&gt;thx

-----Original Message-----
From: Tom Gundersen [mailto:teg&amp;lt; at &amp;gt;jklm.no] 
Sent: 2013年4月26日 15:01
To: snowyxx
Cc: linux-hotplug
Subject: Re:

On Fri, Apr 26, 2013 at 5:32 AM, snowyxx &amp;lt;snowyxx&amp;lt; at &amp;gt;126.com&amp;gt; wrote:

You should avoid renaming devices to ethX, this is racy and especially in recent udev versions it does not work.

You have two options:

1) Rename your devices to something not in the kernel namespace (e.g., lan0, lan1, ... or net0, net1, ...).

or

2) Use the predictable interface names, which is the default in recent versions. This will give you a new set of names (see [0] for details).

HTH,

Tom

[0]: &amp;lt;http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames&amp;gt;


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

&lt;/pre&gt;</description>
    <dc:creator>snowyxx</dc:creator>
    <dc:date>2013-04-27T06:48:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17714">
    <title>Lenovo IdeaPad S206</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17714</link>
    <description>&lt;pre&gt;Hi,

My new Lenovo IdeaPad S206 has a special button ("OneKey recovery system"
button) that I wanted to re-map to a sleep button.  I did this, and it
works well.  There is also a QS key, that one could profitably re-map.

Along the way realized that the generic IdeaPad mappings of the Ubuntu 12.10
distro are largely incompatible with the keys on this computer.
So I set out to remedy that.

I'm not sure I'm following best practices though.  In particular, should
existing IdeaPad rules be restricted, or should the mappings be overridden?

I have some evidence that the mappings here should also work for the S200,
but I'm pretty sure they *aren't* appropriate for the S205.
  ________________________________
$ cat /sys/class/dmi/id/sys_vendor
LENOVO
$ cat /sys/class/dmi/id/product_name
2638
$ cat /sys/class/dmi/id/product_version
Lenovo IdeaPad S206
  ________________________________
The OneKey button on this machine is perfect for a sleep button:
it is easily accessible, but impossible to press accidentally.

To simply re-map the OneKey button, I first observed:
A 0x10 press-release pair is emitted if the button is given a substantial
press, and released. After about 3 sec of continuous pressing,
a 0x11 press-release pair is emitted.

I put a rule like this under "keyboard_modulecheck":
  ________________________________
ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="Ideapad extra buttons", ATTR{[dmi/id]product_version}=="*S206|*S200", RUN+="keymap $name 0x10 sleep 0x11 hibernate"
  ________________________________
For the other keys, I have made a keymap file, which at least gets the proper
mappings going.  I'm not sure if I really improved anything.  See attached.

For one thing, some of the keys don't seem to make scan codes on any device
(the camera key on the F9 key.) Some seem to work regardless of how I map
them -- I guess that means they're going straight to hardware and the
system just reads the hardware state.

I'll be glad to hear what you think!

# key codes on Lenovo IdeaPad S206, and presumably the S200
0x81 reserved           # disable lenovo-ideapad mapping
0xB9 reserved           # disable lenovo-ideapad mapping
0xBA reserved           # disable lenovo-ideapad mapping
0xF1 f6                 # on F6 touchpad toggle (disabled)
0x83 rfkill             # on F7 handled in module-lenovo-ideapad-s206
0xCE micmute            # on F8
#???? camera            # on F9 can't find this in udev
0xDB switchvideomode    # on F10 
0xF0 display_off        # on F11 
0xCC brightnessdown     # on F12
0xD4 brightnessup       # on ins
0x82 unknown            # QS key
&lt;/pre&gt;</description>
    <dc:creator>Steve White</dc:creator>
    <dc:date>2013-04-26T08:46:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17713">
    <title>Re:</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17713</link>
    <description>&lt;pre&gt;
You should avoid renaming devices to ethX, this is racy and especially
in recent udev versions it does not work.

You have two options:

1) Rename your devices to something not in the kernel namespace (e.g.,
lan0, lan1, ... or net0, net1, ...).

or

2) Use the predictable interface names, which is the default in recent
versions. This will give you a new set of names (see [0] for details).

HTH,

Tom

[0]: &amp;lt;http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames&amp;gt;
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Tom Gundersen</dc:creator>
    <dc:date>2013-04-26T07:00:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17712">
    <title>(unknown)</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17712</link>
    <description>&lt;pre&gt;Hi Boss,
So sorry to mail you in this rude way (if you look into this mail, I know is
not support mail, but god guide missing people, right?  )
I am finding a solution to my problem.
I have some machines with 8 net interfaces, I want to name one as eth0, I
need a solution to work for all machine ( I will clone OS from one to
others), so I could not just modify the rule file under /etc/udev/rules.d 

I need setup a math condition works for all machine. 
I want to change  /lib/udev/rules.d/75-persistent-net-generator.rules file
to only match MACs
But my problem is that interface names turn out did not ordered by MACs,
It suppose  00:0d:48:08:92:9a named as eth0, but not.

Is there any way to let interfaces named by MACs order? 

root&amp;lt; at &amp;gt;APM:~# dmesg |grep eth
[   10.429663] e1000e 0000:03:00.0: eth0: (PCI Express:2.5GB/s:Width x4)
00:0d:48:08:92:9b
[   10.429665] e1000e 0000:03:00.0: eth0: Intel(R) PRO/1000 Network
Connection
[   10.429742] e1000e 0000:03:00.0: eth0: MAC: 0, PHY: 1, PBA No: C85839-002
[   12.421678] e1000e 0000:03:00.1: eth1: (PCI Express:2.5GB/s:Width x4)
00:0d:48:08:92:9a
[   12.421680] e1000e 0000:03:00.1: eth1: Intel(R) PRO/1000 Network
Connection
[   12.421756] e1000e 0000:03:00.1: eth1: MAC: 0, PHY: 1, PBA No: C85839-002
[   16.061712] e1000e 0000:04:00.0: eth2: (PCI Express:2.5GB/s:Width x4)
00:0d:48:08:92:9d
[   16.061714] e1000e 0000:04:00.0: eth2: Intel(R) PRO/1000 Network
Connection
[   16.061791] e1000e 0000:04:00.0: eth2: MAC: 0, PHY: 1, PBA No: C85839-002
[   17.041738] e1000e 0000:04:00.1: eth3: (PCI Express:2.5GB/s:Width x4)
00:0d:48:08:92:9c
[   17.041740] e1000e 0000:04:00.1: eth3: Intel(R) PRO/1000 Network
Connection
[   17.041817] e1000e 0000:04:00.1: eth3: MAC: 0, PHY: 1, PBA No: C85839-002
[   17.582614] e1000e 0000:08:00.0: eth4: (PCI Express:2.5GB/s:Width x1)
00:0d:48:27:86:9d
[   17.582616] e1000e 0000:08:00.0: eth4: Intel(R) PRO/1000 Network
Connection
[   17.582694] e1000e 0000:08:00.0: eth4: MAC: 4, PHY: 8, PBA No: FFFFFF-0FF
[   17.697014] e1000e 0000:07:00.0: eth5: (PCI Express:2.5GB/s:Width x1)
00:0d:48:27:86:9c
[   17.697016] e1000e 0000:07:00.0: eth5: Intel(R) PRO/1000 Network
Connection
[   17.697094] e1000e 0000:07:00.0: eth5: MAC: 4, PHY: 8, PBA No: FFFFFF-0FF
[   17.818793] e1000e 0000:06:00.0: eth6: (PCI Express:2.5GB/s:Width x1)
00:0d:48:27:86:9b
[   17.818794] e1000e 0000:06:00.0: eth6: Intel(R) PRO/1000 Network
Connection
[   17.818872] e1000e 0000:06:00.0: eth6: MAC: 4, PHY: 8, PBA No: FFFFFF-0FF
[   17.938778] e1000e 0000:05:00.0: eth7: (PCI Express:2.5GB/s:Width x1)
00:0d:48:27:86:9a
[   17.938780] e1000e 0000:05:00.0: eth7: Intel(R) PRO/1000 Network
Connection
[   17.938859] e1000e 0000:05:00.0: eth7: MAC: 4, PHY: 8, PBA No: FFFFFF-0FF


Yan Xiao








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

&lt;/pre&gt;</description>
    <dc:creator>snowyxx</dc:creator>
    <dc:date>2013-04-26T03:32:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17711">
    <title>Re: [PATCH v3] tools: add static-nodes tool</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17711</link>
    <description>&lt;pre&gt;
Thanks for the suggestions Thomas. I implemented most of them, so now
it should be a lot simpler to extend this in the future.

The only thing I skipped was the --format=? idea, as this info is
already in the help output, and I'm not sure how useful it is to
parse. That said, it could easily be added follow-up patch if there is
a need for it.

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

&lt;/pre&gt;</description>
    <dc:creator>Tom Gundersen</dc:creator>
    <dc:date>2013-04-16T20:32:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17710">
    <title>Re: [PATCH v3] tools: add static-nodes tool</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17710</link>
    <description>&lt;pre&gt;On Tue, Apr 16, 2013 at 8:51 PM, Lucas De Marchi
&amp;lt;lucas.demarchi&amp;lt; at &amp;gt;profusion.mobi&amp;gt; wrote:


Sounds all good to me.

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

&lt;/pre&gt;</description>
    <dc:creator>Kay Sievers</dc:creator>
    <dc:date>2013-04-16T19:08:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17706">
    <title>[PATCH v3] tools: add static-nodes tool</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17706</link>
    <description>&lt;pre&gt;This tool reads modules.devname from the current kernel directory and outputs
the information. By default in a human-readable format, and optionally in
machine-readable formats.

For now only the tmpfiles.d(5) format is supported, but more could easily be
added in the future if there is a need.

This means nothing but kmod needs to reads the private files under
/lib/modules/. In particular systemd-udevd can stop reading modules.devname.

Cc: &amp;lt;linux-hotplug&amp;lt; at &amp;gt;vger.kernel.org&amp;gt;
Cc: &amp;lt;systemd-devel&amp;lt; at &amp;gt;lists.freedesktop.org&amp;gt;tools: static-nodes
---

v3: dropped the systemd integration for now, we can decide on that separately
    added human-readable format and use this by default
    added a --format= switch to get the tmpfiles format

 Makefile.am          |   3 +-
 tools/kmod.c         |   1 +
 tools/kmod.h         |   1 +
 tools/static-nodes.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 180 insertions(+), 1 deletion(-)
 create mode 100644 tools/static-nodes.c

diff --git a/Makefile.am b/Makefile.am
index fe4c769..b1bfd59 100644
--- a/Makefile.am
+++ b/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -110,7 +110,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
 tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
      tools/rmmod.c tools/insmod.c \
      tools/modinfo.c tools/modprobe.c \
-     tools/depmod.c tools/log.h tools/log.c
+     tools/depmod.c tools/log.h tools/log.c \
+     tools/static-nodes.c
 tools_kmod_LDADD = libkmod/libkmod-util.la \
    libkmod/libkmod.la
 
diff --git a/tools/kmod.c b/tools/kmod.c
index ebb8875..347bb7d 100644
--- a/tools/kmod.c
+++ b/tools/kmod.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -37,6 +37,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const struct kmod_cmd kmod_cmd_help;
 static const struct kmod_cmd *kmod_cmds[] = {
 &amp;amp;kmod_cmd_help,
 &amp;amp;kmod_cmd_list,
+&amp;amp;kmod_cmd_static_nodes,
 };
 
 static const struct kmod_cmd *kmod_compat_cmds[] = {
diff --git a/tools/kmod.h b/tools/kmod.h
index 80fa4c2..68a646a 100644
--- a/tools/kmod.h
+++ b/tools/kmod.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -35,5 +35,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern const struct kmod_cmd kmod_cmd_compat_modprobe;
 extern const struct kmod_cmd kmod_cmd_compat_depmod;
 
 extern const struct kmod_cmd kmod_cmd_list;
+extern const struct kmod_cmd kmod_cmd_static_nodes;
 
 #include "log.h"
diff --git a/tools/static-nodes.c b/tools/static-nodes.c
new file mode 100644
index 0000000..3d0582a
--- /dev/null
+++ b/tools/static-nodes.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,176 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * kmod-static-nodes - manage modules.devname
+ *
+ * Copyright (C) 2004-2012 Kay Sievers &amp;lt;kay&amp;lt; at &amp;gt;vrfy.org&amp;gt;
+ * Copyright (C) 2011-2013  ProFUSION embedded systems
+ * Copyright (C) 2013 Tom Gundersen &amp;lt;teg&amp;lt; at &amp;gt;jklm.no&amp;gt;
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.
+ */
+
+#include &amp;lt;stdio.h&amp;gt;
+#include &amp;lt;stdlib.h&amp;gt;
+#include &amp;lt;stddef.h&amp;gt;
+#include &amp;lt;getopt.h&amp;gt;
+#include &amp;lt;errno.h&amp;gt;
+#include &amp;lt;unistd.h&amp;gt;
+#include &amp;lt;string.h&amp;gt;
+#include &amp;lt;limits.h&amp;gt;
+#include &amp;lt;sys/utsname.h&amp;gt;
+#include &amp;lt;sys/stat.h&amp;gt;
+#include &amp;lt;sys/types.h&amp;gt;
+#include "libkmod-util.h"
+
+#include "kmod.h"
+
+static const char cmdopts_s[] = "o:f:h";
+static const struct option cmdopts[] = {
+        { "output", required_argument, 0, 'o'},
+        { "format", required_argument, 0, 'f'},
+        { "help", no_argument, 0, 'h'},
+        { },
+};
+
+static void help(void)
+{
+        printf("Usage:\n"
+                "\t%s static-nodes [options]\n"
+                "\n"
+                "kmod static-nodes outputs the static-node information of the currently running kernel.\n"
+                "\n"
+                "Options:\n"
+                "\t-f, --format=FORMAT  use a machine-readable format\n"
+                "\t-o, --output=FILE    write output to file\n"
+                "\t-h, --help           show this help\n"
+                "\n"
+                "Formats:\n"
+                "  tmpfiles    the tmpfiles.d(5) format used by systemd-tmpfiles.\n",
+                program_invocation_short_name);
+}
+
+static void write_human(FILE *out, char module[], char devname[], char type, unsigned int maj, unsigned int min)
+{
+        fprintf(out,
+                        "Module: %s\n"
+                        "\tDevice node: /dev/%s\n"
+                        "\t\tType: %s device\n"
+                        "\t\tMajor: %u\n"
+                        "\t\tMinor: %u\n",
+                        module, devname, (type == 'c') ? "character" : "block", maj, min);
+        return;
+}
+
+static void write_tmpfile(FILE *out, char devname[], char type, unsigned int maj, unsigned int min)
+{
+        fprintf(out, "%c /dev/%s 0600 - - - %u:%u\n", type, devname, maj, min);
+        return;
+}
+
+static int do_static_nodes(int argc, char *argv[])
+{
+        struct utsname kernel;
+        char modules[PATH_MAX];
+        FILE *in = NULL, *out = stdout;
+        bool human_readable = 1;
+        char buf[4096];
+        int ret = EXIT_SUCCESS;
+
+        for (;;) {
+                int c, idx = 0;
+
+                c = getopt_long(argc, argv, cmdopts_s, cmdopts, &amp;amp;idx);
+                if (c == -1) {
+                        break;
+                }
+                switch (c) {
+                case 'o':
+                        out = fopen(optarg, "we");
+                        if (out == NULL) {
+                                fprintf(stderr, "Error: could not create %s!\n", optarg);
+                                ret = EXIT_FAILURE;
+                                goto finish;
+                        }
+                        break;
+                case 'f':
+                        if (!streq(optarg, "tmpfiles")) {
+                                fprintf(stderr, "Unknown format: '%s'.\n", argv[1]);
+                                help();
+                                ret = EXIT_FAILURE;
+                                goto finish;
+                        }
+                        human_readable = 0;
+                        break;
+                case 'h':
+                        help();
+                        goto finish;
+                case '?':
+                        ret = EXIT_FAILURE;
+                        goto finish;
+                default:
+                        fprintf(stderr, "Unexpected commandline option '%c'.\n", c);
+                        help();
+                        ret = EXIT_FAILURE;
+                        goto finish;
+                }
+        }
+
+        if (uname(&amp;amp;kernel) &amp;lt; 0) {
+                fputs("Error: uname failed!\n", stderr);
+                ret = EXIT_FAILURE;
+                goto finish;
+        }
+        snprintf(modules, sizeof(modules), "/lib/modules/%s/modules.devname", kernel.release);
+        in = fopen(modules, "re");
+        if (in == NULL &amp;amp;&amp;amp; errno != ENOENT) {
+                fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname!\n", kernel.release);
+                ret = EXIT_FAILURE;
+                goto finish;
+        }
+
+        while (fgets(buf, sizeof(buf), in) != NULL) {
+                char module[PATH_MAX];
+                char devname[PATH_MAX];
+                char type;
+                unsigned int maj, min;
+                int matches;
+
+                if (buf[0] == '#')
+                        continue;
+
+                matches = sscanf(buf, "%s %s %c%u:%u", module, devname, &amp;amp;type, &amp;amp;maj, &amp;amp;min);
+                if (matches != 5 || (type != 'c' &amp;amp;&amp;amp; type != 'b')) {
+                        fprintf(stderr, "Error: invalid devname entry: %s", buf);
+                        ret = EXIT_FAILURE;
+                        continue;
+                }
+
+                if (human_readable)
+                        write_human(out, module, devname, type, maj, min);
+                else
+                        write_tmpfile(out, devname, type, maj, min);
+        }
+
+finish:
+        if (in)
+                fclose(in);
+        if (out)
+                fclose(out);
+        return ret;
+}
+
+const struct kmod_cmd kmod_cmd_static_nodes = {
+.name = "static-nodes",
+.cmd = do_static_nodes,
+.help = "outputs the static-node information of the currently running kernel",
+};
&lt;/pre&gt;</description>
    <dc:creator>Tom Gundersen</dc:creator>
    <dc:date>2013-04-16T13:12:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17704">
    <title>[PATCH v2] tools: add static-nodes tool</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17704</link>
    <description>&lt;pre&gt;This tool reads modules.devname from the current kernel directory and outputs
the information.

For now only the tmpfiles.d(5) format is supported, but more could easily be
added in the future if there is a need.

When booting with systemd, the new tool is called at boot to instruct
systemd-tmpfiles to create the necessary static modules before starting
systemd-udevd.

This means nothing but kmod needs to reads the private files under /lib/modules/.

Cc: &amp;lt;linux-hotplug&amp;lt; at &amp;gt;vger.kernel.org&amp;gt;
Cc: &amp;lt;systemd-devel&amp;lt; at &amp;gt;lists.freedesktop.org&amp;gt;
---

v2: adressed concerns raised by Dave, and made the tool a bit more generic so
more output formats may be added in the future as suggested by Lucas. Also
included the systemd unit file to hook this up with systemd.

 Makefile.am                        |  20 ++++-
 configure.ac                       |   8 ++
 tools/kmod-static-nodes.service.in |  16 ++++
 tools/kmod.c                       |   1 +
 tools/kmod.h                       |   1 +
 tools/static-nodes.c               | 163 +++++++++++++++++++++++++++++++++++++
 6 files changed, 207 insertions(+), 2 deletions(-)
 create mode 100644 tools/kmod-static-nodes.service.in
 create mode 100644 tools/static-nodes.c

diff --git a/Makefile.am b/Makefile.am
index 9feaf96..333e861 100644
--- a/Makefile.am
+++ b/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -36,6 +36,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; SED_PROCESS = \
 %.pc: %.pc.in Makefile
 $(SED_PROCESS)
 
+%.service: %.service.in Makefile
+$(SED_PROCESS)
+
 LIBKMOD_CURRENT=4
 LIBKMOD_REVISION=2
 LIBKMOD_AGE=2
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -88,6 +91,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; pkgconfig_DATA = libkmod/libkmod.pc
 EXTRA_DIST += libkmod/libkmod.pc.in
 CLEANFILES += libkmod/libkmod.pc
 
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = tools/kmod-static-nodes.service
+EXTRA_DIST += tools/kmod-static-nodes.service.in
+CLEANFILES += tools/kmod-static-nodes.service
+
+install-data-hook:
+$(MKDIR_P) $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants
+ln -sf ../kmod-static-nodes.service \
+$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/kmod-static-nodes.service
+endif
+
 install-exec-hook:
 if test "$(libdir)" != "$(rootlibdir)"; then \
 $(MKDIR_P) $(DESTDIR)$(rootlibdir) &amp;amp;&amp;amp; \
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -109,7 +123,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
 tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
      tools/rmmod.c tools/insmod.c \
      tools/modinfo.c tools/modprobe.c \
-     tools/depmod.c tools/log.h tools/log.c
+     tools/depmod.c tools/log.h tools/log.c \
+     tools/static-nodes.c
 tools_kmod_LDADD = libkmod/libkmod-util.la \
    libkmod/libkmod.la
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -211,7 +226,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; testsuite-distclean:
 DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
 EXTRA_DIST += testsuite/rootfs-pristine
 
-DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib
+DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib \
+  --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 
diff --git a/configure.ac b/configure.ac
index 566b317..af5ed52 100644
--- a/configure.ac
+++ b/configure.ac
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -76,6 +76,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; AS_IF([test "x$with_zlib" != "xno"], [
 AC_MSG_NOTICE([zlib support not requested])
 ])
 
+AC_ARG_WITH([systemdsystemunitdir],
+            AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+            [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+        AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
 
 #####################################################################
 # --enable-
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -200,6 +207,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; AC_MSG_RESULT([
 compiler:${CC}
 cflags:${with_cflags} ${CFLAGS}
 ldflags:${with_ldflags} ${LDFLAGS}
+systemdsystemunitdir:   ${with_systemdsystemunitdir}
 
 tools:${enable_tools}
 logging:${enable_logging}
diff --git a/tools/kmod-static-nodes.service.in b/tools/kmod-static-nodes.service.in
new file mode 100644
index 0000000..be8482e
--- /dev/null
+++ b/tools/kmod-static-nodes.service.in
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+#  This file is part of kmod.
+#
+#  kmod is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Create list of static nodes to be created in /dev
+DefaultDependencies=no
+Before=sysinit.target systemd-static-nodes.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/mkdir -p /run/tmpfiles.d
+ExecStart=&amp;lt; at &amp;gt;prefix&amp;lt; at &amp;gt;/bin/kmod static-nodes tmpfiles --output=/run/tmpfiles.d/kmod.conf
diff --git a/tools/kmod.c b/tools/kmod.c
index ebb8875..347bb7d 100644
--- a/tools/kmod.c
+++ b/tools/kmod.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -37,6 +37,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const struct kmod_cmd kmod_cmd_help;
 static const struct kmod_cmd *kmod_cmds[] = {
 &amp;amp;kmod_cmd_help,
 &amp;amp;kmod_cmd_list,
+&amp;amp;kmod_cmd_static_nodes,
 };
 
 static const struct kmod_cmd *kmod_compat_cmds[] = {
diff --git a/tools/kmod.h b/tools/kmod.h
index 80fa4c2..68a646a 100644
--- a/tools/kmod.h
+++ b/tools/kmod.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -35,5 +35,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern const struct kmod_cmd kmod_cmd_compat_modprobe;
 extern const struct kmod_cmd kmod_cmd_compat_depmod;
 
 extern const struct kmod_cmd kmod_cmd_list;
+extern const struct kmod_cmd kmod_cmd_static_nodes;
 
 #include "log.h"
diff --git a/tools/static-nodes.c b/tools/static-nodes.c
new file mode 100644
index 0000000..a79fc3d
--- /dev/null
+++ b/tools/static-nodes.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,163 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * kmod-static-nodes - manage modules.devname
+ *
+ * Copyright (C) 2004-2012 Kay Sievers &amp;lt;kay&amp;lt; at &amp;gt;vrfy.org&amp;gt;
+ * Copyright (C) 2011-2013  ProFUSION embedded systems
+ * Copyright (C) 2013 Tom Gundersen &amp;lt;teg&amp;lt; at &amp;gt;jklm.no&amp;gt;
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.
+ */
+
+#include &amp;lt;stdio.h&amp;gt;
+#include &amp;lt;stdlib.h&amp;gt;
+#include &amp;lt;stddef.h&amp;gt;
+#include &amp;lt;getopt.h&amp;gt;
+#include &amp;lt;errno.h&amp;gt;
+#include &amp;lt;unistd.h&amp;gt;
+#include &amp;lt;string.h&amp;gt;
+#include &amp;lt;limits.h&amp;gt;
+#include &amp;lt;sys/utsname.h&amp;gt;
+#include &amp;lt;sys/stat.h&amp;gt;
+#include &amp;lt;sys/types.h&amp;gt;
+#include "libkmod-util.h"
+
+#include "kmod.h"
+
+static const char cmdopts_s[] = "o:h";
+static const struct option cmdopts[] = {
+        { "output", required_argument, 0, 'o'},
+        { "help", no_argument, 0, 'h'},
+        { },
+};
+
+static void help(void)
+{
+        printf("Usage:\n"
+                "\t%s static-nodes format [options]\n"
+                "\n"
+                "kmod static-nodes outputs the static-node information of the currently running kernel.\n"
+                "\n"
+                "Options:\n"
+                "\t-o, --output=FILE  write output to file\n"
+                "\t-h, --help         show this help\n"
+                "\n"
+                "Formats:\n"
+                "  tmpfiles    the tmpfiles.d(5) used by systemd-tmpfiles.\n",
+                program_invocation_short_name);
+}
+
+static int write_tmpfile(FILE *in, FILE *out) {
+        char buf[4096];
+        int ret = EXIT_SUCCESS;
+
+        while (fgets(buf, sizeof(buf), in) != NULL) {
+                char devname[PATH_MAX];
+                char type;
+                unsigned int maj, min;
+                int matches;
+
+                if (buf[0] == '#')
+                        continue;
+
+                matches = sscanf(buf, "%*s %s %c%u:%u", devname, &amp;amp;type, &amp;amp;maj, &amp;amp;min);
+                if (matches != 4 || (type != 'c' &amp;amp;&amp;amp; type != 'b')) {
+                        fprintf(stderr, "Error: invalid devname entry: %s", buf);
+                        ret = EXIT_FAILURE;
+                        continue;
+                }
+
+                fprintf(out, "%c /dev/%s 0600 - - - %u:%u\n", type, devname, maj, min);
+        }
+
+        return ret;
+}
+
+static int do_static_nodes(int argc, char *argv[])
+{
+        struct utsname kernel;
+        char modules[PATH_MAX];
+        FILE *in = NULL, *out = stdout;
+        int ret = EXIT_SUCCESS;
+
+        for (;;) {
+                int c, idx = 0;
+
+                c = getopt_long(argc - 1, argv + 1, cmdopts_s, cmdopts, &amp;amp;idx);
+                if (c == -1) {
+                        break;
+                }
+                switch (c) {
+                case 'o':
+                        out = fopen(optarg, "we");
+                        if (out == NULL) {
+                                fprintf(stderr, "Error: could not create %s!\n", optarg);
+                                ret = EXIT_FAILURE;
+                                goto finish;
+                        }
+                        break;
+                case 'h':
+                        help();
+                        goto finish;
+                case '?':
+                        ret = EXIT_FAILURE;
+                        goto finish;
+                default:
+                        fprintf(stderr, "Unexpected commandline option '%c'.\n", c);
+                        help();
+                        ret = EXIT_FAILURE;
+                        goto finish;
+                }
+        }
+
+        if (argc &amp;lt; 2) {
+                help();
+                ret = EXIT_FAILURE;
+                goto finish;
+        }
+
+        if (!streq(argv[1], "tmpfiles")) {
+                fprintf(stderr, "Unknown format: '%s'.\n", argv[1]);
+                help();
+                ret = EXIT_FAILURE;
+                goto finish;
+        }
+
+        if (uname(&amp;amp;kernel) &amp;lt; 0) {
+                fputs("Error: uname failed!\n", stderr);
+                ret = EXIT_FAILURE;
+                goto finish;
+        }
+        snprintf(modules, sizeof(modules), "/lib/modules/%s/modules.devname", kernel.release);
+        in = fopen(modules, "re");
+        if (in == NULL &amp;amp;&amp;amp; errno != ENOENT) {
+                fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname!\n", kernel.release);
+                ret = EXIT_FAILURE;
+                goto finish;
+        }
+
+        ret = write_tmpfile(in, out);
+
+finish:
+        if (in)
+                fclose(in);
+        if (out)
+                fclose(out);
+        return ret;
+}
+
+const struct kmod_cmd kmod_cmd_static_nodes = {
+.name = "static-nodes",
+.cmd = do_static_nodes,
+.help = "outputs the static-node information of the currently running kernel",
+};
&lt;/pre&gt;</description>
    <dc:creator>Tom Gundersen</dc:creator>
    <dc:date>2013-04-13T00:15:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17702">
    <title>Re: Disabling device</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17702</link>
    <description>&lt;pre&gt;
As you are using RHEL6, why not ask for support for this type of
situation from Red Hat?  You are paying for the support, might as well
use it :)

Good luck,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Greg KH</dc:creator>
    <dc:date>2013-04-11T16:46:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17701">
    <title>Disabling device</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17701</link>
    <description>&lt;pre&gt;Hello,
I want to tell udev in RHEL6 _not_ to create a hard drive device in 
/dev/ identified by (for example) serial number. I see two problems:
1. AFAIK it is not possible to disable device creation in udev/rules.d/
2. It is not possible to identify device by serial number in udev. When 
I run: udevadm info -a -p $(udevadm info -q path -n /dev/sdak)
, it does not show me serial or other identifying information.

I need to get rid of this device because I'm sharing one disk array 
between two servers and both of them see all devices in the array.
I want to make sure the two servers are not accessing the drives 
simultaneously.

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

&lt;/pre&gt;</description>
    <dc:creator>Štefan Sakalík</dc:creator>
    <dc:date>2013-04-11T16:16:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17700">
    <title>[PATCH] [RFC] udevd: let tmpfiles create all static nodes</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17700</link>
    <description>&lt;pre&gt;systemd-tmpfiles has had support for creation of static nodes for some time (to
replace copying nodes from /lib/udev/). Make sure these nodes are created before
udev is started.

Also, drop support for creating static nodes based on modules.devname from
systemd-udevd. This allows it to run witohut CAP_MKNOD, moreover we no longer
need to parse /usr/lib/modules/*/modules.devname.

As a replacement for udevd's functionality, we let kmod generate a tmpfiles.d
fragment based on the correct modules.devname file (see separate patch). We
might want to split the kmod call out into its own unit file and ship that with
kmod instead.

Note: one functional change is that we no longer update the creation time on
already existing device nodes. Is this important? If so, should tmpfiles learn to
do that?

Cc: &amp;lt;linux-modules&amp;lt; at &amp;gt;vger.kernel.org&amp;gt;
Cc: &amp;lt;linux-hotplug&amp;lt; at &amp;gt;vger.kernel.org&amp;gt;
---
 Makefile.am                           |  5 +++
 TODO                                  |  4 --
 src/udev/udevd.c                      | 72 -----------------------------------
 units/systemd-static-nodes.service.in | 17 +++++++++
 units/systemd-udevd.service.in        |  5 +--
 5 files changed, 24 insertions(+), 79 deletions(-)
 create mode 100644 units/systemd-static-nodes.service.in

diff --git a/Makefile.am b/Makefile.am
index ec81f53..3c6adcb 100644
--- a/Makefile.am
+++ b/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -427,6 +427,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nodist_systemunit_DATA = \
 units/systemd-kexec.service \
 units/systemd-fsck&amp;lt; at &amp;gt;.service \
 units/systemd-fsck-root.service \
+units/systemd-static-nodes.service \
 units/systemd-udevd.service \
 units/systemd-udev-trigger.service \
 units/systemd-udev-settle.service \
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -468,6 +469,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; EXTRA_DIST += \
 units/systemd-fsck&amp;lt; at &amp;gt;.service.in \
 units/systemd-fsck-root.service.in \
 units/user&amp;lt; at &amp;gt;.service.in \
+units/systemd-static-nodes.service \
 units/systemd-udevd.service \
 units/systemd-udev-trigger.service \
 units/systemd-udev-settle.service \
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1925,11 +1927,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; CLEANFILES += \
 src/udev/udev.pc
 
 EXTRA_DIST += \
+units/systemd-static-nodes.service.in \
 units/systemd-udevd.service.in \
 units/systemd-udev-trigger.service.in \
 units/systemd-udev-settle.service.in
 
 CLEANFILES += \
+units/systemd-static-nodes.service \
 units/systemd-udevd.service \
 units/systemd-udev-trigger.service \
 units/systemd-udev-settle.service
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1938,6 +1942,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; SOCKETS_TARGET_WANTS += \
 systemd-udevd-control.socket \
 systemd-udevd-kernel.socket
 SYSINIT_TARGET_WANTS += \
+systemd-static-nodes.service \
 systemd-udevd.service \
 systemd-udev-trigger.service
 
diff --git a/TODO b/TODO
index 369fb78..d70732d 100644
--- a/TODO
+++ b/TODO
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -51,10 +51,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; Features:
   so that the coredump is properly written to the user's own journal
   file.
 
-* move /usr/lib/modules/$(uname -r)/modules.devname parsing from udevd to
-   kmod static-nodes
-  call kmod as an early service, and drop CAP_MKNOD from udevd.service
-
 * systemd-delta needs to be made aware of *.d/*.conf drop-in files for
   units.
 
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 2d9093d..642ca43 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -812,77 +812,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void handle_signal(struct udev *udev, int signo)
         }
 }
 
-static void static_dev_create_from_modules(struct udev *udev)
-{
-        struct utsname kernel;
-        char modules[UTIL_PATH_SIZE];
-        char buf[4096];
-        FILE *f;
-
-        if (uname(&amp;amp;kernel) &amp;lt; 0) {
-                log_error("uname failed: %m");
-                return;
-        }
-
-        strscpyl(modules, sizeof(modules), ROOTPREFIX "/lib/modules/", kernel.release, "/modules.devname", NULL);
-        f = fopen(modules, "re");
-        if (f == NULL)
-                return;
-
-        while (fgets(buf, sizeof(buf), f) != NULL) {
-                char *s;
-                const char *modname;
-                const char *devname;
-                const char *devno;
-                int maj, min;
-                char type;
-                mode_t mode;
-                char filename[UTIL_PATH_SIZE];
-
-                if (buf[0] == '#')
-                        continue;
-
-                modname = buf;
-                s = strchr(modname, ' ');
-                if (s == NULL)
-                        continue;
-                s[0] = '\0';
-
-                devname = &amp;amp;s[1];
-                s = strchr(devname, ' ');
-                if (s == NULL)
-                        continue;
-                s[0] = '\0';
-
-                devno = &amp;amp;s[1];
-                s = strchr(devno, ' ');
-                if (s == NULL)
-                        s = strchr(devno, '\n');
-                if (s != NULL)
-                        s[0] = '\0';
-                if (sscanf(devno, "%c%u:%u", &amp;amp;type, &amp;amp;maj, &amp;amp;min) != 3)
-                        continue;
-
-                mode  = 0600;
-                if (type == 'c')
-                        mode |= S_IFCHR;
-                else if (type == 'b')
-                        mode |= S_IFBLK;
-                else
-                        continue;
-
-                strscpyl(filename, sizeof(filename), "/dev/", devname, NULL);
-                mkdir_parents_label(filename, 0755);
-                label_context_set(filename, mode);
-                log_debug("mknod '%s' %c%u:%u\n", filename, type, maj, min);
-                if (mknod(filename, mode, makedev(maj, min)) &amp;lt; 0 &amp;amp;&amp;amp; errno == EEXIST)
-                        utimensat(AT_FDCWD, filename, NULL, 0);
-                label_context_clear();
-        }
-
-        fclose(f);
-}
-
 static int systemd_fds(struct udev *udev, int *rctrl, int *rnetlink)
 {
         int ctrl = -1, netlink = -1;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1067,7 +996,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char *argv[])
         mkdir("/run/udev", 0755);
 
         dev_setup(NULL);
-        static_dev_create_from_modules(udev);
 
         /* before opening new files, make sure std{in,out,err} fds are in a sane state */
         if (daemonize) {
diff --git a/units/systemd-static-nodes.service.in b/units/systemd-static-nodes.service.in
new file mode 100644
index 0000000..8178c43
--- /dev/null
+++ b/units/systemd-static-nodes.service.in
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Create static device nodes in /dev
+DefaultDependencies=no
+Before=sysinit.target local-fs-pre.target
+ConditionCapability=CAP_MKNOD
+
+[Service]
+Type=oneshot
+ExecStart=&amp;lt; at &amp;gt;rootbindir&amp;lt; at &amp;gt;/kmod devname2tmpfile
+ExecStart=&amp;lt; at &amp;gt;rootbindir&amp;lt; at &amp;gt;/systemd-tmpfiles --prefix=/dev --create
diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
index ddef423..c0dc4f2 100644
--- a/units/systemd-udevd.service.in
+++ b/units/systemd-udevd.service.in
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -9,10 +9,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 Description=udev Kernel Device Manager
 Documentation=man:systemd-udevd.service(8) man:udev(7)
 DefaultDependencies=no
-Wants=systemd-udevd-control.socket systemd-udevd-kernel.socket
-After=systemd-udevd-control.socket systemd-udevd-kernel.socket
+Wants=systemd-static-nodes.service systemd-udevd-control.socket systemd-udevd-kernel.socket
+After=systemd-static-nodes.service systemd-udevd-control.socket systemd-udevd-kernel.socket
 Before=sysinit.target local-fs-pre.target
-ConditionCapability=CAP_MKNOD
 
 [Service]
 Type=notify
&lt;/pre&gt;</description>
    <dc:creator>Tom Gundersen</dc:creator>
    <dc:date>2013-04-11T15:48:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17698">
    <title>[ANNOUNCE] kmod 13</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17698</link>
    <description>&lt;pre&gt;ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-13.tar.xz
ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-13.tar.sign

New release of kmod 13, after some time accumulating bug fixes and new
features. This release got a bit delayed due to my marriage,
vacations, changing job and some new features getting into the kernel.
What else could happen at the same time? :-)

The most notable new features are the support for finit_module()
syscall and for signed modules. For finit_module() we try to be nice
with older kernels  and we fallback to init_module() if the new one is
not available. The older syscall is also used in case the module is
compressed.

There are also bug fixes and other minor new features. Check the NEWS
file. Thanks to everyone involved in this release. Shortlog is below.


Cheers,
Lucas De Marchi

---

Andrey Mazo (2):
      depmod: --symbol-prefix actually requires an argument
      depmod: fix builtin symbols resolution when the prefix symbol is set

Cristian Rodríguez (1):
      libkmod: Use secure_getenv if available

Josh Boyer (1):
      rmmod: Teach rmmod about builtin modules

Kees Cook (3):
      libkmod: add finit_module logic
      testsuite: handle finit_module
      libkmod: fix address argument to mmap calls

Lucas De Marchi (13):
      man: fix lib dir in which we look for config
      gitignore: ignore files generated by Automake's testsuite
      Update copyright notices
      libkmod-util: Add missing include file
      testsuite: Exit with success on signal if test has expected_fail=true
      testsuite: Add test to check if modprobe explodes on bogus config
      modprobe: Fix assertion on --show-depends with bogus config file
      libkmod: Add missing definitions
      libkmod: Move finit_module() definition to missing.h
      testsuite: Wrap syscall() to get calls to finit_module()
      testsuite: Fix checking __sysno
      build-sys: Always enable parallel tests
      kmod 13

Michal Marek (4):
      libkmod-module: Add helper for building the module info list
      libkmod-module: Do not free the list in kmod_module_info_append
      libkmod: Return module signature information in kmod_module_get_info()
      testsuite: Add modinfo test for module signatures
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Lucas De Marchi</dc:creator>
    <dc:date>2013-04-09T22:57:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17696">
    <title>Re: device properties and change events</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17696</link>
    <description>&lt;pre&gt;
My sympathies :)


What is triggering a change event?  What type of device?  What driver?


I think that is correct.  When a device "changes", all of it's
attributes are thrown away as they obviously changed (the kernel told us
so.)


What type of device is this?


Your kernel driver should tell you why, what driver is it?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Greg KH</dc:creator>
    <dc:date>2013-03-28T22:58:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17695">
    <title>device properties and change events</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17695</link>
    <description>&lt;pre&gt;I'm using udev-147 in CentOS 6.3.

I have two rules that import properties into the udev db. I'll use a
simplified example.

    IMPORT{program}="program1 %k"
    ACTION=="add", IMPORT{program}="program2 %N"

program1 exports MY_FOO, and program2 exports MY_BAR. I've noticed that
when a change event is triggered, MY_BAR is no longer available in the
udev database. So it appears change events clear the existing environment.
The work done in program2 is relatively expensive so I'd rather only run
it when the device is first added.

It looks like I can re-import MY_BAR if I use IMPORT{db} in a separate
rule:

    IMPORT{program}="program1 %k"
    ACTION=="add", IMPORT{program}="program2 %N"
    ACTION=="change", IMPORT{db}="MY_BAR"


Is this the correct approach? Or is there another way to persist the
properties that were imported during add, besides re-importing program2?

Also, is it possible to determine *what* causes a change event to occur?
With 'udevadm monitor' I can see change events being triggered whenever my
application exits (for the devices it has opened), and would like to
determine why. I was hoping udev could give me a hint.

-Keith

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

&lt;/pre&gt;</description>
    <dc:creator>Keith Pine</dc:creator>
    <dc:date>2013-03-27T04:47:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17694">
    <title>Re: Dell Latitude E6530 keymap</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17694</link>
    <description>&lt;pre&gt;
Unfortunately X can't deal with keycodes above 255 :(

&lt;/pre&gt;</description>
    <dc:creator>Dmitry Torokhov</dc:creator>
    <dc:date>2013-03-26T00:46:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17693">
    <title>Dell Latitude E6530 keymap</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17693</link>
    <description>&lt;pre&gt;I have a Dell Latitude E6530 laptop
(system vendor "Dell Inc.", product name "Latitude E6530").
A few of the keys are mapped incorrectly:

Fn+F5, Touchpad Toggle
----------------------

Fn+F5 is labeled on my keyboard with a "touchpad" icon, and in
udev 198, the line in /lib/udev/keymaps/dell for it is this:

0x9E f21 #touchpad toggle

Since we know it is "touchpad toggle" (and I confirm it is), and there
is a key name for that, how about changing this line to read thusly:

0x9E touchpad_toggle # Fn+F5

In the same "dell" file, 0xD9 is mapped the same ("f21 # touchpad toggle");
perhaps it also should be changed to send a real touchpad_toggle?


Fn+F8, LCD/CRT Switch
---------------------

Fn+F8 is labeled on my keyboard with an "LCD/CRT" icon.  
It sends two keycodes: Left_Win (aka "leftmeta"), then "p".
Can we get it to appear as a single "switchvideomode" key?
(If this is outside udev's domain, where should I look?)


Fn+End, Prnt Scrn
-----------------

The SysRq (Fn+Home) and Prnt Scrn (Fn+End) keys both send the same
scan code, 0xB7, which is mapped to "sysrq".  How can I get Prnt Scrn
to send something unique?

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

&lt;/pre&gt;</description>
    <dc:creator>Stephen Gildea</dc:creator>
    <dc:date>2013-03-24T23:21:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17691">
    <title>Re: [PATCH] udevadm-info: Don't access sysfs 'resource&lt;N&gt;' files</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17691</link>
    <description>&lt;pre&gt;
Yes - the system hangs when BAR1's (and likely BAR3's) I/O port space is
read.

Here are the details that I've been able to put together from the two
linux-pci threads and various online sources -


From Robert Hancock - "... BAR5 is the MMIO region used by the AHCI
driver. BARs 0-4 are the legacy SFF-compatible ATA ports.  Nothing
should be messing with those IO ports while AHCI is enabled. ..."  This
likely explains why the system boots and runs fine as long as the
'udevadm ...' command is *not* ran (i.e. the driver never accesses the
I/O port BARs).

Using a SATA controller I have access to as an example for the details
(Note: I do not have access to a system with the Marvell 9125 device):
  00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port  SATA AHCI Controller (rev 06) (prog-if 01 [AHCI 1.0])
  Subsystem: Lenovo Device 2168
  Region 0: I/O ports at 1860 [size=8]
  Region 1: I/O ports at 1814 [size=4]
  Region 2: I/O ports at 1818 [size=8]
  Region 3: I/O ports at 1810 [size=4]
  Region 4: I/O ports at 1840 [size=32]
  Region 5: Memory at f2827000 (32-bit, non-prefetchable) [size=2K]

I/O port registers [1][2]:
  Primary IDE controller  [0x1860-0x1867; 0x1814-0x1817]
  BAR0  Base address for the command block registers for ATA Channel X
    0x1860  (Read/Write): Data Register
    0x1861  (Read): Error Register
    0x1861  (Write): Features Register
    0x1862  (Read/Write): Sector Count Register
    0x1863  (Read/Write): LBA Low Register
    0x1864  (Read/Write): LBA Mid Register
    0x1865  (Read/Write): LBA High Register
    0x1866  (Read/Write): Drive/Head Register
    0x1867  (Read): Status Register
    0x1867  (Write): Command Register
  BAR1* Base address for the control register for ATA Channel X
    0x1814  Reserved
    0x1815  Reserved
    0x1816  (Read): Alternate Status Register
    0x1816  (Write): Device Control Register
    0x1817  Reserved

* The base must be Dword aligned; a PCI requirement.  The Device Control
  and Alternate Status Registers are at ofset 0x2 from this base.

[1] www.t13.org/documents/UploadedDocuments/project/d1510r1-Host-Adapter.pdf
[2] lateblt.tripod.com/atapi.htm

From Xiangliang - executing 'udevadm ...' causes a 32-bit I/O port read
to BAR1's region.  This is shown by the BE (Byte Enable) value of
0x1111.  So apparently reads to this region that include any of reserved
Bytes causes "the chip will go bad."

So, only a Byte access at offset 2 is successful.  I have not been able
to get any more details as to the exact cause of the hang.  I would have
thought that the PCI transaction would have just timed out, or errored
out, or something but apparently the platform ends up hanging.

It appears that this device did not implement the reserved registers
such that they would return 0 on reads or something more similarly sane.

Since BARs 2 and 3 are not 0, indicating the device only supports one
channel, I expect the same issue will occur when accessing BAR3.  Again,
I do not have access to a system with this device to test with.



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

&lt;/pre&gt;</description>
    <dc:creator>Myron Stowe</dc:creator>
    <dc:date>2013-03-19T16:57:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17690">
    <title>Re: [PATCH] udevadm-info: Don't access sysfs 'resource&lt;N&gt;' files</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17690</link>
    <description>&lt;pre&gt;
Well, clearly not. Although accessing this file with grep, etc. is
really just another way root can shoot themselves in the foot, it
would be nice if this functionality could be provided in a way that
didn't leave this kind of exposed land mine.
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Robert Hancock</dc:creator>
    <dc:date>2013-03-19T03:08:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17682">
    <title>Re: [PATCH] udevadm-info: Don't access sysfs 'resource&lt;N&gt;' files</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17682</link>
    <description>&lt;pre&gt;
The expectation is that the user doesn't mess with the device through
pci-sysfs while it's running.  This is really no different than config
space or MMIO space in that respect.  You can use setpci to break your
PCI card while it's used by the driver today.  The difference is that
MMIO spaces side-step the issue by only allowing mmap and config space
is known not to have read side-effects.


Never underestimate how broken hardware can be, though in this case
reading a device register seems to be causing a system hang/reset.


That doesn't really solve anything though.  Let's pretend the resource
files only work while the device is bound to pci-stub.  Now what happens
when you run this udevadm command as admin while it's in use by the
userspace driver?  All we've done is limit the scope of the problem.


Yes, if these are dead registers, let's blacklist and move along.  I
suspect though that these registers probably work fine if you access
them according to the device programming model, so blacklisting just
prevents full use through something like KVM device assignment.  Thanks,

Alex


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

&lt;/pre&gt;</description>
    <dc:creator>Alex Williamson</dc:creator>
    <dc:date>2013-03-18T17:54:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.hotplug.devel/17675">
    <title>Re: [PATCH] udevadm-info: Don't access sysfs 'resource&lt;N&gt;' files</title>
    <link>http://permalink.gmane.org/gmane.linux.hotplug.devel/17675</link>
    <description>&lt;pre&gt;
That may be true of our AHCI driver, but when it's assigned to a guest
we're potentially using a completely different stack and cannot make
that assumption.  A guest running in compatibility mode or the option
ROM for the device may still use I/O port regions.  Thanks,

Alex


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

&lt;/pre&gt;</description>
    <dc:creator>Alex Williamson</dc:creator>
    <dc:date>2013-03-17T22:28:48</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.hotplug.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.hotplug.devel</link>
  </textinput>
</rdf:RDF>
