From 11e97b61b0ffa0265f2dd6e8cce3870a36c826cc Mon Sep 17 00:00:00 2001 From: mis Date: Tue, 24 Mar 2020 16:38:55 +0100 Subject: [PATCH] - added swsusp support patch Detect resume=/dev/XXX kernel param and push it to /sys/power/resume. --- geninitrd-swsusp.patch | 24 ++++++++++++++++++++++++ geninitrd.spec | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 geninitrd-swsusp.patch diff --git a/geninitrd-swsusp.patch b/geninitrd-swsusp.patch new file mode 100644 index 0000000..f34e909 --- /dev/null +++ b/geninitrd-swsusp.patch @@ -0,0 +1,24 @@ +--- geninitrd-12757/geninitrd.orig 2020-03-21 03:33:05.923455652 +0100 ++++ geninitrd-12757/geninitrd 2020-03-21 04:48:42.054252108 +0100 +@@ -1613,6 +1613,10 @@ + if [ "${arg##init=}" != "${arg}" ]; then + INIT=${arg##init=} + fi ++ # if resume param starts with /dev/ then trigger swsups with it ++ if [ "${arg##resume=/dev/}" != "${arg}" ]; then ++ RESUME=${arg##resume=} ++ fi + done + + # handling of invalid, rootfsflags, option +@@ -1708,6 +1712,10 @@ + initrd_gen_tuxonice + initrd_gen_suspend + ++add_linuxrc <<-'EOF' ++[ -n "$RESUME" ] && echo "$RESUME" > /sys/power/resume ++EOF ++ + # clean up env + add_linuxrc <<-'EOF' + if [ ! "$DEBUGINITRD" ]; then diff --git a/geninitrd.spec b/geninitrd.spec index b2387aa..a38ca00 100644 --- a/geninitrd.spec +++ b/geninitrd.spec @@ -2,7 +2,7 @@ Summary: Creates an initial ramdisk image for preloading modules Summary(pl.UTF-8): Narzędzie do tworzenia inicjalnego ramdysku używanego przy starcie systemu Name: geninitrd Version: 12787 -Release: 6 +Release: 7 License: GPL Group: Applications/System Source0: %{name}-%{version}.tar.gz @@ -10,6 +10,7 @@ Source0: %{name}-%{version}.tar.gz Patch0: %{name}-git.patch Patch1: %{name}-static-dev.patch Patch2: %{name}-posix-sh.patch +Patch3: %{name}-swsusp.patch URL: http://git.pld-linux.org/?p=projects/geninitrd.git BuildRequires: xmlto >= 0:0.0.18-1 Requires: /usr/bin/ldd @@ -85,6 +86,7 @@ bieżących informacji zawartych w /etc/modules.conf. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %{__make} -- 2.44.0