From f432bb914499e2c28b43f592bb273f0a8664f352 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Mon, 11 Mar 2013 07:17:39 +0100
Subject: [PATCH] Move udevadm to rootbindir

The udevadm utility is needed during early boot, so move it to
rootbindir to support split-/usr configurations.
---
 Makefile.am                                |    4 ++--
 src/core/macros.systemd.in                 |    4 ++--
 src/login/71-seat.rules.in                 |    2 +-
 units/initrd-udevadm-cleanup-db.service.in |    2 +-
 units/systemd-udev-settle.service.in       |    2 +-
 units/systemd-udev-trigger.service.in      |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 89768e6..680dd65 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1785,7 +1785,7 @@ SYSINIT_TARGET_WANTS += \
 	systemd-udevd.service \
 	systemd-udev-trigger.service
 
-bin_PROGRAMS += \
+rootbin_PROGRAMS += \
 	udevadm
 
 rootlibexec_PROGRAMS += \
@@ -1871,7 +1871,7 @@ udevadm_LDADD = \
 # Update hwdb on installation. Do not bother if installing
 # in DESTDIR, since this is likely for packaging purposes.
 hwdb-update-hook:
-	-test -n "$(DESTDIR)" || $(bindir)/udevadm hwdb --update
+	-test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
 
 INSTALL_DATA_HOOKS += \
 	hwdb-update-hook
diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in
index 647cce6..f77082c 100644
--- a/src/core/macros.systemd.in
+++ b/src/core/macros.systemd.in
@@ -61,11 +61,11 @@ fi \
 %{nil}
 
 %udev_hwdb_update() \
-@bindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
+@rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
 %{nil}
 
 %udev_rules_update() \
-@bindir@/udevadm control --reload >/dev/null 2>&1 || : \
+@rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \
 %{nil}
 
 %journal_catalog_update() \
diff --git a/src/login/71-seat.rules.in b/src/login/71-seat.rules.in
index a064de4..ad26acbb 100644
--- a/src/login/71-seat.rules.in
+++ b/src/login/71-seat.rules.in
@@ -38,7 +38,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{idProduct}=="401a", ATTR{product}
 SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{idProduct}=="401a", ATTR{product}=="mimo inc", \
                   ATTR{../idVendor}=="058f", ATTR{../idProduct}=="6254", \
                   ENV{ID_AVOID_LOOP}=="", \
-                  RUN+="@bindir@/udevadm trigger --parent-match=%p/.."
+                  RUN+="@rootbindir@/udevadm trigger --parent-match=%p/.."
 
 TAG=="seat", ENV{ID_PATH}=="", IMPORT{builtin}="path_id"
 TAG=="seat", ENV{ID_FOR_SEAT}=="", ENV{ID_PATH_TAG}!="", ENV{ID_FOR_SEAT}="$env{SUBSYSTEM}-$env{ID_PATH_TAG}"
diff --git a/units/initrd-udevadm-cleanup-db.service.in b/units/initrd-udevadm-cleanup-db.service.in
index b800c21..5c6654e 100644
--- a/units/initrd-udevadm-cleanup-db.service.in
+++ b/units/initrd-udevadm-cleanup-db.service.in
@@ -15,4 +15,4 @@ Before=initrd-switch-root.target
 
 [Service]
 Type=oneshot
-ExecStart=-@bindir@/udevadm info --cleanup-db
+ExecStart=-@rootbindir@/udevadm info --cleanup-db
diff --git a/units/systemd-udev-settle.service.in b/units/systemd-udev-settle.service.in
index b631949..8070559 100644
--- a/units/systemd-udev-settle.service.in
+++ b/units/systemd-udev-settle.service.in
@@ -27,4 +27,4 @@ ConditionCapability=CAP_MKNOD
 Type=oneshot
 TimeoutSec=180
 RemainAfterExit=yes
-ExecStart=@bindir@/udevadm settle
+ExecStart=@rootbindir@/udevadm settle
diff --git a/units/systemd-udev-trigger.service.in b/units/systemd-udev-trigger.service.in
index 391f996..bafea54 100644
--- a/units/systemd-udev-trigger.service.in
+++ b/units/systemd-udev-trigger.service.in
@@ -16,4 +16,4 @@ ConditionCapability=CAP_MKNOD
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=@bindir@/udevadm trigger --type=subsystems --action=add ; @bindir@/udevadm trigger --type=devices --action=add
+ExecStart=@rootbindir@/udevadm trigger --type=subsystems --action=add ; @rootbindir@/udevadm trigger --type=devices --action=add
-- 
1.7.10.4

