如果一些主板在关机之后电源不是自动关闭,需要手动关闭电源,请在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 关机。