File: README.reboot

package info (click to toggle)
nvram-wakeup 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,052 kB
  • ctags: 242
  • sloc: ansic: 1,943; sh: 309; ruby: 190; makefile: 102
file content (220 lines) | stat: -rw-r--r-- 8,011 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220

 NVRAM-WakeUp

 (C) 2001-2004, Sergei Haller <Sergei.Haller@math.uni-giessen.de>

 $Id: README.reboot 828 2005-03-16 17:51:25Z bistr-o-math $


THE REBOOT PROBLEM(s):

First  of  all, there are TWO DIFFERENT problems which became known as
the REBOOT problem.  The only thing the two problems have in common is 
a possible way to be solved.

FIRST PROBLEM:
   The  changes  to  take  effect,  you need to restart (not halt) the 
   computer and wait until the BIOS runs (don't need to enter the BIOS
   setup).  Otherwise  the machine will wake up at the time programmed 
   PREVIOUSLY.

SECOND PROBLEM:
   Some boards do not wake up at all if powered off by APM methods.
   Some boards do not wake up at all if powered off by ACPI methods.
   Some boards do or do not wake up  depending  on the version of ACPI 
   drivers in the kernel.

   E.g., I found the following in the user's manual of the ASUS A7M266
   board (Thanks to Thomas Dingermann for the hint):

     ftp://ftp.asuscom.de/pub/ASUSCOM/HANDBUCH/Motherboard/Socket_A/AMD_Chipset/a7m266-104.pdf
   
     "... Automatic Power Up will not work if the system is powered
     down  by  operating systems such as Windows 98, that have ACPI 
     support enabled. ..."


SO WHAT CAN WE DO ABOUT THISE PROBLEMS?

FIRST PROBLEM
   is  dependent  on  the board. Thus there  is a configuration option
   need_reboot (see `man nvram-wakeup.conf' for more information).

   Dependent on that option and the changed values,  nvram-wakeup will
   tell the user if a reboot is needed.
  
   See below on how to initiate a reboot and an immediate shutdown.

SECOND PROBLEM
   is  dependent  on  your kernel and the power managment routines you 
   are using. nvram-wakeup can't know anything about it.

   What  you  can  do  is  just  always  to  reboot the machine before 
   powering off with the appropriate method.  In  you use  vdrshutdown
   just remove the case "0)" and rename the case "1)" in "0,1)".


REBOOT WITH A FOLLOWING IMMEDIATE POWEROFF

   The question  is:  How  to make  the computer  reboot and  shutdown
   afterwards automatically? There are two ways to do it.  vdrshutdown
   is prepared for both ways: It will
       - do  nothing,  if  some  error  occurred  while  executing  of
         nvram-wakeup. (E.g.  if the time  was in the past  or not far
         enough in the future)
       - shutdown (halt) the computer if there's no need to reboot.
         (FIRST PROBLEM)
       - prepare the system (according to A or B, see below) to be
         rebooted and halted. Reboot the system.

   The  general  idea  is the following: 
   
   1. Prepare  a boot option in your favourite boot loader which would 
      immediately  shutdown the computer with the "right" method. (see 
      below for details on how to do so). This step is done only once.

   2. Before  rebooting, tell the boot loader to use the prepared boot 
      option the next time (and only the next time).

   Details: (1L,2L for LILO; 1G,2G for GRUB)

   1L. If you  are using LILO, you can take a modified poweroff-kernel
       from the reboot package (see at nvram-wakeup homepage)

       prepare a new LILO section in /etc/lilo.conf. E.g.,
          image  = /boot/bzImage.poweroff
          label  = PowerOff
       end eventually add a line
          append="apm=off"
       or
          append="acpi=off"
       to this section.

       Another  way  to  do is to copy your default section with a new
       different label and to add the line
          append="0"
       to the new section. E.g.
          image = /boot/bzImage
          label = Linux
          root = /dev/hda1
 
          image = /boot/bzImage
          label = PowerOff
          root = /dev/hda1
          append="0"

       Remember to run lilo once after editing the lilo.conf file.

   1G. If you  are using GRUB, you can take a modified poweroff-kernel
       from the reboot package (see at nvram-wakeup homepage)
   
       prepare a new GRUB section in /boot/grub/menu.lst. E.g.,
          title PowerOff
          kernel /boot/bzImage.poweroff [... options ...]
       where options might be one of
          apm=off
       or
          acpi=off

       Another  way  to  do is to copy your default section with a new
       different label and to add the option 0 to the kernel. E.g.
          title Linux
          kernel /boot/bzImage [... other options ...]

          title PowerOff
          kernel /boot/bzImage [... same options ...] 0

       with  GRUB  you  have a third choice: create a new section with
       the halt command. E.g.,
          title PowerOff
          halt
       
       I  don't  use GRUB myself. This information was communicated to
       me by various people or collected in the VDR-Portal.

   2L. If you are using LILO, just call
         lilo -R <title-of-the-prepared-boot-option>
       and then reboot.

   2G. If you are using GRUB, it is slightly more complicated.
         echo "savedefault --default=<nr> --once quit" | grub
       or
         echo -e "savedefault --default=<nr> --once \nquit" | grub --batch
       where  <nr>  is  the number  of your prepared boot option. Note 
       that  the  first  entry  in  grub menu has the number 0, second 
       entry  has  the number 1 and so on. Note that this last command
       can last one minute or more.
 
       If  you  are using GRUB, I can't really help much since I never
       used it, but here is what Markus Loehner wrote about it:

       ML> To  make grub reselect the default entry it is necessary to
       ML> add
       ML>      savedefault default=0
       ML> to the poweroff entry in /boot/grub/menu.lst like
       ML>
       ML>   title PowerOff
       ML>     savedefault default=0
       ML>     kernel [...other options...]
       ML>
       ML> Otherwise  grub  leads  into  a  kind of deadlock in always
       ML> booting into Poweroff (--once doesn't seem to work).
       ML>
       ML> Also, to make grub  not to wait for hitting the RETURN key, 
       ML> it  is  necessary to comment out the gui relating lines  in
       ML> /boot/grub/menu.lst like
       ML>
       ML>   # gfxmenu (hd0,0)/message
       ML>   # color white/blue black/light-gray
       ML>
       ML> I use SuSE 8.1 and grub 0.92.



HOW TO FIND OUT IF THE OWN BOARD IS AFFECTED BY THE REBOOT PROBLEM(s)

   First  make  sure  that  nvram-wakeup  is  configured correctly and
   working. (Run  it with the --settime option, go into BIOS setup and
   check if everything was set correctly.
   
   * Let's say, we have 12:00. 
     - Run
         nvram-wakeup -s $((`date +%s` + 1200))
       the wakeup will be set for 12:15.
     - Reboot 
     - Now we have 12:05. Run
         nvram-wakeup -s $((`date +%s` +  601))
       the wakeup will be set for 12:10.
     - Shutdown.
     
     If the machine wakes up at 12:10 or at 12:15, you don't have  the
     SECOND PROBLEM. 
     
     If  it  doesn't  wake up until 12:20, you have the SECOND PROBLEM.
     In this case stop reading -- you need to reboot anyway.
     
     If  the  machine  wakes  up  at 12:15, you have the FIRST PROBLEM. 
     Stop reading and set need_reboot to ON_ANY_CHANGE.
     
     If the machine wakes up at 12:10, you  don't  seem  to  have  the 
     FIRST PROBLEM.  Though,  on  some machines the FIRST PROBLEM only 
     occurs if the status is changed (enabled <-> disabled). 

     - Let's say, now we have 12:30. Run
         nvram-wakeup -s $((`date +%s` + 1200))
       the wakeup will be set for 12:45.
     - Reboot 
     - Now we have 12:35. Run
         nvram-wakeup -d
       the wakeup will be disabled.
     - Shutdown.

     If  the  machine  wakes  up  at 12:45, you have the FIRST PROBLEM. 
     Stop reading and set need_reboot to ON_STAT.

     If  it  doesn't  wake up until 12:50, you have neither of the two
     problems.

   * There  are  also  other possible values for need_reboot (see `man 
     nvram-wakeup.conf'). Use them if you know what you are doing.