]> git.pld-linux.org Git - projects/geninitrd.git/blame - mod-tuxonice.sh
Mount rootfs from initramfs with rootfsflags options.
[projects/geninitrd.git] / mod-tuxonice.sh
CommitLineData
c65bb959
ER
1#!/bin/sh
2#
3# geninitrd mod: tuxonice
6e49b0b1 4USE_TUXONICE=${USE_TUXONICE:-no}
c65bb959
ER
5
6#
7# setup geninitrd module
8# @access public
9setup_mod_tuxonice() {
10 # backwards compatible
11
12 if [ "$USE_SUSPEND2" ]; then
13 USE_TUXONICE=$USE_SUSPEND2
14 warn "USE_SUSPEND2 is deprecated, use USE_TUXONICE now instead."
15 fi
16}
17
18# generate initrd fragment
19# @access public
20initrd_gen_tuxonice() {
1b481849
ER
21 if ! is_yes "$USE_TUXONICE"; then
22 return
23 fi
c65bb959
ER
24 mount_sys
25 add_linuxrc <<-'EOF'
26 resume=no
27 for arg in $CMDLINE; do
28 if [ "${arg##resume=}" != "${arg}" -o "${arg##resume2=}" != "${arg}" ]; then
29 resume=yes
30 fi
31 done
32 if [ "$resume" = "yes" ]; then
ff08846d
ER
33 [ -e /proc/suspend2/do_resume ] && echo 1 > /proc/suspend2/do_resume
34 [ -e /sys/power/suspend2/do_resume ] && echo 1 > /sys/power/suspend2/do_resume
35 [ -e /sys/power/tuxonice/do_resume ] && echo 1 > /sys/power/tuxonice/do_resume
c65bb959
ER
36 fi
37 EOF
38}
This page took 0.026018 seconds and 4 git commands to generate.