aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMarkus Gaugusch <dsdt@gaugusch.at>2008-02-04 18:04:06 -0500
committerLen Brown <len.brown@intel.com>2008-02-06 22:07:41 -0500
commit71fc47a9adf8ee89e5c96a47222915c5485ac437 (patch)
treea2eaefbb703dde933a9726eae7e6399761d40136 /Documentation
parent488b5ec871191359b9b79262a3d48456dae7ea5f (diff)
ACPI: basic initramfs DSDT override support
The basics of DSDT from initramfs. In case this option is selected, populate_rootfs() is called a bit earlier to have the initramfs content available during ACPI initialization. This is a very similar path to the one available at http://gaugusch.at/kernel.shtml but with some update in the documentation, default set to No and the change of populate_rootfs() the "Jeff Mahony way" (which avoids reading the initramfs twice). Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/acpi/dsdt-initrd.txt99
1 files changed, 99 insertions, 0 deletions
diff --git a/Documentation/acpi/dsdt-initrd.txt b/Documentation/acpi/dsdt-initrd.txt
new file mode 100644
index 000000000000..736043359dfb
--- /dev/null
+++ b/Documentation/acpi/dsdt-initrd.txt
@@ -0,0 +1,99 @@
1ACPI Custom DSDT read from initramfs
2
32003 by Markus Gaugusch < dsdt at gaugusch dot at >
4Special thanks go to Thomas Renninger from SuSE, who updated the patch for
52.6.0 and later modified it to read inside initramfs
62004 - 2008 maintained by Eric Piel < eric dot piel at tremplin-utc dot net >
7
8This option is intended for people who would like to hack their DSDT and don't
9want to recompile their kernel after every change. It can also be useful to
10distros which offers pre-compiled kernels and want to allow their users to use
11a modified DSDT. In the Kernel config, enable the initial RAM filesystem
12support (in General Setup) and enable ACPI_CUSTOM_DSDT_INITRD at the ACPI
13options (General Setup|ACPI Support|Read Custom DSDT from initramfs).
14
15A custom DSDT (Differentiated System Description Table) is useful when your
16computer uses ACPI but problems occur due to broken implementation. Typically,
17your computer works but there are some troubles with the hardware detection or
18the power management. You can check that troubles come from errors in the DSDT by
19activating the ACPI debug option and reading the logs. This table is provided
20by the BIOS, therefore it might be a good idea to check for BIOS update on your
21vendor website before going any further. Errors are often caused by vendors
22testing their hardware only with Windows or because there is code which is
23executed only on a specific OS with a specific version and Linux hasn't been
24considered during the development.
25
26Before you run away from customising your DSDT, you should note that already
27corrected tables are available for a fair amount of computers on this web-page:
28http://acpi.sf.net/dsdt . Be careful though, to work correctly a DSDT has to
29match closely the hardware, including the amount of RAM, the frequency of the
30processor and the PCI cards present! If you are part of the unluckies who
31cannot find their hardware in this database, you can modify your DSDT by
32yourself. This process is less painful than it sounds. Download the Intel ASL
33compiler/decompiler at http://www.intel.com/technology/IAPC/acpi/downloads.htm .
34As root, you then have to dump your DSDT and decompile it. By using the
35compiler messages as well as the kernel ACPI debug messages and the reference
36book (available at the Intel website and also at http://www.acpi.info), it is
37quite easy to obtain a fully working table.
38
39Once your new DSDT is ready you'll have to add it to an initramfs so that the
40kernel can read the table at the very beginning of the boot. As the file has to
41be accessed very early during the boot process the initramfs has to be an
42initramfs. The file is contained into the initramfs under the name /DSDT.aml .
43To obtain such an initramfs, you might have to modify your initramfs script or
44you can add it later to the initramfs with the script appended to this
45document. The command will look like:
46initramfs-add-dsdt initramfs.img my-dsdt.aml
47
48In case you don't use any initramfs, the possibilities you have are to either
49start using one (try mkinitrd or yaird), or use the "Include Custom DSDT"
50configure option to directly include your DSDT inside the kernel.
51
52The message "Looking for DSDT in initramfs..." will tell you if the DSDT was
53found or not. If you need to update your DSDT, generate a new initramfs and
54perform the steps above. Don't forget that with Lilo, you'll have to re-run it.
55
56
57====================== Here starts initramfs-add-dsdt ==========================
58#!/bin/bash
59# Adds a DSDT file to the initrd (if it's an initramfs)
60# first argument is the name of archive
61# second argument is the name of the file to add
62# The file will be copied as /DSDT.aml
63
64# 20060126: fix "Premature end of file" with some old cpio (Roland Robic)
65# 20060205: this time it should really work
66
67# check the arguments
68if [ $# -ne 2 ]; then
69 program_name=$(basename $0)
70 echo "\
71$program_name: too few arguments
72Usage: $program_name initrd-name.img DSDT-to-add.aml
73Adds a DSDT file to an initrd (in initramfs format)
74
75 initrd-name.img: filename of the initrd in initramfs format
76 DSDT-to-add.aml: filename of the DSDT file to add
77 " 1>&2
78 exit 1
79fi
80
81# we should check it's an initramfs
82
83tempcpio=$(mktemp -d)
84# cleanup on exit, hangup, interrupt, quit, termination
85trap 'rm -rf $tempcpio' 0 1 2 3 15
86
87# extract the archive
88gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1
89
90# copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml"
91cp -f "$2" "$tempcpio"/DSDT.aml
92
93# add the file
94cd "$tempcpio"
95(echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1
96cd "$OLDPWD"
97
98# re-compress the archive
99gzip -c "$tempcpio"/initramfs.cpio > "$1"