summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 0adfb6a..3670df6 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -17,6 +17,7 @@ set -a
PM_UTILS_LIBDIR="@PM-UTILS-LIBDIR@"
PM_UTILS_ETCDIR="@PM-UTILS-SYSCONFDIR@"
PM_UTILS_RUNDIR="/var/run/pm-utils"
+PM_CMDLINE="$*"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:"${PM_UTILS_LIBDIR}"/bin
HIBERNATE_MODE="platform"
@@ -62,6 +63,19 @@ mkdir -p "$STORAGEDIR"
done
}
+[ -f "$PM_UTILS_ETCDIR/parameters" ] && {
+ # loop through the parameters file, and add each line in it to the
+ # end of PM_CMDLINE.
+ # Comments begin with hashmarks and run to the end of the line.
+ # Because we are modifying an env var, the while read loop cannot
+ # run in a pipe like the previous one did.
+ while read parameter; do
+ parameter="$(echo $parameter |sed 's,#.*$,,g')"
+ [ -z "$parameter" ] && continue
+ PM_CMDLINE="${PM_CMDLINE} $parameter"
+ done < "$PM_UTILS_ETCDIR/parameters"
+}
+
take_suspend_lock()
{
VT=$(fgconsole)