Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] support to overwrite DMI board info

45 views
Skip to first unread message

Alan Cox

unread,
Sep 28, 2010, 9:30:02 AM9/28/10
to
From: Jiang, Chao <chao....@intel.com>

support to overwrite board vendor/version/name information by editing
/boot/cmdline file. Format example:
board_vendor="XXX company" board_version=DV3.0


Signed-off-by: Jiang, Chao <chao....@intel.com>
Signed-off-by: Alan Cox <al...@linux.intel.com>
---

drivers/firmware/dmi_scan.c | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)


diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index b3d22d6..5763618 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -712,3 +712,40 @@ bool dmi_match(enum dmi_field f, const char *str)
return !strcmp(info, str);
}
EXPORT_SYMBOL_GPL(dmi_match);
+
+static int __init dmi_override(int slot, char *str)
+{
+ size_t len;
+ char *p;
+ if (!str)
+ return -EINVAL;
+ len = strlen(str) + 1;
+ p = dmi_alloc(len);
+ if (p != NULL)
+ strcpy(p, str);
+ else {
+ printk(KERN_ERR "dm_override: cannot allocate %Zu bytes.\n",
+ len);
+ return -ENOMEM;
+ }
+ dmi_ident[slot] = p;
+ return 0;
+}
+
+static int __init override_dmi_board_vendor(char *str)
+{
+ return dmi_override(DMI_BOARD_VENDOR, str);
+}
+early_param("board_vendor", override_dmi_board_vendor);
+
+static int __init override_dmi_board_version(char *str)
+{
+ return dmi_override(DMI_BOARD_VERSION, str);
+}
+early_param("board_version", override_dmi_board_version);
+
+static int __init override_dmi_board_name(char *str)
+{
+ return dmi_override(DMI_BOARD_NAME, str);
+}
+early_param("board_name", override_dmi_board_name);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Éric Piel

unread,
Sep 29, 2010, 6:40:02 AM9/29/10
to
Op 28-09-10 14:36, Alan Cox schreef:

> From: Jiang, Chao<chao....@intel.com>
>
> support to overwrite board vendor/version/name information by editing
> /boot/cmdline file. Format example:
> board_vendor="XXX company" board_version=DV3.0
>
3 new boot parameters... How about also updating
Documentation/kernel-parameters.txt to explain what they do without
users having to read the git changelog?

Cheers,
Eric

0 new messages