chiark / gitweb /
make: introduce --with-rootprefix=
authorKay Sievers <kay.sievers@vrfy.org>
Sun, 25 Dec 2011 19:41:52 +0000 (20:41 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 25 Dec 2011 19:41:52 +0000 (20:41 +0100)
12 files changed:
INSTALL
Makefile.am
NEWS
autogen.sh
configure.ac
extras/keymap/check-keymaps.sh
extras/keymap/findkeyboards
extras/keymap/keyboard-force-release.sh.in [changed mode: 0644->0755]
test/.gitignore [new file with mode: 0644]
test/rules-test.sh
test/udev-test.pl.in [moved from test/udev-test.pl with 93% similarity]
udev/test-udev.c

diff --git a/INSTALL b/INSTALL
index 2962000..5fa900b 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -20,26 +20,25 @@ The options used in a RPM spec file look like:
 
 The options to install udev in the rootfs instead of /usr,
 and udevadm in /sbin:
 
 The options to install udev in the rootfs instead of /usr,
 and udevadm in /sbin:
-    --bindir=/sbin
-    --libexecdir=/lib/udev
-    --with-systemdsystemunitdir=/lib/systemd/system
-    --with-rootlibdir=/lib64
+    --prefix=%{_prefix} \
+    --with-rootprefix= \
+    --sysconfdir=%{_sysconfdir} \
+    --bindir=/sbin \
+    --libdir=%{_libdir} \
+    --with-rootlibdir=/lib64 \
+    --libexecdir=/lib/udev \
+    --with-systemdsystemunitdir=/lib/systemd/system \
+    --with-selinux
 
 Some tools expect udevadm in 'sbin'. A symlink to udevadm in 'bin'
 needs to be manually created if needed.
 
 The defined location for scripts and binaries which are called
 
 Some tools expect udevadm in 'sbin'. A symlink to udevadm in 'bin'
 needs to be manually created if needed.
 
 The defined location for scripts and binaries which are called
-from rules is /usr/lib/udev/ on all systems and architectures. Any
+from rules is (/usr)/lib/udev/ on all systems and architectures. Any
 other location will break other packages, who rightfully expect
 other location will break other packages, who rightfully expect
-the /usr/lib/udev/ directory, to install their rule helper and udev
+the (/usr)/lib/udev/ directory, to install their rule helper and udev
 rule files.
 
 rule files.
 
-It is possible to use the /usr/lib/udev/devices/ directory to place
-device nodes, directories and symlinks, which are copied to /dev/
-at every bootup. That way, nodes for devices which can not be
-detected automatically, or are activated on-demand by opening the
-pre-existing device node, will be available.
-
 Default udev rules and persistent device naming rules may be required
 by other software that depends on the data udev collects from the
 devices.
 Default udev rules and persistent device naming rules may be required
 by other software that depends on the data udev collects from the
 devices.
index 769a6f5..a7f2967 100644 (file)
@@ -40,9 +40,10 @@ libexec_SCRIPTS =
 dist_libexec_SCRIPTS =
 
 SED_PROCESS = \
 dist_libexec_SCRIPTS =
 
 SED_PROCESS = \
-$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
        -e 's,@VERSION\@,$(VERSION),g' \
        -e 's,@prefix\@,$(prefix),g' \
        -e 's,@VERSION\@,$(VERSION),g' \
        -e 's,@prefix\@,$(prefix),g' \
+       -e 's,@rootprefix\@,$(rootprefix),g' \
        -e 's,@exec_prefix\@,$(exec_prefix),g' \
        -e 's,@libdir\@,$(libdir),g' \
        -e 's,@includedir\@,$(includedir),g' \
        -e 's,@exec_prefix\@,$(exec_prefix),g' \
        -e 's,@libdir\@,$(libdir),g' \
        -e 's,@includedir\@,$(includedir),g' \
@@ -56,11 +57,16 @@ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
 %.rules: %.rules.in Makefile
        $(SED_PROCESS)
 
 %.rules: %.rules.in Makefile
        $(SED_PROCESS)
 
-%.service: %.service.in
+%.service: %.service.in Makefile
        $(SED_PROCESS)
 
        $(SED_PROCESS)
 
-%.sh: %.sh.in
+%.sh: %.sh.in Makefile
        $(SED_PROCESS)
        $(SED_PROCESS)
+       $(AM_V_GEN)chmod +x $@
+
+%.pl: %.pl.in Makefile
+       $(SED_PROCESS)
+       $(AM_V_GEN)chmod +x $@
 
 # ------------------------------------------------------------------------------
 # libudev
 
 # ------------------------------------------------------------------------------
 # libudev
@@ -271,7 +277,15 @@ udev/%.html : udev/%.xml
 # ------------------------------------------------------------------------------
 # udev tests
 # ------------------------------------------------------------------------------
 # ------------------------------------------------------------------------------
 # udev tests
 # ------------------------------------------------------------------------------
-TESTS = test/udev-test.pl test/rules-test.sh
+TESTS = \
+       test/udev-test.pl \
+       test/rules-test.sh
+
+EXTRA_DIST += \
+       test/udev-test.pl.in
+
+CLEANFILES += \
+       test/udev-test.pl
 
 check_PROGRAMS = \
        libudev/test-libudev \
 
 check_PROGRAMS = \
        libudev/test-libudev \
diff --git a/NEWS b/NEWS
index 11b3883..b87d372 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,22 +1,24 @@
 udev 175
 ========
 udev 175
 ========
-The default install location moved from /lib/udev to /usr/lib/udev,
-to support systems without the / vs. /usr split. --libexecdir=
-can still be configured to install things to /lib/udev.
+The default configure options have changed, packages need to be adapted
+otherwise udev will be installed in /usr. Example configuration options
+are in INSTALL.
+
+The default prefix moved from / to /usr to support installations without
+the historic / vs. /usr split.
 
 The default install location of the 'udevadm' tool moved from 'sbin'
 
 The default install location of the 'udevadm' tool moved from 'sbin'
-to /usr/bin. --bindir= can still be configured to install it in
-/sbin. Some tools expect udevadm in 'sbin'. A symlink to udevadm
-in /usr/bin needs to be manually created if needed.
+to /usr/bin. Some tools expect udevadm in 'sbin'. A symlink to udevadm
+needs to be manually created if needed.
 
 Kernel modules are now loaded directly by linking udev to 'libkmod'.
 
 Kernel modules are now loaded directly by linking udev to 'libkmod'.
-The /sbin/modprobe tool is no longer executed by udev.
+The 'modprobe' tool is no longer executed by udev.
 
 
-The /sbin/blkid tool is no longer executed from udev rules. Udev links
+The 'blkid' tool is no longer executed from udev rules. Udev links
 directly to libblkid now.
 
 directly to libblkid now.
 
-Firmware is loaded natively by udev now, the external firmware loading
-binary is no longer used.
+Firmware is loaded natively by udev now, the external 'firmware' binary
+is no longer used.
 
 All built-in tools can be listed and tested with 'udevadm test-builtin'.
 
 
 All built-in tools can be listed and tested with 'udevadm test-builtin'.
 
index 50923f0..683c498 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/sh -e
+#!/usr/bin/env sh
+
+set -e
 
 gtkdocize
 autoreconf --install --symlink
 
 gtkdocize
 autoreconf --install --symlink
@@ -7,7 +9,9 @@ libdir() {
        echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
 }
 
        echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
 }
 
-args="--prefix=/usr \
+args="\
+--prefix=/usr \
+--with-rootprefix= \
 --sysconfdir=/etc \
 --bindir=/sbin \
 --libdir=$(libdir /usr/lib) \
 --sysconfdir=/etc \
 --bindir=/sbin \
 --libdir=$(libdir /usr/lib) \
index 723c0cb..a9ba74c 100644 (file)
@@ -23,6 +23,11 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not fo
 PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
 PKG_CHECK_MODULES(KMOD, libkmod >= 2)
 
 PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
 PKG_CHECK_MODULES(KMOD, libkmod >= 2)
 
+AC_ARG_WITH([rootprefix],
+       AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
+       [], [with_rootprefix=$prefix])
+AC_SUBST([rootprefix], [$with_rootprefix])
+
 AC_ARG_WITH([rootlibdir],
        AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
        [], [with_rootlibdir=$libdir])
 AC_ARG_WITH([rootlibdir],
        AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
        [], [with_rootlibdir=$libdir])
@@ -56,7 +61,7 @@ AS_IF([test "x$enable_logging" = "xyes"], [ AC_DEFINE(ENABLE_LOGGING, [1], [Syst
 AC_ARG_WITH(firmware-path,
        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
           [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
 AC_ARG_WITH(firmware-path,
        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
           [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
-       [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
+       [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
 OLD_IFS=$IFS
 IFS=:
 for i in $with_firmware_path; do
 OLD_IFS=$IFS
 IFS=:
 for i in $with_firmware_path; do
@@ -224,6 +229,7 @@ AC_MSG_RESULT([
        ========
 
        prefix:                 ${prefix}
        ========
 
        prefix:                 ${prefix}
+       rootprefix:             ${rootprefix}
        sysconfdir:             ${sysconfdir}
        bindir:                 ${bindir}
        libdir:                 ${libdir}
        sysconfdir:             ${sysconfdir}
        bindir:                 ${bindir}
        libdir:                 ${libdir}
index df18c3f..350a857 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # check that all key names in keymaps/* are known in <linux/input.h>
 # and that all key maps listed in the rules are valid and present in
 
 # check that all key names in keymaps/* are known in <linux/input.h>
 # and that all key maps listed in the rules are valid and present in
index 537d163..eba3737 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/usr/bin/env sh
 # Find "real" keyboard devices and print their device path.
 # Author: Martin Pitt <martin.pitt@ubuntu.com>
 #
 # Find "real" keyboard devices and print their device path.
 # Author: Martin Pitt <martin.pitt@ubuntu.com>
 #
@@ -14,6 +14,8 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
 
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
 
+set -e
+
 # returns OK if $1 contains $2
 strstr() {
     [ "${1#*$2*}" != "$1" ]
 # returns OK if $1 contains $2
 strstr() {
     [ "${1#*$2*}" != "$1" ]
old mode 100644 (file)
new mode 100755 (executable)
index 05dd5da..ce91a15
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!@rootprefix@/bin/sh -e
 # read list of scancodes, convert hex to decimal and
 # append to the atkbd force_release sysfs attribute
 # $1 sysfs devpath for serioX
 # read list of scancodes, convert hex to decimal and
 # append to the atkbd force_release sysfs attribute
 # $1 sysfs devpath for serioX
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644 (file)
index 0000000..8d662ea
--- /dev/null
@@ -0,0 +1,2 @@
+udev-test.pl
+
index b98b69a..511f05d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
 # Call the udev rule syntax checker on all rules that we ship
 #
 # (C) 2010 Canonical Ltd.
 # Call the udev rule syntax checker on all rules that we ship
 #
 # (C) 2010 Canonical Ltd.
similarity index 93%
rename from test/udev-test.pl
rename to test/udev-test.pl.in
index c2dc70e..0befc7b 100755 (executable)
@@ -227,7 +227,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "aaa",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "aaa",
                rules           => <<EOF
-KERNEL=="ttyACM0", PROGRAM=="/bin/echo -e \\101", RESULT=="A", SYMLINK+="aaa"
+KERNEL=="ttyACM0", PROGRAM=="@rootprefix@/bin/echo -e \\101", RESULT=="A", SYMLINK+="aaa"
 EOF
        },
        {
 EOF
        },
        {
@@ -292,7 +292,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "node12345678",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "node12345678",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", IMPORT{program}="/bin/echo -e \' TEST_KEY=12345678\\n  TEST_key2=98765\'", SYMLINK+="node\$env{TEST_KEY}"
+SUBSYSTEMS=="scsi", IMPORT{program}="@rootprefix@/bin/echo -e \' TEST_KEY=12345678\\n  TEST_key2=98765\'", SYMLINK+="node\$env{TEST_KEY}"
 KERNEL=="ttyACM0", SYMLINK+="modem"
 EOF
        },
 KERNEL=="ttyACM0", SYMLINK+="modem"
 EOF
        },
@@ -313,8 +313,8 @@ EOF
                exp_name        => "special-device-5" ,
                not_exp_name    => "not" ,
                rules           => <<EOF
                exp_name        => "special-device-5" ,
                not_exp_name    => "not" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n special-device", RESULT=="-special-*", SYMLINK+="not"
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n special-device", RESULT=="special-*", SYMLINK+="%c-%n"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n special-device", RESULT=="-special-*", SYMLINK+="not"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n special-device", RESULT=="special-*", SYMLINK+="%c-%n"
 EOF
        },
        {
 EOF
        },
        {
@@ -323,7 +323,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "newline_removed" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "newline_removed" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo test", RESULT=="test", SYMLINK+="newline_removed"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo test", RESULT=="test", SYMLINK+="newline_removed"
 EOF
        },
        {
 EOF
        },
        {
@@ -332,7 +332,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "test-0:0:0:0" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "test-0:0:0:0" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n test-%b", RESULT=="test-0:0*", SYMLINK+="%c"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n test-%b", RESULT=="test-0:0*", SYMLINK+="%c"
 EOF
        },
        {
 EOF
        },
        {
@@ -341,7 +341,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "foo9" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "foo9" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="%c{7}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="%c{7}"
 EOF
        },
        {
 EOF
        },
        {
@@ -350,7 +350,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "bar9" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "bar9" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed  s/foo9/bar9/'", KERNEL=="sda5", SYMLINK+="%c{7}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed  s/foo9/bar9/'", KERNEL=="sda5", SYMLINK+="%c{7}"
 EOF
        },
        {
 EOF
        },
        {
@@ -359,7 +359,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "foo7" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "foo7" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n 'foo3 foo4'   'foo5   foo6   foo7 foo8'", KERNEL=="sda5", SYMLINK+="%c{5}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n 'foo3 foo4'   'foo5   foo6   foo7 foo8'", KERNEL=="sda5", SYMLINK+="%c{5}"
 EOF
        },
        {
 EOF
        },
        {
@@ -368,7 +368,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "my-foo9" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "my-foo9" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="my-%c{7}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="my-%c{7}"
 EOF
        },
        {
 EOF
        },
        {
@@ -377,7 +377,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "my-foo8" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "my-foo8" ,
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="my-%c{6}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="my-%c{6}"
 EOF
        },
        {
 EOF
        },
        {
@@ -431,7 +431,7 @@ EOF
                devpath         => "/devices/virtual/tty/console",
                exp_name        => "TTY",
                rules           => <<EOF
                devpath         => "/devices/virtual/tty/console",
                exp_name        => "TTY",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo", RESULT=="foo", SYMLINK+="foo"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n foo", RESULT=="foo", SYMLINK+="foo"
 KERNEL=="console", SYMLINK+="TTY"
 EOF
        },
 KERNEL=="console", SYMLINK+="TTY"
 EOF
        },
@@ -487,9 +487,9 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "scsi-0:0:0:0" ,
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "scsi-0:0:0:0" ,
                rules           => <<EOF
-SUBSYSTEMS=="usb", PROGRAM=="/bin/echo -n usb-%b", SYMLINK+="%c"
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n scsi-%b", SYMLINK+="%c"
-SUBSYSTEMS=="foo", PROGRAM=="/bin/echo -n foo-%b", SYMLINK+="%c"
+SUBSYSTEMS=="usb", PROGRAM=="@rootprefix@/bin/echo -n usb-%b", SYMLINK+="%c"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n scsi-%b", SYMLINK+="%c"
+SUBSYSTEMS=="foo", PROGRAM=="@rootprefix@/bin/echo -n foo-%b", SYMLINK+="%c"
 EOF
        },
        {
 EOF
        },
        {
@@ -920,7 +920,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "test",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "test",
                rules           => <<EOF
-KERNEL=="ttyACM[0-9]*", PROGRAM=="/bin/echo test", SYMLINK+="%c"
+KERNEL=="ttyACM[0-9]*", PROGRAM=="@rootprefix@/bin/echo test", SYMLINK+="%c"
 EOF
        },
        {
 EOF
        },
        {
@@ -929,7 +929,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "test",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "test",
                rules           => <<EOF
-KERNEL=="ttyACM[0-9]*", PROGRAM=="/bin/echo symlink test this", SYMLINK+="%c{2}"
+KERNEL=="ttyACM[0-9]*", PROGRAM=="@rootprefix@/bin/echo symlink test this", SYMLINK+="%c{2}"
 EOF
        },
        {
 EOF
        },
        {
@@ -938,7 +938,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "this",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
                exp_name        => "this",
                rules           => <<EOF
-KERNEL=="ttyACM[0-9]*", PROGRAM=="/bin/echo symlink test this", SYMLINK+="%c{2+}"
+KERNEL=="ttyACM[0-9]*", PROGRAM=="@rootprefix@/bin/echo symlink test this", SYMLINK+="%c{2+}"
 EOF
        },
        {
 EOF
        },
        {
@@ -947,7 +947,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "test",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "test",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda", PROGRAM=="/bin/echo link test this" SYMLINK+="%c{2+}"
+SUBSYSTEMS=="scsi", KERNEL=="sda", PROGRAM=="@rootprefix@/bin/echo link test this" SYMLINK+="%c{2+}"
 EOF
        },
        {
 EOF
        },
        {
@@ -965,7 +965,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "link1",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "link1",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2", RESULT=="node *", SYMLINK+="%c{2} %c{3}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n node link1 link2", RESULT=="node *", SYMLINK+="%c{2} %c{3}"
 EOF
        },
        {
 EOF
        },
        {
@@ -974,7 +974,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "link4",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
                exp_name        => "link4",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2 link3 link4", RESULT=="node *", SYMLINK+="%c{2+}"
+SUBSYSTEMS=="scsi", PROGRAM=="@rootprefix@/bin/echo -n node link1 link2 link3 link4", RESULT=="node *", SYMLINK+="%c{2+}"
 EOF
        },
        {
 EOF
        },
        {
@@ -1004,7 +1004,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "node",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
                exp_name        => "node",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda", PROGRAM=="/usr/bin/test -b %N" SYMLINK+="node"
+SUBSYSTEMS=="scsi", KERNEL=="sda", PROGRAM=="/usr@rootprefix@/bin/test -b %N" SYMLINK+="node"
 EOF
        },
        {
 EOF
        },
        {
@@ -1076,7 +1076,7 @@ EOF
                exp_name        => "nonzero-program",
                rules           => <<EOF
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="before"
                exp_name        => "nonzero-program",
                rules           => <<EOF
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="before"
-KERNEL=="sda1", PROGRAM!="/bin/false", SYMLINK+="nonzero-program"
+KERNEL=="sda1", PROGRAM!="@rootprefix@/bin/false", SYMLINK+="nonzero-program"
 EOF
        },
        {
 EOF
        },
        {
@@ -1158,7 +1158,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
                exp_name        => "sane",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
                exp_name        => "sane",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e name; (/usr/bin/badprogram)", RESULT=="name_ _/usr/bin/badprogram_", SYMLINK+="sane"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="@rootprefix@/bin/echo -e name; (/usr/bin/badprogram)", RESULT=="name_ _/usr/bin/badprogram_", SYMLINK+="sane"
 EOF
        },
        {
 EOF
        },
        {
@@ -1167,7 +1167,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
                exp_name        => "uber",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
                exp_name        => "uber",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e \\xc3\\xbcber" RESULT=="\xc3\xbcber", SYMLINK+="uber"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="@rootprefix@/bin/echo -e \\xc3\\xbcber" RESULT=="\xc3\xbcber", SYMLINK+="uber"
 EOF
        },
        {
 EOF
        },
        {
@@ -1176,7 +1176,7 @@ EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
                exp_name        => "replaced",
                rules           => <<EOF
                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
                exp_name        => "replaced",
                rules           => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e \\xef\\xe8garbage", RESULT=="__garbage", SYMLINK+="replaced"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="@rootprefix@/bin/echo -e \\xef\\xe8garbage", RESULT=="__garbage", SYMLINK+="replaced"
 EOF
        },
        {
 EOF
        },
        {
@@ -1217,8 +1217,8 @@ EOF
                exp_name        => "testsymlink2",
                exp_target      => "ok2",
                rules           => <<EOF
                exp_name        => "testsymlink2",
                exp_target      => "ok2",
                rules           => <<EOF
-KERNEL=="sda", NAME="ok2", RUN+="/bin/ln -s ok2 %r/testsymlink2"
-KERNEL=="sda", ACTION=="remove", RUN+="/bin/rm -f %r/testsymlink2"
+KERNEL=="sda", NAME="ok2", RUN+="@rootprefix@/bin/ln -s ok2 %r/testsymlink2"
+KERNEL=="sda", ACTION=="remove", RUN+="@rootprefix@/bin/rm -f %r/testsymlink2"
 EOF
        },
        {
 EOF
        },
        {
@@ -1330,7 +1330,7 @@ EOF
                exp_name        => "parent",
                option          => "keep",
                rules           => <<EOF
                exp_name        => "parent",
                option          => "keep",
                rules           => <<EOF
-KERNEL=="sda", IMPORT{program}="/bin/echo -e \'PARENT_KEY=parent_right\\nWRONG_PARENT_KEY=parent_wrong'"
+KERNEL=="sda", IMPORT{program}="@rootprefix@/bin/echo -e \'PARENT_KEY=parent_right\\nWRONG_PARENT_KEY=parent_wrong'"
 KERNEL=="sda", SYMLINK+="parent"
 EOF
        },
 KERNEL=="sda", SYMLINK+="parent"
 EOF
        },
@@ -1479,7 +1479,7 @@ EOF
                exp_rem_error   => "yes",
                rules           => <<EOF
 KERNEL=="sda", MODE="666"
                exp_rem_error   => "yes",
                rules           => <<EOF
 KERNEL=="sda", MODE="666"
-KERNEL=="sda", PROGRAM=="/bin/echo 5000 100 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
+KERNEL=="sda", PROGRAM=="@rootprefix@/bin/echo 5000 100 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
 EOF
        },
        {
 EOF
        },
        {
@@ -1491,7 +1491,7 @@ EOF
                exp_rem_error   => "yes",
                rules           => <<EOF
 KERNEL=="sda", MODE="440"
                exp_rem_error   => "yes",
                rules           => <<EOF
 KERNEL=="sda", MODE="440"
-KERNEL=="sda", PROGRAM=="/bin/echo 0 0 0400letsdoabuffferoverflow0123456789012345789012345678901234567890", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
+KERNEL=="sda", PROGRAM=="@rootprefix@/bin/echo 0 0 0400letsdoabuffferoverflow0123456789012345789012345678901234567890", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
 EOF
        },
        {
 EOF
        },
        {
@@ -1501,7 +1501,7 @@ EOF
                exp_name        => "sda-8741C4G-end",
                exp_perms       => "0:0:0600",
                rules           => <<EOF
                exp_name        => "sda-8741C4G-end",
                exp_perms       => "0:0:0600",
                rules           => <<EOF
-KERNEL=="sda", PROGRAM="/bin/true create-envp"
+KERNEL=="sda", PROGRAM="@rootprefix@/bin/true create-envp"
 KERNEL=="sda", ENV{TESTENV}="change-envp"
 KERNEL=="sda", SYMLINK+="%k-%s{[dmi/id]product_name}-end", RUN+="socket:@/org/kernel/udev/monitor"
 EOF
 KERNEL=="sda", ENV{TESTENV}="change-envp"
 KERNEL=="sda", SYMLINK+="%k-%s{[dmi/id]product_name}-end", RUN+="socket:@/org/kernel/udev/monitor"
 EOF
index 0771689..8039459 100644 (file)
 
 #include "udev.h"
 
 
 #include "udev.h"
 
+void udev_main_log(struct udev *udev, int priority,
+                  const char *file, int line, const char *fn,
+                  const char *format, va_list args) {}
+
 int main(int argc, char *argv[])
 {
        struct udev *udev;
 int main(int argc, char *argv[])
 {
        struct udev *udev;