summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2013-03-16 22:53:01 +0000
committerAlon Bar-Lev <alonbl@gentoo.org>2013-03-16 22:53:01 +0000
commitf24a0374b92359d2d25f81095e243a488186b14c (patch)
treef39ea030ddc47a330fd2dad2ae62c5f4b820d759 /app-laptop/laptop-mode-tools/files
parentMade avidemux-core block old versions of avidemux that had the core libraries... (diff)
downloadgentoo-2-f24a0374b92359d2d25f81095e243a488186b14c.tar.gz
gentoo-2-f24a0374b92359d2d25f81095e243a488186b14c.tar.bz2
gentoo-2-f24a0374b92359d2d25f81095e243a488186b14c.zip
cherry-pick upstream patches, among other fixes bug#450248, bug#461670, add own patch to customize udev and systemd directories, add systemd USE
(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key BF20DC51)
Diffstat (limited to 'app-laptop/laptop-mode-tools/files')
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0001-Do-not-ship-the-board-specific-folder-in-default-ins.patch25
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0004-add-LIB_D-so-it-can-give-the-possibility-to-install-.patch72
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0008-Re-order-the-check-because-HAL-is-deprecated.patch50
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0014-Kick-the-power-savings-back-in-as-soon-as-the-stick-.patch22
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0015-Don-t-hardcode-the-path.patch28
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0016-show-the-errors-if-any.patch25
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0017-Initialize-variables-early-before-being-referenced.patch36
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0018-install-remove-unused-substitute-for-udev-rule.patch26
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0019-install-use-customizable-udev-directory.patch53
-rw-r--r--app-laptop/laptop-mode-tools/files/1.62/0020-install-make-systemd-optional-and-configurable-locat.patch68
10 files changed, 405 insertions, 0 deletions
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0001-Do-not-ship-the-board-specific-folder-in-default-ins.patch b/app-laptop/laptop-mode-tools/files/1.62/0001-Do-not-ship-the-board-specific-folder-in-default-ins.patch
new file mode 100644
index 000000000000..9ff94db591a8
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0001-Do-not-ship-the-board-specific-folder-in-default-ins.patch
@@ -0,0 +1,25 @@
+From 75cb1897a9eabd6acf280cade2ecffb1554380db Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@researchut.com>
+Date: Mon, 5 Nov 2012 04:07:26 +0530
+Subject: [PATCH 01/20] Do not ship the board-specific/ folder in default
+ installs
+
+---
+ install.sh | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/install.sh b/install.sh
+index 322e784..536a63a 100755
+--- a/install.sh
++++ b/install.sh
+@@ -112,7 +112,6 @@ $INSTALL -d -m 755 "$DESTDIR/usr/share/laptop-mode-tools/modules"
+ $INSTALL -d -m 755 "$DESTDIR/usr/share/laptop-mode-tools/module-helpers"
+ $INSTALL -d -m 755 "$DESTDIR/usr/lib/tmpfiles.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/conf.d"
+-$INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/conf.d/board-specific"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/modules"
+ $INSTALL -d -m 755 "$DESTDIR/usr/sbin"
+ $INSTALL -d -m 755 "$DESTDIR/lib/udev"
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0004-add-LIB_D-so-it-can-give-the-possibility-to-install-.patch b/app-laptop/laptop-mode-tools/files/1.62/0004-add-LIB_D-so-it-can-give-the-possibility-to-install-.patch
new file mode 100644
index 000000000000..32fb22cf481b
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0004-add-LIB_D-so-it-can-give-the-possibility-to-install-.patch
@@ -0,0 +1,72 @@
+From 58ae05221b12192e48fb4801b6b93c88797985ea Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@debian.org>
+Date: Sun, 10 Mar 2013 13:43:19 +0530
+Subject: [PATCH 04/20] add $LIB_D so it can give the possibility to install
+ udev/system files in different location
+
+Thanks: Robert Milasan
+---
+ etc/rules/99-laptop-mode.rules | 6 +++---
+ install.sh | 15 +++++++++------
+ 2 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/etc/rules/99-laptop-mode.rules b/etc/rules/99-laptop-mode.rules
+index c0b4761..96d5d68 100644
+--- a/etc/rules/99-laptop-mode.rules
++++ b/etc/rules/99-laptop-mode.rules
+@@ -1,3 +1,3 @@
+-ACTION=="change", SUBSYSTEM=="power_supply", RUN+="/lib/udev/lmt-udev auto"
+-ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="/lib/udev/lmt-udev auto"
+-ACTION=="add", SUBSYSTEM=="usb", RUN+="/lib/udev/lmt-udev force modules=usb-autosuspend devices=%k"
++ACTION=="change", SUBSYSTEM=="power_supply", RUN+="@LIB_D@/udev/lmt-udev auto"
++ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="@LIB_D@/udev/lmt-udev auto"
++ACTION=="add", SUBSYSTEM=="usb", RUN+="@LIB_D@/udev/lmt-udev force modules=usb-autosuspend devices=%k"
+diff --git a/install.sh b/install.sh
+index 536a63a..cde2a0a 100755
+--- a/install.sh
++++ b/install.sh
+@@ -28,6 +28,7 @@
+ #
+
+ [ -z "$MAN_D" ] && MAN_D="/usr/man"
++[ -z "$LIB_D" ] && LIB_D="/lib"
+
+ if [ -z "$ACPI" ] ; then
+ ACPI=auto
+@@ -114,8 +115,8 @@ $INSTALL -d -m 755 "$DESTDIR/usr/lib/tmpfiles.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/conf.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/modules"
+ $INSTALL -d -m 755 "$DESTDIR/usr/sbin"
+-$INSTALL -d -m 755 "$DESTDIR/lib/udev"
+-$INSTALL -d -m 755 "$DESTDIR/lib/systemd/system"
++$INSTALL -d -m 755 "$DESTDIR/$LIB_D/udev"
++$INSTALL -d -m 755 "$DESTDIR/$LIB_D/systemd/system"
+ $INSTALL -d -m 755 "$DESTDIR/$MAN_D/man8"
+
+ ALREADY_EXISTED=0
+@@ -200,16 +201,18 @@ fi
+ if ( ! $INSTALL -D -m 644 etc/rules/99-laptop-mode.rules "$DESTDIR/etc/udev/rules.d/99-laptop-mode.rules" ) ; then
+ echo "$0: Failed to install udev rule into /etc/udev/rules.d/ Installation failed."
+ exit 23
++else
++ sed -i -e "s|@LIB_D@|$LIB_D|g" $DESTDIR/etc/udev/rules.d/99-laptop-mode.rules >/dev/null 2>&1
+ fi
+
+ # udev helper tool
+-if ( ! $INSTALL -D -m 755 etc/rules/lmt-udev "$DESTDIR/lib/udev/lmt-udev" ) ; then
+- echo "$0: Failed to install udev helper tool into /lib/udev/ Installation failed."
++if ( ! $INSTALL -D -m 755 etc/rules/lmt-udev "$DESTDIR/$LIB_D/udev/lmt-udev" ) ; then
++ echo "$0: Failed to install udev helper tool into $LIB_D/udev Installation failed."
+ fi
+
+ # systemd service
+-if ( ! $INSTALL -D -m 644 etc/systemd/laptop-mode.service "$DESTDIR/lib/systemd/system/laptop-mode.service" ) ; then
+- echo "$0: Failed to install systemd service into /lib/systemd/system/ Installation failed."
++if ( ! $INSTALL -D -m 644 etc/systemd/laptop-mode.service "$DESTDIR/$LIB_D/systemd/system/laptop-mode.service" ) ; then
++ echo "$0: Failed to install systemd service into $LIB_D/systemd/system/ Installation failed."
+ fi
+
+ # and systemd's tmpfiles.d
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0008-Re-order-the-check-because-HAL-is-deprecated.patch b/app-laptop/laptop-mode-tools/files/1.62/0008-Re-order-the-check-because-HAL-is-deprecated.patch
new file mode 100644
index 000000000000..938f0e0746f2
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0008-Re-order-the-check-because-HAL-is-deprecated.patch
@@ -0,0 +1,50 @@
+From fedcb181446734d5bf22e878fcde0d60e9edbcc8 Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@debian.org>
+Date: Sun, 10 Mar 2013 16:29:16 +0530
+Subject: [PATCH 08/20] Re-order the check because HAL is deprecated
+
+And for backward compatibility, still have the HAL check with the fix.
+
+Thanks: Pacho Ramos
+---
+ usr/sbin/laptop_mode | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/usr/sbin/laptop_mode b/usr/sbin/laptop_mode
+index 35b3b08..6ef1e41 100755
+--- a/usr/sbin/laptop_mode
++++ b/usr/sbin/laptop_mode
+@@ -670,20 +670,20 @@ lmt_main_function ()
+ fi
+
+ if [ "$ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED" -ne 0 -a "$ACTIVATE" -eq 0 ] ; then
+- if [ -x "`which hal-find-by-property`" ] ; then
+- HAL_LID_BUTTON=$(hal-find-by-property --key "button.type" --string "lid")
+- fi
+- if [ "$HAL_LID_BUTTON" != "" ] ; then
+- HAL_LID_BUTTON_STATE=$(hal-get-property --udi $(hal-find-by-property --key "button.type" --string "lid") --key "button.state.value")
+- if [ "$HAL_LID_BUTTON_STATE" = "true" ] ; then
+- log "VERBOSE" "Setting action to \"start\" because the lid is closed (says HAL)."
+- ACTIVATE=1
+- fi
+- elif [ -f /proc/acpi/button/lid/*/state ] ; then
++ if [ -f /proc/acpi/button/lid/*/state ] ; then
+ if ( grep -q "closed" /proc/acpi/button/lid/*/state ) ; then
+ log "VERBOSE" 'Setting action to "start" because the lid is closed (says /proc/acpi/button/lid/*/state).'
+ ACTIVATE=1
+ fi
++ elif ( which hal-find-by-property >/dev/null ) ; then
++ HAL_LID_BUTTON=$($HAL_FIND_BY_PROPERTY --key "button.type" --string "lid")
++ if [ "$HAL_LID_BUTTON" != "" ] ; then
++ HAL_LID_BUTTON_STATE=$(hal-get-property --udi $(hal-find-by-property --key "button.type" --string "lid") --key "button.state.value")
++ if [ "$HAL_LID_BUTTON_STATE" = "true" ] ; then
++ log "VERBOSE" "Setting action to \"start\" because the lid is closed (says HAL)."
++ ACTIVATE=1
++ fi
++ fi
+ else
+ log "MSG" "Warning: ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED is set, but there is no file"
+ log "MSG" "/proc/acpi/button/lid/.../state, and hal information is not available either!"
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0014-Kick-the-power-savings-back-in-as-soon-as-the-stick-.patch b/app-laptop/laptop-mode-tools/files/1.62/0014-Kick-the-power-savings-back-in-as-soon-as-the-stick-.patch
new file mode 100644
index 000000000000..692c1c6e92c0
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0014-Kick-the-power-savings-back-in-as-soon-as-the-stick-.patch
@@ -0,0 +1,22 @@
+From 5ffc55928bd482872fbf6b7ffc67b4cd173f400b Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@debian.org>
+Date: Sat, 16 Mar 2013 16:04:00 +0530
+Subject: [PATCH 14/20] Kick the power savings back in, as soon as the stick is
+ unplugged
+
+---
+ etc/rules/99-laptop-mode.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/etc/rules/99-laptop-mode.rules b/etc/rules/99-laptop-mode.rules
+index 96d5d68..8ff8218 100644
+--- a/etc/rules/99-laptop-mode.rules
++++ b/etc/rules/99-laptop-mode.rules
+@@ -1,3 +1,3 @@
+ ACTION=="change", SUBSYSTEM=="power_supply", RUN+="@LIB_D@/udev/lmt-udev auto"
+ ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="@LIB_D@/udev/lmt-udev auto"
+-ACTION=="add", SUBSYSTEM=="usb", RUN+="@LIB_D@/udev/lmt-udev force modules=usb-autosuspend devices=%k"
++ACTION=="add|remove", SUBSYSTEM=="usb", RUN+="@LIB_D@/udev/lmt-udev force modules=usb-autosuspend devices=%k"
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0015-Don-t-hardcode-the-path.patch b/app-laptop/laptop-mode-tools/files/1.62/0015-Don-t-hardcode-the-path.patch
new file mode 100644
index 000000000000..93ec69f83034
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0015-Don-t-hardcode-the-path.patch
@@ -0,0 +1,28 @@
+From a5f59bfeed1d486a81bebc85171210909d2c981f Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@debian.org>
+Date: Sat, 16 Mar 2013 16:10:36 +0530
+Subject: [PATCH 15/20] Don't hardcode the path
+
+There's no need to hardcode the path. From my tests, it shows that udev
+does a lookup in /lib/udev/ anyways.
+
+This will also help in cases where udev/systemd stores rules in
+/usr/lib/
+---
+ etc/rules/99-laptop-mode.rules | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/etc/rules/99-laptop-mode.rules b/etc/rules/99-laptop-mode.rules
+index 8ff8218..0565644 100644
+--- a/etc/rules/99-laptop-mode.rules
++++ b/etc/rules/99-laptop-mode.rules
+@@ -1,3 +1,3 @@
+-ACTION=="change", SUBSYSTEM=="power_supply", RUN+="@LIB_D@/udev/lmt-udev auto"
+-ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="@LIB_D@/udev/lmt-udev auto"
+-ACTION=="add|remove", SUBSYSTEM=="usb", RUN+="@LIB_D@/udev/lmt-udev force modules=usb-autosuspend devices=%k"
++ACTION=="change", SUBSYSTEM=="power_supply", RUN+="lmt-udev auto"
++ACTION=="add|remove", SUBSYSTEM=="machinecheck", RUN+="lmt-udev auto"
++ACTION=="add|remove", SUBSYSTEM=="usb", RUN+="lmt-udev force modules=usb-autosuspend devices=%k"
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0016-show-the-errors-if-any.patch b/app-laptop/laptop-mode-tools/files/1.62/0016-show-the-errors-if-any.patch
new file mode 100644
index 000000000000..7107c2a44f6e
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0016-show-the-errors-if-any.patch
@@ -0,0 +1,25 @@
+From 7bde97466a824bdec0f2f4bc545e9790eac62e41 Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@debian.org>
+Date: Sat, 16 Mar 2013 16:35:19 +0530
+Subject: [PATCH 16/20] show the errors, if any
+
+---
+ install.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/install.sh b/install.sh
+index cde2a0a..b36c8ca 100755
+--- a/install.sh
++++ b/install.sh
+@@ -202,7 +202,7 @@ if ( ! $INSTALL -D -m 644 etc/rules/99-laptop-mode.rules "$DESTDIR/etc/udev/rule
+ echo "$0: Failed to install udev rule into /etc/udev/rules.d/ Installation failed."
+ exit 23
+ else
+- sed -i -e "s|@LIB_D@|$LIB_D|g" $DESTDIR/etc/udev/rules.d/99-laptop-mode.rules >/dev/null 2>&1
++ sed -i -e "s|@LIB_D@|$LIB_D|g" $DESTDIR/etc/udev/rules.d/99-laptop-mode.rules
+ fi
+
+ # udev helper tool
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0017-Initialize-variables-early-before-being-referenced.patch b/app-laptop/laptop-mode-tools/files/1.62/0017-Initialize-variables-early-before-being-referenced.patch
new file mode 100644
index 000000000000..233f2050a3d4
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0017-Initialize-variables-early-before-being-referenced.patch
@@ -0,0 +1,36 @@
+From 8c0db5f5fa48ca3580bc3f7fe9fdea346857c20e Mon Sep 17 00:00:00 2001
+From: Ritesh Raj Sarraf <rrs@debian.org>
+Date: Sat, 16 Mar 2013 17:00:27 +0530
+Subject: [PATCH 17/20] Initialize variables early, before being referenced
+
+---
+ usr/sbin/laptop_mode | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/usr/sbin/laptop_mode b/usr/sbin/laptop_mode
+index bc1d02a..48e6ad4 100755
+--- a/usr/sbin/laptop_mode
++++ b/usr/sbin/laptop_mode
+@@ -508,6 +508,9 @@ lmt_load_config ()
+ fi
+
+
++ INIT=0 # Display info in init script format?
++ FORCE=0 # Force reapplying the current state?
++ INITSCRIPT_STOP=0 # Track stop command from init script. Consumer is lm-polling daemon
+
+ # Evaluate options passed to laptop_mode in here
+ if [ "$1" = "status" ] ; then
+@@ -599,9 +602,6 @@ lmt_load_config ()
+ exit 1
+ fi
+
+- INIT=0 # Display info in init script format?
+- FORCE=0 # Force reapplying the current state?
+- INITSCRIPT_STOP=0 # Track stop command from init script. Consumer is lm-polling daemon
+ while [ "$1" != "" ] ; do
+ case "$1" in
+ init) INIT=1 ;;
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0018-install-remove-unused-substitute-for-udev-rule.patch b/app-laptop/laptop-mode-tools/files/1.62/0018-install-remove-unused-substitute-for-udev-rule.patch
new file mode 100644
index 000000000000..ce75e48f7130
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0018-install-remove-unused-substitute-for-udev-rule.patch
@@ -0,0 +1,26 @@
+From 7fb36a367d5faa935b31b2191e7255149c8a9823 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Sat, 16 Mar 2013 23:42:21 +0200
+Subject: [PATCH 18/20] install: remove unused substitute for udev rule
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ install.sh | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/install.sh b/install.sh
+index b36c8ca..900a596 100755
+--- a/install.sh
++++ b/install.sh
+@@ -201,8 +201,6 @@ fi
+ if ( ! $INSTALL -D -m 644 etc/rules/99-laptop-mode.rules "$DESTDIR/etc/udev/rules.d/99-laptop-mode.rules" ) ; then
+ echo "$0: Failed to install udev rule into /etc/udev/rules.d/ Installation failed."
+ exit 23
+-else
+- sed -i -e "s|@LIB_D@|$LIB_D|g" $DESTDIR/etc/udev/rules.d/99-laptop-mode.rules
+ fi
+
+ # udev helper tool
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0019-install-use-customizable-udev-directory.patch b/app-laptop/laptop-mode-tools/files/1.62/0019-install-use-customizable-udev-directory.patch
new file mode 100644
index 000000000000..1d5a019ac246
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0019-install-use-customizable-udev-directory.patch
@@ -0,0 +1,53 @@
+From 2113b1d1919a08fb1f8877e909a9b28c631bb138 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Sat, 16 Mar 2013 23:40:56 +0200
+Subject: [PATCH 19/20] install: use customizable udev directory
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ install.sh | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/install.sh b/install.sh
+index 900a596..85a7cd4 100755
+--- a/install.sh
++++ b/install.sh
+@@ -29,6 +29,7 @@
+
+ [ -z "$MAN_D" ] && MAN_D="/usr/man"
+ [ -z "$LIB_D" ] && LIB_D="/lib"
++[ -z "$UDEV_D" ] && UDEV_D="$LIB_D/udev"
+
+ if [ -z "$ACPI" ] ; then
+ ACPI=auto
+@@ -115,7 +116,7 @@ $INSTALL -d -m 755 "$DESTDIR/usr/lib/tmpfiles.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/conf.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/modules"
+ $INSTALL -d -m 755 "$DESTDIR/usr/sbin"
+-$INSTALL -d -m 755 "$DESTDIR/$LIB_D/udev"
++$INSTALL -d -m 755 "$DESTDIR/$UDEV_D/rules.d"
+ $INSTALL -d -m 755 "$DESTDIR/$LIB_D/systemd/system"
+ $INSTALL -d -m 755 "$DESTDIR/$MAN_D/man8"
+
+@@ -198,14 +199,14 @@ if [ -f "$DESTDIR/usr/lib/pm-utils/sleep.d/99laptop-mode" ]; then
+ fi
+
+ # udev rule
+-if ( ! $INSTALL -D -m 644 etc/rules/99-laptop-mode.rules "$DESTDIR/etc/udev/rules.d/99-laptop-mode.rules" ) ; then
+- echo "$0: Failed to install udev rule into /etc/udev/rules.d/ Installation failed."
++if ( ! $INSTALL -D -m 644 etc/rules/99-laptop-mode.rules "$DESTDIR/$UDEV_D/rules.d/99-laptop-mode.rules" ) ; then
++ echo "$0: Failed to install udev rule into $UDEV_D/rules.d/ Installation failed."
+ exit 23
+ fi
+
+ # udev helper tool
+-if ( ! $INSTALL -D -m 755 etc/rules/lmt-udev "$DESTDIR/$LIB_D/udev/lmt-udev" ) ; then
+- echo "$0: Failed to install udev helper tool into $LIB_D/udev Installation failed."
++if ( ! $INSTALL -D -m 755 etc/rules/lmt-udev "$DESTDIR/$UDEV_D/lmt-udev" ) ; then
++ echo "$0: Failed to install udev helper tool into $UDEV_D Installation failed."
+ fi
+
+ # systemd service
+--
+1.8.1.5
+
diff --git a/app-laptop/laptop-mode-tools/files/1.62/0020-install-make-systemd-optional-and-configurable-locat.patch b/app-laptop/laptop-mode-tools/files/1.62/0020-install-make-systemd-optional-and-configurable-locat.patch
new file mode 100644
index 000000000000..bef7a86588eb
--- /dev/null
+++ b/app-laptop/laptop-mode-tools/files/1.62/0020-install-make-systemd-optional-and-configurable-locat.patch
@@ -0,0 +1,68 @@
+From 523a3fdbf3d7bd897b0fe55fb6da50758eb83b7e Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Sun, 17 Mar 2013 00:09:50 +0200
+Subject: [PATCH 20/20] install: make systemd optional and configurable
+ locations
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+---
+ install.sh | 24 +++++++++++++++---------
+ 1 file changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/install.sh b/install.sh
+index 85a7cd4..ed019f7 100755
+--- a/install.sh
++++ b/install.sh
+@@ -30,6 +30,9 @@
+ [ -z "$MAN_D" ] && MAN_D="/usr/man"
+ [ -z "$LIB_D" ] && LIB_D="/lib"
+ [ -z "$UDEV_D" ] && UDEV_D="$LIB_D/udev"
++[ -z "$SYSTEMD" ] && SYSTEMD="yes"
++[ -z "$SYSTEMD_UNIT_D" ] && SYSTEMD_UNIT_D="$LIB_D/systemd/system"
++[ -z "$TMPFILES_D" ] && TMPFILES_D="$LIB_D/tmpfiles.d"
+
+ if [ -z "$ACPI" ] ; then
+ ACPI=auto
+@@ -112,12 +115,10 @@ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/nolm-ac-start"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/nolm-ac-stop"
+ $INSTALL -d -m 755 "$DESTDIR/usr/share/laptop-mode-tools/modules"
+ $INSTALL -d -m 755 "$DESTDIR/usr/share/laptop-mode-tools/module-helpers"
+-$INSTALL -d -m 755 "$DESTDIR/usr/lib/tmpfiles.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/conf.d"
+ $INSTALL -d -m 755 "$DESTDIR/etc/laptop-mode/modules"
+ $INSTALL -d -m 755 "$DESTDIR/usr/sbin"
+ $INSTALL -d -m 755 "$DESTDIR/$UDEV_D/rules.d"
+-$INSTALL -d -m 755 "$DESTDIR/$LIB_D/systemd/system"
+ $INSTALL -d -m 755 "$DESTDIR/$MAN_D/man8"
+
+ ALREADY_EXISTED=0
+@@ -209,14 +210,19 @@ if ( ! $INSTALL -D -m 755 etc/rules/lmt-udev "$DESTDIR/$UDEV_D/lmt-udev" ) ; the
+ echo "$0: Failed to install udev helper tool into $UDEV_D Installation failed."
+ fi
+
+-# systemd service
+-if ( ! $INSTALL -D -m 644 etc/systemd/laptop-mode.service "$DESTDIR/$LIB_D/systemd/system/laptop-mode.service" ) ; then
+- echo "$0: Failed to install systemd service into $LIB_D/systemd/system/ Installation failed."
+-fi
++if [ "${SYSTEMD}" = "yes" ]; then
++ $INSTALL -d -m 755 "$DESTDIR/$SYSTEMD_UNIT_D"
++ $INSTALL -d -m 755 "$DESTDIR/$TMPFILES_D"
++
++ # systemd service
++ if ( ! $INSTALL -D -m 644 etc/systemd/laptop-mode.service "$DESTDIR/$SYSTEMD_UNIT_D/laptop-mode.service" ) ; then
++ echo "$0: Failed to install systemd service into $SYSTEMD_UNIT_D Installation failed."
++ fi
+
+-# and systemd's tmpfiles.d
+-if ( ! $INSTALL -D -m 644 etc/systemd/laptop-mode.conf.tmpfiles "$DESTDIR/usr/lib/tmpfiles.d/laptop-mode.conf" ) ; then
+- echo "$0: Failed to install systemd tmpfiles into /usr/lib/tmpfiles.d/ Installation failed."
++ # and systemd's tmpfiles.d
++ if ( ! $INSTALL -D -m 644 etc/systemd/laptop-mode.conf.tmpfiles "$DESTDIR/${TMPFILES_D}/laptop-mode.conf" ) ; then
++ echo "$0: Failed to install systemd tmpfiles into ${TMPFILES_D} Installation failed."
++ fi
+ fi
+
+ ACPI_DONE=0
+--
+1.8.1.5
+