From 6c23a59c3f14e032c4b9c85c1586ed61a3b67265 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 27 Nov 2017 14:22:01 +0100 Subject: [budybox] rtcwake patch: Default to rtc0 1) This is what rtcwake from util-linux does 2) While /dev/rtc is usually a symlink to /dev/rtc0, /sys/class/rtc/%s/device/power/wakeup doesn't exist for rtc (no symlink under /sys/class/rtc), so bb rtcwake will bail out early claiming the selected rtc does not support wakeup alarms, while really it just didn't find a file to check for support. --- core/modules/busybox/module.build | 3 +++ core/modules/busybox/rtcwake-default-rtc0.patch | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 core/modules/busybox/rtcwake-default-rtc0.patch (limited to 'core/modules/busybox') diff --git a/core/modules/busybox/module.build b/core/modules/busybox/module.build index 2721dd04..3124de81 100644 --- a/core/modules/busybox/module.build +++ b/core/modules/busybox/module.build @@ -15,6 +15,9 @@ fetch_source() { if ! grep -q 'suspend.*"no"' "util-linux/rtcwake.c"; then git apply "${MODULE_DIR}/rtcwake-mode-no.patch" || perror "Could not apply busybox patch for rtcwake 'no'-mode" fi + if ! grep -q 'rtc0' "util-linux/rtcwake.c"; then + git apply "${MODULE_DIR}/rtcwake-default-rtc0.patch" || perror "Could not apply busybox patch for rtcwake default to rtc0" + fi cd .. || perror "cd .. failed" } diff --git a/core/modules/busybox/rtcwake-default-rtc0.patch b/core/modules/busybox/rtcwake-default-rtc0.patch new file mode 100644 index 00000000..cc411cd5 --- /dev/null +++ b/core/modules/busybox/rtcwake-default-rtc0.patch @@ -0,0 +1,13 @@ +diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c +index 8aee0cf..6693305 100644 +--- a/util-linux/rtcwake.c ++++ b/util-linux/rtcwake.c +@@ -122,7 +122,7 @@ int rtcwake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int rtcwake_main(int argc UNUSED_PARAM, char **argv) + { + unsigned opt; +- const char *rtcname = NULL; ++ const char *rtcname = "/dev/rtc0"; + const char *suspend = "standby"; + const char *opt_seconds; + const char *opt_time; -- cgit v1.2.3-55-g7522