Re: [PATCH] x86, reboot: skip DMI checks if reboot set by user

Alan Cox
2012-01-17T20:00:54Z

On Tue, 17 Jan 2012 10:16:03 -0500
Michael D Labriola <mlabriol@gdeb.com> wrote:

> This commit causes DMI checks for vendor specific reboot
> quirks to be skipped if the user passed in a reboot= arg
> on the command line.
>
> Signed-off-by: Michael D Labriola <mlabriol@gdeb.com>
> ---
> arch/x86/kernel/reboot.c | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> index 37a458b..4240d58 100644
> --- a/arch/x86/kernel/reboot.c
> +++ b/arch/x86/kernel/reboot.c
> @@ -38,6 +38,7 @@ static const struct desc_ptr no_idt = {};
> static int reboot_mode;
> enum reboot_type reboot_type = BOOT_ACPI;
> int reboot_force;
> +int reboot_user;

static ...

> case 'f':
> reboot_force = 1;
> + reboot_user = 1;

Cleaner would be to add a

BOOT_ACPI_FORCE perhaps so you can tell ACPI v ACPI specified by user

> break;
> }
>
> @@ -316,7 +322,10 @@ static struct dmi_system_id __initdata
> reboot_dmi_table[] = {
>
> static int __init reboot_init(void)
> {
> - dmi_check_system(reboot_dmi_table);
> + /* Skip the DMI check if user set reboot= on the command line */
> + if (!reboot_user) {

then do

if (reboot_type == BOOT_ACPI)
> + dmi_check_system(reboot_dmi_table);
> + }