如果一些主機板在關機之後電源不是自動關閉,需要手動關閉電源,請在grub里加上:
引用:
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.23.1-42.fc8)
root (hd0,7)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/1234 rhgb quiet acpi=force
initrd /boot/initrd-2.6.23.1-42.fc8.img
只要加上紅色的那句話就可以正常關機。 具體原因分析如下:
Kernel 起來以後會執行 arch/i386/kernel/setup.c
引用:
void __init setup_arch(char **cmdline_p)
{
unsigned long max_low_pfn;
paravirt_post_allocator_init();
dmi_scan_machine();
}
Dmi_scan_machine() 會從BIOS 裡面獲取DMI 支援的資訊。ACPI driver 會透過
引用:
static int __init blacklist_by_year(void)
{
int year = dmi_get_year(DMI_BIOS_DATE);
/* Doesn’t exist? Likely an old system */
if (year == -1) {
printk(KERN_ERR PREFIX "no DMI BIOS year, "
"acpi=force is required to enable ACPI\n" );
return 1;
}
/* 0? Likely a buggy new BIOS */
if (year == 0) {
printk(KERN_ERR PREFIX "DMI BIOS year==0, "
"assuming ACPI-capable machine\n" );
return 0;
}
if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
"acpi=force is required to enable ACPI\n",
year, CONFIG_ACPI_BLACKLIST_YEAR);
return 1;
}
return 0;
}
來獲取資訊,一旦dmi_get_year 取到的DMI 資訊是不支援ACPI 的話,就會列印紅色的那部分資訊。
然後核心認為ACPI不支援,最終導致機器不能透過ACPI 關機。