File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2165,6 +2165,11 @@ and is between 256 and 4096 characters. It is defined in the file
21652165 in <PAGE_SIZE> units (needed only for swap files).
21662166 See Documentation/power/swsusp-and-swap-files.txt
21672167
2168+ hibernate= [HIBERNATION]
2169+ noresume Don't check if there's a hibernation image
2170+ present during boot.
2171+ nocompress Don't compress/decompress hibernation images.
2172+
21682173 retain_initrd [RAM] Keep initrd memory after extraction
21692174
21702175 rhash_entries= [KNL,NET]
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ swsusp saves the state of the machine into active swaps and then reboots or
6666powerdowns. You must explicitly specify the swap partition to resume from with
6767``resume='' kernel option. If signature is found it loads and restores saved
6868state. If the option ``noresume'' is specified as a boot parameter, it skips
69- the resuming.
69+ the resuming. If the option ``hibernate=nocompress'' is specified as a boot
70+ parameter, it saves hibernation image without compression.
7071
7172In the meantime while the system is suspended you should not add/remove any
7273of the hardware, write to the filesystems, etc.
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ config SUSPEND_FREEZER
137137config HIBERNATION
138138 bool "Hibernation (aka 'suspend to disk')"
139139 depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
140+ select LZO_COMPRESS
141+ select LZO_DECOMPRESS
140142 select SUSPEND_NVS if HAS_IOMEM
141143 ---help---
142144 Enable the suspend to disk (STD) functionality, which is usually
Original file line number Diff line number Diff line change 2929#include "power.h"
3030
3131
32+ static int nocompress = 0 ;
3233static int noresume = 0 ;
3334static char resume_file [256 ] = CONFIG_PM_STD_PARTITION ;
3435dev_t swsusp_resume_device ;
@@ -638,6 +639,8 @@ int hibernate(void)
638639
639640 if (hibernation_mode == HIBERNATION_PLATFORM )
640641 flags |= SF_PLATFORM_MODE ;
642+ if (nocompress )
643+ flags |= SF_NOCOMPRESS_MODE ;
641644 pr_debug ("PM: writing image.\n" );
642645 error = swsusp_write (flags );
643646 swsusp_free ();
@@ -1004,6 +1007,15 @@ static int __init resume_offset_setup(char *str)
10041007 return 1 ;
10051008}
10061009
1010+ static int __init hibernate_setup (char * str )
1011+ {
1012+ if (!strncmp (str , "noresume" , 8 ))
1013+ noresume = 1 ;
1014+ else if (!strncmp (str , "nocompress" , 10 ))
1015+ nocompress = 1 ;
1016+ return 1 ;
1017+ }
1018+
10071019static int __init noresume_setup (char * str )
10081020{
10091021 noresume = 1 ;
@@ -1013,3 +1025,4 @@ static int __init noresume_setup(char *str)
10131025__setup ("noresume" , noresume_setup );
10141026__setup ("resume_offset=" , resume_offset_setup );
10151027__setup ("resume=" , resume_setup );
1028+ __setup ("hibernate=" , hibernate_setup );
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ extern int swsusp_swap_in_use(void);
134134 * the image header.
135135 */
136136#define SF_PLATFORM_MODE 1
137+ #define SF_NOCOMPRESS_MODE 2
137138
138139/* kernel/power/hibernate.c */
139140extern int swsusp_check (void );
You can’t perform that action at this time.
0 commit comments