]> Git Repo - linux.git/commitdiff
ACPI / tables: table override from built-in initrd
authorShunyong Yang <[email protected]>
Tue, 18 Dec 2018 06:02:45 +0000 (14:02 +0800)
committerRafael J. Wysocki <[email protected]>
Mon, 14 Jan 2019 10:42:18 +0000 (11:42 +0100)
In some scenario, we need to build initrd with kernel in a single image.
This can simplify system deployment process by downloading the whole system
once, such as in IC verification.

This patch adds support to override ACPI tables from built-in initrd.

Signed-off-by: Shunyong Yang <[email protected]>
[ rjw: Minor cleanups ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Documentation/acpi/initrd_table_override.txt
drivers/acpi/Kconfig
drivers/acpi/tables.c
include/linux/initrd.h

index eb651a6aa28505769a38f68fa253e2a56be3ddef..30437a6db373a1cb449d15c1b98f2552786ebcc6 100644 (file)
@@ -14,6 +14,10 @@ upgrade the ACPI execution environment that is defined by the ACPI tables
 via upgrading the ACPI tables provided by the BIOS with an instrumented,
 modified, more recent version one, or installing brand new ACPI tables.
 
+When building initrd with kernel in a single image, option
+ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
+feature to work.
+
 For a full list of ACPI tables that can be upgraded/installed, take a look
 at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
 drivers/acpi/tables.c.
index 90ff0a47c12e0b6f787bf5e9d610e7787da7ad83..4e015c77e48e871c613e2c5fde0611d209223fc7 100644 (file)
@@ -357,6 +357,16 @@ config ACPI_TABLE_UPGRADE
          initrd, therefore it's safe to say Y.
          See Documentation/acpi/initrd_table_override.txt for details
 
+config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
+       bool "Override ACPI tables from built-in initrd"
+       depends on ACPI_TABLE_UPGRADE
+       depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
+       help
+         This option provides functionality to override arbitrary ACPI tables
+         from built-in uncompressed initrd.
+
+         See Documentation/acpi/initrd_table_override.txt for details
+
 config ACPI_DEBUG
        bool "Debug Statements"
        help
index 48eabb6c2d4fc9a656c6cfdbe6b7cb5d59928229..8fccbe49612a083602b84e24388c7b06257f5045 100644 (file)
@@ -473,14 +473,22 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES);
 
 void __init acpi_table_upgrade(void)
 {
-       void *data = (void *)initrd_start;
-       size_t size = initrd_end - initrd_start;
+       void *data;
+       size_t size;
        int sig, no, table_nr = 0, total_offset = 0;
        long offset = 0;
        struct acpi_table_header *table;
        char cpio_path[32] = "kernel/firmware/acpi/";
        struct cpio_data file;
 
+       if (IS_ENABLED(CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD)) {
+               data = __initramfs_start;
+               size = __initramfs_size;
+       } else {
+               data = (void *)initrd_start;
+               size = initrd_end - initrd_start;
+       }
+
        if (data == NULL || size == 0)
                return;
 
index 14beaff9b4458b697748fc78eaf8f84279df40d3..d77fe34fb00a0c23b36d6698ab385ea9553d282e 100644 (file)
@@ -25,3 +25,6 @@ extern phys_addr_t phys_initrd_start;
 extern unsigned long phys_initrd_size;
 
 extern unsigned int real_root_dev;
+
+extern char __initramfs_start[];
+extern unsigned long __initramfs_size;
This page took 0.079861 seconds and 4 git commands to generate.