Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Polskie forum (Polish) Instalacja i sprzęt
  • Search

Hibernacja i uśpienie komputera

Pytania i problemy związane z instalacją Gentoo oraz sprzętem

Moderator: SlashBeast

Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
Author
Message
darek_si
n00b
n00b
Posts: 5
Joined: Wed Dec 31, 2008 4:28 pm

Hibernacja i uśpienie komputera

  • Quote

Post by darek_si » Mon Dec 14, 2009 9:01 pm

Postanowiłem podzielić się moimi doświadczeniami na temat hibernowania komputera oraz jeko uśpienia. Ten opis dotyczy jedynie jak skonfigurować oprogramowanie do uśpienia, nie ma tutaj opisu konfiguracji jądra. Jak będzie odzew to mogę zamieścić również konfigurację jądra. Dodatkowo w konfiguracji zostały włączone bajery dla Gnome Jak ktoś ma inny desktop to niech poczyta komentarze w pliku

Code: Select all

/etc/hibernate/common.conf
Na początek sprawdzamy, czy posiadamy potrzebne oprogramowanie:

Code: Select all

emerge -pv pm-utils hibernate-script
Jeżeli przy którymś jest N, tzn. trzeba zainstalować. Po zainstalowaniu przechodzimy do konfiguracji. Trochę tego jest. Zaczynamy od konfiguracji oprogramowania pm-utils tak, aby chciało pracować z skryptami hibernate-scripts. W tym celu trzeba utworzyć plik:

Code: Select all

/etc/pm/sleep.d/50custom
o zawartości:

Code: Select all

#!/bin/bash
KILLALL="/usr/bin/killall"
CHVT="/usr/bin/chvt"
CHMOD="/bin/chmod"
#Variables that change depending on hibernate or suspend
case $1 in
    hibernate)
        HIBERNATE="/usr/sbin/hibernate"
        PM="pm-hibernate"
        ;;
    suspend)
        HIBERNATE="/usr/sbin/hibernate-ram"
        PM="pm-suspend"
        ;;
    *)
        HIBERENATE=""
        PM=""
        ;;
esac
${KILLALL} ${PM}
${CHVT} 7
${HIBERNATE}
Skryptowi trzeba nadać bit wykonywalności. Skrypt ten robi tyle, że ubija oryginalne skrypty pm-utils i w ich miejsce uruchamia swoje. Przechodzimy do konfiguracji pakietu hibernate-scripts. Zmieniamy katalog:

Code: Select all

cd /etc/hibernate
Najważniejszy plik to common.conf. Ponieważ dość mocno w nim grzebałem, więc zamieszczam jak wygląda ostatecznie:

Code: Select all

# Configuration options common for suspending to disk or RAM.
# Options are not case sensitive.
# 
# See hibernate.conf(5) for help on the configuration items.

##############################################################################
### Some global settings
##############################################################################

Verbosity 0
LogFile /var/log/hibernate.log
LogVerbosity 1
# LogTimestamp yes
# AlwaysForce yes
# AlwaysKill yes
# HibernateVT 15
Distribution gentoo
# XDisplay :0

##############################################################################
### Scriptlets
###   Scriptlets provide support for doing all sorts of things before and after
###   suspending. The defaults settings here should work for most people, but
###   you may wish to edit these to taste. Consult "hibernate -h" for help on
###   the configuration settings.
##############################################################################

### bootsplash
## If you use bootsplash, also enabling SwitchToTextMode is recommended if
## you use X, otherwise you may end up with a garbled X display.
# Bootsplash on
# BootsplashConfig /etc/bootsplash/default/config/bootsplash-1024x768.cfg

### clock
SaveClock restore-only
#DirectIsa

### devices
# IncompatibleDevices /dev/dsp /dev/video*

### diskcache
# DisableWriteCacheOn /dev/hda

### fbsplash (enable SwitchToTextMode if you use this)
# FBSplash on
# FBSplashTheme tuxonice

### filesystems
# Unmount /nfsshare /windows /mnt/sambaserver
# UnmountFSTypes smbfs nfs
# UnmountGraceTime 1
# Mount /windows

### grub
ChangeGrubMenu yes
GrubMenuFile /boot/grub/grub.conf
AlternateGrubMenuFile /boot/grub/grub-suspended.conf
BackupGrubMenuFile /boot/grub/grub.conf.hibernate.bak

# see http://bugs.debian.org/317479
# RemountXFSBoot yes

### hardware_tweaks
# IbmAcpi yes
# RadeonTool yes
# Runi915resolution yes
# FullSpeedCPU yes

### lilo
# EnsureLILOResumes yes

### lock (generally you only want one of the following options)
## For console you need vlock available.
## For x you need xscreensaver-command-command available.
## For gnome you need gnome-screensaver-command available.
## For kde you need dcop, kscreensaver available.
## For XAuto you need xautolock available.
## For Xtr you need xtrlock available.
## For Freedesktop (for example KDE4) you need dbus-send available
# LockConsoleAs root
# LockXScreenSaver yes
LockGnomeScreenSaver yes
# LockFreedesktop
# LockKDE yes
# LockXLock yes
# LockXAutoLock yes
# LockXtrLock yes

### misclaunch
# OnSuspend 20 echo "Good night!"
# OnResume 20 echo "Good morning!"

### modules
# UnloadModules snd_via82cxxx usb-ohci
# UnloadAllModules yes
UnloadBlacklistedModules yes
LoadModules auto
# LoadModulesFromFile /etc/modules

### modules-gentoo
# GentooModulesAutoload yes

### network
DownInterfaces eth0
UpInterfaces auto

### networkmanager
# EnableNMReconnect yes

### pause_audio
# MuteAudio yes
# PauseAudio yes

### pcmcia
# EjectCards yes

### programs
# IncompatiblePrograms xmms

### services
# RestartServices laptop_mode anacron
# StopServices alsasound
# StartServices aumix
StopServices apache2 sshd samba svnserve
StartServices apache2 sshd samba svnserve

### vbetool
# EnableVbetool yes
# RestoreVbeStateFrom /var/lib/vbetool/vbestate
# VbetoolPost yes
# RestoreVCSAData yes

### xhacks
# SwitchToTextMode yes
# UseDummyXServer yes
# DummyXServerConfig xorg-dummy.conf

### xstatus
## This can be set to gnome, kde or x:
## For gnome you need zenity available.
## For kde you need dcop, kstart, kdialog available.
## For x you need to have xosd OR xmessage available.
XStatus gnome
XmessageDisable yes
XSuspendText Preparing to suspend...
XResumeText Resuming from suspend...
## When using XStatus x, and you have xosd installed:
# XosdSettings --font '-misc-fixed-medium-r-semicondensed--*-120-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50

### xbacklight
# BackLight yes

### gaim
## You need to have dbus, gaim_remote available.
# LogoutGaim yes
# GaimRestoreStatus yes
# GaimLogoutMessage Hibernating
# GaimLoginMessage Back from hibernation

### pidgin
# LogoutPidgin yes
# PidginRestoreStatus yes
# PidginLogoutMessage Hibernating - bye!
# PidginLoginMessage I'm back!

### SSH and PGP keys
# AgentsClearGPG yes
# AgentsClearSSH yes

### Virtualbox
# SuspendVirtualbox yes
Na pweno każdy będzie musiał dostosować do swojego systemu linie
  • StartServices
  • StopServices
Jeżeli ktoś chce być bardziej docielkiwy, to odsyłam do

Code: Select all

man hibernate.conf
W plikach
  • ram.conf
  • disk.conf
należy zakomentować linie w których jest

Code: Select all

TryMethod ususpend-*.conf
gdzie * oznacza symbol wieloznaczny. Bez tych komentarzy też będzie działać, ale wtedy skypty hibernate-scripts dodatkowo będą za każdym razem poszukiwać oprogramowania suspend które jest już doś mocno przestarzałe. Ponieważ w pliku konfiguracyjmy włączyłem, że skrypty mają modyfikować plik konfiguracyjny grub to trzeba jeszcze utworzyć dodtkowy plik. Będzie to plik konfiguracyjny dla grub. ale taki w którym nie można nic wybierać. Będzie tam tylko jedna pozycja, tak, aby przy wstawaniu system właściwie się odtworzył.

Code: Select all

/boot/grub/grub-suspended.conf

Code: Select all

default 0
timeout 2
color cyan/blue white/blue

title Wznawianie systemu...
root (hd0,<nr>)
kernel /boot/vmlinuz-<wersja jądra> root=/dev/<partycja1> resume=/dev/<partycja2> ro
Oczywiście każdy musi sam skonfigurować miejsca <nr>, <wersja jądra>, <partycja1> i <partycja2>.
Dodatkowo miałem problem z moją kartą sieciową. Sterownik do niej nie obsługuje

Code: Select all

suspend-resume-cycles
i dlatego musi być każdorazowo wyładowywany i załadowywany. Oprogramowanie hald gryzło się przy tym z hibernate-scripts - jedno i drugie chciało podnieść kartę sieciową. Wyjściem było zmuszenie hald aby dało sobie spokój z podnoszeniem net.eth0. Wystarczy, że prawidłowo załaduje sterownik. W tym celu należy w pliku

Code: Select all

/etc/conf.d/rc
odszukać linię

Code: Select all

RC_PLUG_SERVICES=""
i zmienić ją na

Code: Select all

RC_PLUG_SERVICES="!net.eth0"
To spowoduje żądany efekt.

Pozdrawiam wszystkich użytkowników dystrybucji Gentoo
Top
Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Instalacja i sprzęt”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic