|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
From 4a3e812e0b6a3974bff0f0b1232d3ac95efe8902 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
From: Alexander Tsoy <alexander@tsoy.me>
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
Date: Fri, 16 May 2014 21:12:36 +0400
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
Subject: [PATCH] resume/module-setup.sh: filter out empty resume= options in
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
cmdline()
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
cmdline() prints empty "resume=" options for non-persistent swap
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
devices, for example zram. Add a check for that.
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
This patch also fixes printf formatting and removes unused variables.
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
modules.d/95resume/module-setup.sh | 6 +++---
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
index ceb785510f..b1b4684b76 100755
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
--- a/modules.d/95resume/module-setup.sh
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
+++ b/modules.d/95resume/module-setup.sh
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
@@ -17,12 +17,12 @@ check() {
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
# called by dracut
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
cmdline() {
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
- local _activated
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
- declare -A _activated
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
+ local _resume
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
for dev in "${!host_fs_types[@]}"; do
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
[[ ${host_fs_types[$dev]} =~ ^(swap|swsuspend|swsupend)$ ]] || continue
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
- printf "resume=%s " "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
+ _resume=$(shorten_persistent_dev "$(get_persistent_dev "$dev")")
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
+ [[ -n ${_resume} ]] && printf " resume=%s" "${_resume}"
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
done
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
--
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
1.9.3
|
|
Zbigniew Jędrzejewski-Szmek |
7f4a44 |
|