]>
Commit | Line | Data |
---|---|---|
c65bb959 ER |
1 | #!/bin/sh |
2 | # | |
3 | # geninitrd mod: tuxonice | |
4 | ||
5 | USE_TUXONICE=no | |
6 | ||
7 | # | |
8 | # setup geninitrd module | |
9 | # @access public | |
10 | setup_mod_tuxonice() { | |
11 | # backwards compatible | |
12 | ||
13 | if [ "$USE_SUSPEND2" ]; then | |
14 | USE_TUXONICE=$USE_SUSPEND2 | |
15 | warn "USE_SUSPEND2 is deprecated, use USE_TUXONICE now instead." | |
16 | fi | |
17 | } | |
18 | ||
19 | # generate initrd fragment | |
20 | # @access public | |
21 | initrd_gen_tuxonice() { | |
22 | mount_sys | |
23 | add_linuxrc <<-'EOF' | |
24 | resume=no | |
25 | for arg in $CMDLINE; do | |
26 | if [ "${arg##resume=}" != "${arg}" -o "${arg##resume2=}" != "${arg}" ]; then | |
27 | resume=yes | |
28 | fi | |
29 | done | |
30 | if [ "$resume" = "yes" ]; then | |
31 | [ -e /proc/suspend2/do_resume ] && echo > /proc/suspend2/do_resume | |
32 | [ -e /sys/power/suspend2/do_resume ] && echo > /sys/power/suspend2/do_resume | |
33 | [ -e /sys/power/tuxonice/do_resume ] && echo > /sys/power/tuxonice/do_resume | |
34 | fi | |
35 | EOF | |
36 | } | |
37 |