Re: Kernel for only power-off purpose.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Apr 03, 2007 at 08:54:29PM +0900, Tetsuo Handa wrote:
> This is just an idea, but do you think
> it is nice if there is a kernel
> dedicated for doing power off operation?
> 
> Some kernels, especially SMP enabled ones,
> cannot power off after "power down" message.
> 
> I want the system power off
> by setting the power-off only kernel entry
> as the default entry of the grub and
> executing /sbin/reboot command
> (that likely succeeds to reboot on any kernels)
> instead of executing /sbin/poweroff command
> (that fails to power off on some kernels).

Grub is able to power off the machine itself using the "halt" command.
Here is what I have for my mythtv personal video recorder:

default saved
timeout 5
color cyan/blue white/blue

title           2.6.17
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.17 root=/dev/hda1 ro
savedefault
boot

title           2.6.17 (single user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.17 root=/dev/hda1 ro single
savedefault
boot

title           PowerOff
                savedefault 0
                cat /boot/grub/default
                halt

Prior to reboot, the mythtv backend calls "grub-set-default 2" to boot
to tell the machine it needs to boot the second "kernel" from the menu.

Background: my mythtv box is able to power off by using the kernel, but
in that case the BIOS wakeup time is not saved and it won't wake up
again for the next scheduled recording. The machine needs to reboot
(soft reset) to save the wakeup time. To get it really powered off, I
let it boot to the "PowerOff" kernel, which tells grub to boot the
first kernel again, prints the grub defaults file (to work around a bug
in grub, this makes sure grub saves the data on disk), and halts the
machine.


Erik

- -- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGEkzu/PlVHJtIto0RAuU7AJ46n6FwufKAkLLE3TsxvQ4Hq0TjywCgkBtd
+MA+APP3Y6lFsYFJPiKhqps=
=oVkC
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux