pax_global_header00006660000000000000000000000064114016412500014504gustar00rootroot0000000000000052 comment=88d54a8abcc8025693cec9c895aa1b0c122d9fd5 hibernate-2.0+15+g88d54a8/000077500000000000000000000000001140164125000146775ustar00rootroot00000000000000hibernate-2.0+15+g88d54a8/CHANGELOG000066400000000000000000000543011140164125000161140ustar00rootroot00000000000000Unreleased - Change default compressor to lzo (applies to TuxOnIce 3.0.1 and later) - Remove executable state from virtualbox scriptlet. 2.0 - Change remaining "Software Suspend", "Software Suspend 2" and suspend2 references to TuxOnIce. - Redirect stderr to /dev/null when resetting the cpu scaling speed. - Fix errors of the type sh: arithmetic expression: expecting primary: "5&1", which occured at resume time. sh likes whitespace around operators, it seems. - Remove NVidia from blacklist as of 2.6.25 kernels (seems to be about the time when it became usable). - Blacklist snd_ice1712. - Rename suspend2 files to tuxonice. - Apply Archlinux patch for KDE4 locking from http://repos.archlinux.org/viewvc.cgi/hibernate-script/repos/extra-i686/add-freedesktop.org-locking.patch?view=markup - Add VirtualBox scriptlet from bug 394 - Apply fix from bug 245, so amarok's use of xmms plugins doesn't make the hibernate script think xmms is running. - Modify HIBERNATE_FILEWRITER_TRAIL in init.d/hibernate-cleanup.sh to match scriptlets.d/tuxonice. - Add support for locking Enlightenment 17, from bug 400. - Unblacklist iwl3945 and the mac80211 modules, post 2.6.27. - Add pidgin script from bug 322. - Add DirectIsa option for clock scriptlet. - Bump version to 2.0. 1.99 (1 May 2008) - Complete support for the new binary signature - Blacklist uvcvideo for now. Causes an oops at atomic copy under some circumstances (2.6.25). - Change most references to suspend2/Software Suspend etc to TuxOnIce. (Most = not the ones that shouldn't be changed!) - Remove long gone save/load all settings support. - Handle recent kernels returning "" from the cpu freq scaling_setspeed sysfs entry. It was causing the hibernate script to die prematurely. - Fix a minor typo in USuspendRamPCiSave blurp (Madduck) 1.98.1 (31 March 2008) - Correct a typo in the way I fixed bashisms in 1.98, which prevented hibernate from running at all. Sorry. 1.98 (31 March 2008) - Some fbsplash fixups, default theme is taken from cmdline now (Alon Bar-Lev) - Fix filewriter issue (Alon Bar-Lev). - Add some notes about dependencies at common.conf (Alon Bar-Lev). - Fixup FindXServer environment settings, Gentoo bug#199806, Debian bug#457185 (Alon Bar-Lev). - Update gentoo module reload to meet openrc (Alon Bar-Lev). - Silent wait for fbsplashd to quit (Alon Bar-Lev). - Implement USuspendRamPciSave to allow passing the -v option to s2ram (Debian bug#473322). - Implement "USuspendRamRadeontool to allow passing the -r option to s2ram; Debian bug#445974 (Matthijs Kooijman). - Work around a bashism when mktemp is not available; Debian bug#464989 (Morten Werner Forsbring). - Remove further bashisms (local variables are initialised on declaration); also Debian bug#464989. 1.97 (6 October 2007) - Add USuspendRamUnsureOk config option to instruct s2ram to continue when it's unsure about the system type, thus not requiring -f to be passed (thanks to Andrew Pimlott; Debian bug #433028). - Add AcpiVideo* to hardware_tweaks (Alon Bar-Lev) - Modify modules_gentoo for baselayout-2, will work with baselayout-1 too (Alon Bar-Lev) - Modify for splashutils-1.5.1.1 (Alon Bar-Lev) - Add uswsup support to hibernate-cleanup (Alon Bar-Lev) - scriptlets.d/lock now supports XtrLock (Patch by "cg"; Debian bug #427475). - move get_env_var_of_process function to main script so that it may be reused; also make gaim scriptlet use it (Patch by Pascal Dormeau; Debian bug #433003). - add scriptlets to make hibernate enable offline mode of sylpheed-claws and galeon; thanks to Norbert Buchmuller (see Debian bug #427376). I was unsure whether to include these, but there seem to be users and I accidentally distributed them in the last release of the Debian package, so I might just as well push them upstream now anyway... - patch by Joey Hess which fixes the backlight script to work better if the backlight was initially below 10% (Debian bug #434825). - scriptlets.d/sysfs_power_state: use `uname -m` instead of `arch`; thanks to Uwe Herman (Debian bug #436287). - prevent double execution of included configuration files (Debian bug #433965). This also takes care of Debian bug #392712. Thanks to "CSights" and Martin Ziegler for analysing this. - Fix filewriter support for Tux-On-Ice; thanks to Matthias Hensler for the patch. - Add iwl3945, mac80211, and sky2 modules to blacklisted-modules; thanks to Jan Ondrej. - Add anacron to comment for RestartServices (Debian bug #414100). 1.96 (16 July 2007) - Stop blacklisting button module after 2.6.21. - Fix support for file & swap allocators (rename from $NAMEwriter). - Add support for rename of Suspend2 to TuxOnIce. - Add support for rename of /sys/power/suspend2/resume2 to .../resume, matching Suspend2 release 2.2.10.2 and later. - Cope with clock going backwards when considering LAST_RESUME_WAIT (Thomas de Schampheleire) - Fix typo in scriptlets.d/ususpend (Alon Bar-Lev) - Use modprobe -r -N instead of rmmod (if we have it). - Don't lock screen when doing bug reports. - Blacklist the ipw3945 module (Debian bug #427252) - Add LSB headers to init.d/hibernate-cleanup.sh - Add USuspendRamVbeMode and USuspendRamAcpiSleep to pass -m/-a flags to s2ram (mainly for Intel chipsets) (Ricardo Salvetti, Enrico Tassi; Debian bug #427684). - Add SwitchToTextModeOnResume option. Unlike SwitchToTextMode, which switches, hibernates, and returns to X on resume, this option waits until after the resume, then switches to text mode and then back to X (Joey Hess; Debian bug #420400, #420401). - scriptlets.d/network: run ifup in the background on Debian/Ubuntu to avoid locking problems (Joey Hess; Debian bug #422539). - scriptlets.d/lock: do not hang in FindXServer when no XAUTHORITY variable is set. - scriptlets.d/xbacklight: fancy fading on suspend and resume thanks to Joey Hess (Debian bug #430148). - scriptlets.d/gaim: inform running gaim instances of suspend/resume to let them go offline/online (thanks Norbert Buchmuller; Debian bug #427376). - scriptlets/networkmanager: put NM to sleep and wake it up after resume (thanks Markus Becker; Debian bug #387456). - disable vbetool by default in ram.conf (Debian bug #400688). - brought hibernate.vim up to speed. 1.95 (18 May 2007) - Add support for renamed swap and file directories in suspend2 2.2.8.4 and later. - Apply hibernate script patches from Christopher Sawtell. - Make vcat always transparent (fixes vbetool failures) - Remove restriction from init.d script that swap partitions must be labelled as swap in a partition table (unlike some dm-crypt devices). (Alon Bar-Lev) - Call 915resolution restart instead of start on Gentoo. (Alon Bar-Lev) - Promote ubuntu to distribution status. - Fix gfx_brightness in cases the proc file shows a 0 (Joey Hess; Debian bug #410750). - Add videodump scriptlet by Joey Hess to dump and reload the video card memory (Debian bug #410751). - Prevent screensaver from activating when --no-suspend is given. - Add patch to enable 2ram -p/-s options in a similar way to -f (Enrico Tassi; Debian bug #416967). - Add support for modprobing suspend modules early in the process of checking for Suspend2 support (and rmmod loaded ones post-resume). (Jens Gustedt) Modified by Nigel Cunningham. - Allow for distribution specific patches. (Alon Bar-Lev) - Don't load kernel modules when installing or doing --help. (Alon Bar-Lev) - Don't return an error if no file trail. (Alon Bar-Lev) - Fix uninstalled conf files and minor name extension issue. (Alon Bar-Lev) - Make FullSpeedCPU restore the speed of all cores, not just the last one. (Michael Gisbers) 1.94 (10 October 2006) - Make media player detection a little more robust. (Nicolas Bonifas) - Fix bogus amarok detection. (Andrew Deason) - Accomodate affected_cpus for FullSpeedCPU option. - Don't reset last_result (breaks compatibility with some obscure versions of suspend2 from the dark ages). - Fix cardctl detection bug in zsh. (Florian Tham) - Update error statuses for suspend2. - Do not lock KDE sessions that are already locked. (Alexandre Ferreira) [martin f. krafft] - Added a new scriptlet to restore the brightness of GFX cards on resume (Joey Hess; Debian bug #384140). - Use /proc/net/dev instead of ifconfig to enumerate network devices, because the latter would ignore madwifi interfaces. - Improved ususpend method. Now supports USuspendRamForce (boolean) to pass the -f option to s2ram. Also tests with s2ram's -n option if s2ram is used and the option is not set. I also made disk.conf and ram.conf prefer the uswsusp methods, if they are available. If you do not want to use them, use the sysfs-{ram,disk}.conf files, which are the former ram.conf and disk.conf files. - Added scriptlet to remount /boot read-only if /boot is a separate partition, contains an XFS filesystem, hibernate was asked to update the Grub menu file, and this feature has not been disabled in the configuration file (Debian bugs #317479, #317479, #386623). Also added README.xfs to document caveats for users of the XFS filesystem. - Added ath_pci to blacklisted modules (see Debian bug #383169). - Reworded the init.d script message about invalidating stale signatures (Debian bug #381903). - Fixed a typo in hibernate.conf manpage (Debian bug #386799) - Changed vbetool scriptlet to log stderr output to log file, and only let output through to real stderr if verbosity >=2 is selected (Debian bug #381927). 1.93 (12 July 2006) - More updates for suspend2 compatibility with 2.2.7.3. 1.92 (12 July 2006) - Fix init.d script to only clean signatures at boot-time. (Martin F Krafft) - Fix typo in TryMethod log message. (EspeonEefi) - Process command-line verbosity level earlier to ease debugging of config files. - Update PowerdownMethod 0 doco. (Jens Gustedt) - Support for uswsusp. (Jason Lunz) - Ignore leading non-numeric portions of module versions. - Support for updated sysfs interface in Suspend2 2.2.7.3. - Added FullSpeedCPU option to maximise CPU speed whilst suspending. - amaroK pause support. (Kevin 'radsaq' Radloff) - Added MuteAudio option. - Disable suspend-to-RAM for ppc kernels < 2.6.16.20. (Johannes Berg) 1.91 (5 June 2006) - Call common.conf from each of {suspend2,disk,ram}.conf so that hibernate-ram works again. 1.90 (5 June 2006) - Add $CONFIG_PREFIX to install script. - Refine grub menu restoration messages. - Make xlock scriptlet mawk-compatible. - Don't output config options with --help. - Allow PowerdownMethod 0 (don't use ACPI). - Don't evaluate $? too early. (Henrique de Moraes Holschuh and Alon Bar-Lev) - Try an alternate method of finding X parameters. (Joey Hess) - Allow disabling the xmessage dialogs. (Joey Hess) - Added pause_audio scriptlet to avoid embarrassing situations. (Joey Hess) - Fix xosd font quoting issues in xstatus. (Joey Hess) - Add an option for running i915resolution on resume. (Joey Hess) - Split out config files into a new structure. - Add the ability to try various suspend methods until one succeeds. - Support for pccardctl. (Martin F Krafft) - Fix X11R6/bin not appearing in path through su in xlock. (Leonid Evdokimov) - Allow passing a different config to UseDummyXServer. (Wolfgang Karall) - Support for gnome-screensaver. (Sam Noble) - Fix file locations and paths for slackware. (PJ Beers) - Don't allow suspending when rebooting or shutting down. (Henrique de Moraes Holschuh) - Support for timestamps in hibernate.log (for profiling) 1.12 (2 October 2005, later that day) - Fix some hardcoded paths in the suspend2 scriptlet. 1.11 (2 October 2005) - Remove trailing LILO command-line to avoid asking for passwords. (Bug#65) - Unload compressor or encryptor modules that we loaded on suspend. (Bug#66) - Silence fuser. - Ensure we have chvt. (Bug#71) - Added PCMCIA scriptlet to eject cards before suspending. (Bug#75) - Added fluxbox, fvwm and pwm to list of detected window managers for X server. (Bug#81) - Added RestoreVCSAData option (helps some people resume with the fglrx driver). - Added --lock-console-as option. (Bug#84) - Allow --help to work without root. (Bug#85) - Added XLock and XAutolock options. (Gene Pavlovsky) (Bug#111) - Remove interface_version detection (for Software Suspend 2.2-rc8) 1.10 (13 July 2005) - Turn swap off before clearing it in init.d script. - Make an awk expression mawk compatible. - Fix quoting in grub. - Test fix for funky colours when using fbsplash (Henrik Brix Andersen). 1.09 (27 June 2005) - Use /bin/echo when calling kernel suspend methods to avoid getting killed on oopses. (Piotr P. Karwasz) - Make Distribution option case-insensitive. - Fix non-standard path issue with KDE xstatus dialog under Gentoo (Pat Double) - Fix non-standard path issue with KDE xstatus dialog under SuSE. - Clean up stderr output in xstatus. (Pat Double) - Only bring down interfaces that are up. - Slackware path fixes (Chris Friedhoff) - Support for cryptoapi in Suspend2. - Added logrotate script for hibernate.log. (Henrik Brix Andersen) - Only start services enabled for the given runlevel. (Stephen Gildea) 1.08 (13 May 2005 - "Black Floody Friday") - Fix fbsplash colour weirdness (Henrik Brix Andersen) - Make fbsplash/bootsplash automatically select on SwitchToTextMode. - Remove spurious VT switches (also means fbsplash should be seamless between hibernate script and userui). - Change ":" to "true" for compatibility with some versions of dash (Henrik Brix Andersen) - Rename a bunch of options with "Suspend2" instead of swsusp, specifically: UseSwsusp2 -> UseSuspend2 Swsusp2AllSettings -> Suspend2AllSettings Swsusp2AllSettingsFile -> Suspend2AllSettingsFile SwsuspVT -> HibernateVT Old options names are still recognised, but not advertised. - Enforce modprobe/hotplug disabling whilst suspending unconditionally. - Add a "hardware tweaks" scriptlet for hardware-specific config options, currently includes: * using the ibm_acpi module to signal suspend progress (Henrik Brix Andersen) * using radeontool to turn your backlight on and off (Henrik Brix Andersen) - Enable SwitchToTextMode in the default config. - Only allow the user to choose one suspend method. - Don't attempt to suspend within 3 seconds of resuming. 1.07 (21 April 2005) - Fix vbetool scriptlet inverted test condition. - Install ram.conf by default - Add note about init.d script in readme. - Fix GRUB alternate menu bug. (Andrew Barr) 1.06 (4 April 2005) - Use rmmod, not modprobe -r. (Ivo Prikryl) - Added new kernel safety scriptlet. (Cameron Patrick) - Fix /proc/software_suspend/ detection for versions >= 2.1.8. - Fallback to xlock for xscreensaver. (Stefan Tomanek) - Elaborate on acpid usage in readme. (Erich Schubert) - Add options to vbetool to POST and restore a previously saved state. - Improve robustness of grub scriptlet. (Martin Krafft) - Bring up the xscreensaver password prompt on resume, if xscreensaver locking is switched on. (Cameron Patrick) - Support for Including other files within hibernate.conf. (Cameron Patrick) - Introduce an fbsplash scriptlet to replace bootsplash. - Added support for Suspend2's filewriter. - Added init.d script for /etc/rcS.d/ to remove suspend partition signatures. 1.05 (9 February 2005) - Wait after loading suspend modules until the relevant proc entries are found. - Fix numerous bugs in xstatus. 1.04 (8 February 2005) - Avoid making spurious temporary files. - Relax permissions on install directory to 755 instead of 700. - Include kernel configs in bug reports. - New xstatus scriptlet. (merged works of Henrik Brix Andersen and Sebastian Kugler) - Activate bootsplash on the right console. (Sergio Cerlesi) - Make mktemp calls compatible with RHEL3. (Andreas Mohr) - Extra error checking for numerical values. (Cameron Patrick) - Set a sane umask before doing anything else. - Include vbetool scriptlet for better S3 support. (Cameron Patrick) - Automagically use dash if it's available. 1.03 (5 January 2005) - Add ndiswrapper to blacklist. - Fix blacklisted modules without versions bug. (Peter Cech) - Fix random services-stopping-twice bug. - Add --bug-report option. - Support unloading particular versions of modules. - Use the hwclock.sh init script on Debian. - Restart services in reverse order to stopping them. 1.02 (24 November 2004) - Make misc launch scriptlets more robust. - Change /proc/sys/kernel/{modprobe,hotplug} to a non-existant executable whilst suspending. - Add PowerdownMethod for SysfsPowerState module (to select platform/shutdown/firmware). - Added UnmountFSTypes for selectively unmounting certain filesystems (eg nfs). - Added UnmountGraceTime to alter time between sending SIGTERM and SIGKILL to processes using a filesystem. - Support for implicit configuration files (calling script as hibernate-foo causes it to use /etc/hibernate/foo.conf). - Really fix RPM configuration file overwriting issue (Stefan Becker). 1.01 (18 November 2004) - Rename LeaveXBeforeSuspend to SwitchToTextMode. - Rename nVidiaHack to UseDummyXServer. - New acpi_sleep module to utilise /proc/acpi/sleep for vanilla swsusp. - Added Swsusp2AllSettingsFile option (and command-line option --save-settings) - Fix missing mawk compatibility bug in lock. - Add locking to hibernate script to avoid being run more than once simultaneously. - Turn off Unicode on the Software Suspend VT. - Fix completely broken error code reporting. - Log dmesg info to hibernate.log if errors occur. - Return a non-zero exit status on failure to suspend. 1.00 (7 November 2004) - Fix a long standing bug when printing error result codes. - Add AsyncIOLimit option (Lorenzo Colitti). - Make DefaultConsoleLevel not expect a boolean value. - Add the PowerdownMethod option for Software Suspend 2.1. - Add a ProcSetting option to allow setting any arbitrary entry in /proc/software_suspend. - Support suspending using do_suspend instead of activate. - Added ipw2200 to the blacklist. 0.99 (10 October 2004) - Make SCRIPTLET_PATH work again so that user-defined scriptlets can be placed in /etc/hibernate /usr/local/share/hibernate will actually work. Place /usr/share/hibernate/scriptlets.d at the end of scriptlet search path so that custom scriptlets override standard ones. (Cameron Patrick) - Clear the screen before locking virtual consoles with vlock. (Cameron Patrick) - Explicitly add /sbin to PATH to ensure we find rmmod and friends. - Make mawk compatible (Lorenzo Colitti). - Ensure we do get a return value from the kernel. 0.98 (20 August 2004) - Add ImageSizeLimit option (including "nocache" for excluding caches & buffers - needs tweaking it seems) - Always switch consoles if swsusp >= 2.0.0.103. - Initial support for a module blacklist (on by default). - Support recursing module unloading (used for UnloadModules amongst others). - Initrd support - loading suspend modules only when needed, and setting a resume2 device. - Reimplemented xscreensaver locking (inspired by pmsuspend script) - Find gentoo's dcop program in funny places. - Stop RPM from clobbering config file. 0.97 (30 July 2004) - Added lilo scriptlet to ensure the current kernel boots next time to resume. (inspired by Fedor Karpelevitch). - Added the Mount option to mount filesystems after resume. - More bootsplash fixes. - Fix overgenerous module unloading. - Detect new /proc root (/proc/software_suspend/) for >= 2.0.0.102. - Make LogVerbosity option actually work. 0.96 (24 July 2004) - Make the --config-file= option work once again (oops!) - Added the lock scriptlet for locking KDE, XScreensaver or the entire system via vlock. - Minor bootsplash cleanups. 0.95.1 (23 July 2004) - Fixed misclaunch scripts always failing bug. 0.95 (21 July 2004) - Install distributed scriptlets into /usr/local/share/hibernate/scriptlets.d Locally installed scriptlets can go into either /etc/hibernate/scriptlets.d or /usr/local/share/hibernate/scriptlets.d. Distribution packages can use /usr/share/hibernate/scriptlets.d. All three are searched. - Added AlternateGrubMenuFile option. - Added devices scriptlet for defining suspend-incompatible devices (eg, /dev/dsp) using IncompatibleDevices option. (Carsten Rietzschel) - Added /sys/power/state scriptlet sysfs_power_state as an alternative to swsusp2. (Cameron Patrick) - Added -n option to be equivalent to --no-suspend. - Added --dry-run option to just list what would get done. - Don't hardcode /sbin/splash. - Fixed Bootsplash and LeaveXBeforeSuspend interactions. - Don't assume /proc/swsusp/reboot exists (2.0 w/o debug doesn't have it). - Generate and install man pages. - Created a vim syntax highlighting spec file 0.94 (12 July 2004) - Turn off "AlwaysForce yes" in the default config file. - Make switching back to X occur before networking and services, to give the impression that resuming is faster ;) (Cameron Patrick) - Take more care with scriptlet return values to make Ctrl+C actually work whn not using --force. 0.93 (11 July 2004 (later that evening)) - Make Ctrl+C abort cleanly again. - chown the right directory in the installer. - Licensed under GPLv2. 0.92 (11 July 2004) - /etc/suspend/, suspend.conf, and swsusp.log are now called /etc/hibernate/, hibernate.conf and hibernate.log for consistency. - Redirect stderr to stdout so that both get logged. $LOGPIPE is also no longer required in scriptlets. New option LogVerbosity. - Cause abort if module unloading fails. (Cameron Patrick) - New (cleaner) method of launching fake X server. - Disable module loading during suspend. - Lots of speed improvements for faster start up time! (Bash scripts shouldn't *have* a startup time :) 0.91 (9 July 2004 (later that day)) - Multiple fixes for grub - restoring the grub menu is now achieved by using "hibernate -g" or "hibernate --restore-grub", not by running the scriptlet. - Extend NN range for scripts to 00-99. - Bleeding obvious bugfixes to bootsplash, misclaunch and modules scriptlets. - Avoid sourcing editor backup files (ignore scriptlets *~ *.bak). - ash compatibility fix in install script. - Remove some unnecessary sleep calls. - Thanks to Cameron Patrick and Carsten Rietzschel for most of these fixes. 0.9 (9 July 2004) - First public release. hibernate-2.0+15+g88d54a8/COPYING000066400000000000000000000431101140164125000157310ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. hibernate-2.0+15+g88d54a8/README000066400000000000000000000153041140164125000155620ustar00rootroot00000000000000The hibernate-script package offers a utility that performs all the preparatory steps to suspending your machine, invoking the desired suspend method (either one of the suspend-to-disk variants, or suspend-to-RAM), and restoring your machine on resume. PREREQUISITES ------------- A kernel with suspend support of some variety. The currently supported options are: - TuxOnIce - kernel patches are available from http://www.tuxonice.net/ - swsusp support in vanilla 2.6 kernels (through the UseSysfsPowerState disk option). - S3 (suspend-to-RAM) support in 2.6 kernels (through the UseSysfsPowerState mem option). INSTALLATION ------------ To install, simply run the install.sh script as root: # ./install.sh [...] By default, this will install the following files and directories: /usr/local/sbin/hibernate <--- main executable script /etc/hibernate/ /etc/hibernate/hibernate.conf <--- main configuration file /usr/local/share/hibernate/scriptlets.d/ <--- contains "scriptlets" (or plugins) and the various scriptlets that live here /etc/hibernate/scriptlets.d/ <--- contains any extra scriptlets /usr/local/man/man8/hibernate.8 /usr/local/man/man5/hibernate.conf.5 If you already have a configuration file at /etc/hibernate/hibernate.conf, the new configuration file will be installed at /etc/hibernate/hibernate.conf.dist You will have to merge your changes manually. AVOIDING DATA LOSS ------------------ If you are using the hibernate script with vanilla swsusp or TuxOnIce, then it is strongly recommended that you install the script init.d/hibernate-cleanup.sh into /etc/init.d (or the relevant place on your distribution), and arrange for it to be run on boot from rcS.d, somewhere before enabling swap or clearing out /var/run, but after mounting your filesystems (/var in particular). This script will invalidate any suspend image on a clean boot so that the image cannot be later resumed from (leading to corruption of your filesystems). Additionally, the hibernate script will look for a particular file before suspending (/var/run/tuxonice-new-kernel) and if it is detected, will refuse to suspend. The idea is that your installation scripts for new kernels create this file, which prevents you from hibernating until you have booted your new kernel (or you remove the file manually if you know what you are doing). For example, kernel packages compiled with the Debian kernel-patch-tuxonice patches do this upon installation. CONFIGURATION ------------- The default configuration does nothing but save and restore your clock, and unload some modules that will potentially cause suspending to fail. If you have other kernel modules that need to be unloaded, filesystems unmounted, network interfaces brought down, etc, you will want to customise the configuration file in /etc/hibernate/hibernate.conf. Run hibernate -h for help on the possible options. There is also a man page for hibernate.conf as well as hibernate itself. RUNNING ------- Simply calling "hibernate" as root will do everything mentioned in the configuration file to hibernate, and activate your suspend method. Upon resuming, any tasks for resuming the machine are run and the script exits. If you want users other than root to be able to run the script, check out the sudo package. CALLING FROM ACPID ------------------ You may wish to call this script from acpid to allow you to press a button on your machine to hibernate, or to activate it on lid closure. For example, you could modify /etc/acpi/events/powerbtn to run hibernate when you press the power button, as follows: event=button[ /]power PWRF action=/usr/local/sbin/hibernate You can watch ACPI events as they occur by running acpi_listen. If you find that your machine is hibernating twice, you are probably receiving two events for each button press. To only trigger on one, you may need to use the line event=button[ /]power PWRF.*[02468ace]$ to match only every second event. However, for non-button events (such as triggering on lid closure), it may be more reliable to check the state of the lid before suspending. For example, a small script called /etc/acpi/lid.sh : #!/bin/sh # # Initiate suspend when lid is closed if grep -q closed /proc/acpi/button/lid/$2/state ; then /usr/local/sbin/hibernate fi and in /etc/acpi/events/lid event=button[ /]lid action=/etc/acpi/lid.sh %e will trigger only when the lid is closed. For more details, man acpid. For debugging look into /var/log/acpid. MORE SCRIPTLETS --------------- As the hibernate script is very extensible , some users have written their own scriptlets to control certain applications or hardware at suspend and resume time. These scriptlets can be found on the TuxOnIce Wiki at http://wiki.tuxonice.net/HibernateScript . These are not supported by the hibernate script author, but you should be able to find help either from their respective authors or the tuxonice-users list. HELP ---- If you have problems with the hibernate script or TuxOnIce, the best place to ask is on the mailing list - tuxonice-users@lists.tuxonice.net. You will need to subscribe to post. See http://www.tuxonice.net/lists for details. If the suspend process itself crashes (while "Writing caches", "Reading caches", or "Copying original kernel back", etc), then the problem lies with TuxOnIce itself. See the FAQ at http://www.tuxonice.net/ for help on debugging. AUTHOR ------ This script was written by Bernard Blackham, with contributions from: - Carsten Rietzschel (modules, devices, bootsplash, lock and grub scriptlets. many ideas and bugfixes) - Cameron Patrick (sysfs_power_state, xscreensaver support for lock, many bugfixes and ideas, man pages and Debian packaging) - Kevin Fenzi (rpm packaging, ideas) - Henrik Brix Andersen (gentoo packaging, hardware_tweaks scriptlet and doing lots of debugging) - martin f. krafft (bugfixes and ideas, XFS handling, Debian integration and packaging) - Fedor Karpelevitch (lilo scriptlet idea) - And many others! (see changelog for full credits) LICENSE ------- Copyright (C) 2004-2006 Bernard Blackham The hibernate-script package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. $Id$ hibernate-2.0+15+g88d54a8/README.xfs000066400000000000000000000026761140164125000163710ustar00rootroot00000000000000Caveats for XFS users ===================== The XFS filesystem has some serious limitations when it comes to synchronisation of buffers with the hard media (see http://bugs.debian.org/317479). If you are using Grub and /boot/grub is on an XFS filesystem, it is very likely that your system will dump you into the Grub prompt during resume, instead of just booting the kernel to be used for the resume process. If you are in this situation, the solution is to enter configfile /grub/menu.lst~ or: configfile /boot/grub/menu.lst~ and hit enter twice. Do note the trailing tilde in the filename, which is necessary. If you do not want to enter the above during every boot, there are two things you can do: 1. disable the ChangeGrubMenu option. 2. enable the RemountXFSBoot option; this will make things work if and only if you have a separate partition for /boot. You can verify this with the following command: df / /boot | uniq | wc -l if this returns 3, you are all good. If you get a 2 instead, RemountXFSBoot will *not* work for you (but it doesn't hurt to leave it on either). If the command returns something else than 2 or 3, you should go and see a doctor, or an alien spaceship has just landed inside your refrigerator. Investigate! If you figure out a way to make ChangeGrubMenu work with XFS and /boot on the root filesystem, please let me know! -- martin f. krafft Sat, 15 Jul 2006 19:07:59 +0200 hibernate-2.0+15+g88d54a8/SCRIPTLET-API000066400000000000000000000153531140164125000166110ustar00rootroot00000000000000------------------------------------------------------------------------------ API for Hibernate Scriptlets ------------------------------------------------------------------------------ A scriptlet is written in shell code, and is simply sourced into the main script. This means it can potentially change a lot about the way suspending works. For sanity's sake though, their actions should be restricted to work through a small set of functions provided by the main hibernate script. These are documented below. A scriptlet can request both extra command-line arguments, or extra configuration file options. It can execute arbitrary commands during the suspend and resume process. NAMING ------ A scriptlet's name (filename) is restricted to alphanumerics and the underscore (_) character. Otherwise, things will break! It must not conflict with an existing script (the hibernate script will warn if it does). Function and variable names within the scriptlet should be sufficiently unique (eg, prefixed with the name of the scriptlet). STDOUT/STDERR ------------- A scriptlet should use vecho rather than echo, and choose a verbosity level appropriately (see vecho, below). All scriptlet output is automatically sent to $LOGPIPE FUNCTIONS --------- AddSuspendHook NN function_name This will add the given function to the chain of functions called at suspend. NN must be a number between 00 and 99, inclusive (see ORDERING section below). A scriptlet should only add a function to the suspend chain until it knows that it is going to do work (eg, it parses a config option to do something). eg: AddSuspendHook 55 SuspendHair AddResumeHook NN function_name Similar to above. See ORDERING section below. eg: AddSuspendHook 55 ResumeHair AddConfigHandler function_name The given function_name will be called when a configuration file line is read and hasn't been handled already. The entire line is passed as parameters to the function. The function must return 0 if it handled the function, and 1 otherwise. eg: AddConfigHandler HairParseConfig AddConfigHelp Similar to above, but for configuration file options. eg: AddConfigHelp "HairTime " "Allows some extra time to wash your hair while suspending." AddOptionHandler function_name The given function_name will be called when a command line option is received that hasn't been handled already. If the option has no parameter, then the function is called with a single paramter, which is the option itself in single quotes (eg, '-t' or '--time'). If the option has a parameter linked with it, the function is called with two parameters - the first is the option, as before and the second is the parameter. The function must return 0 if it handled the function, and 1 otherwise. eg: AddOptionHandler HairParseOptions AddShortOption