ACPI DSDT in initrd

The current maintainer is Eric Piel.

What is the ACPI DSDT in initrd patch?

This patch is intended for people who like to hack their DSDT and don't want to recompile their kernel after every change.
To find out what a DSDT is, go to the ACPI page. The ACPI project integrates ACPI support into the linux kernel. To put the DSDT into the initrd you must apply one of the following patches:

Kernel versionDSDT in initrd patch
2.6.14 (by Eric Piel)acpi-dsdt-initrd-v0.7e-2.6.14.patch
2.6.12 to 2.6.13 (by Eric Piel)acpi-dsdt-initrd-v0.7d-2.6.12.patch
2.6.9 to 2.6.11acpi-dsdt-initrd-patch-v0.7d-2.6.9.patch
2.6.5 to 2.6.8.1 (by Eric Piel)acpi-dsdt-initrd-patch-v0.5-2.6.5-eric.patch
2.4.23 vanilla (by Markus Gaugusch)acpi-dsdt-initrd-patch-v0.3-2.4.23.diff
Some of those patches are user contributed. Thanks to anybody who sent a patch! Special thanks go to Thomas Renninger from SuSE, who updated the patch for 2.6.0 and Robert Spanton who wrote the fix for initramfs.

SuSE and Mandriva as well as other distros already include this patch in the default kernel, no need for re-compiling your kernel! In SuSE, have a look at /etc/sysconfig/kernel for more information (ACPI_DSDT=...). In Mandriva, use mkinitrd with the flag --dsdt.

Configuring DSDT in initrd support

First you need to patch your kernel:

cd /usr/src/linux
patch -p1 < /tmp/acpi-dsdt-initrd-patch-v0.x-....patch
In kernel config enable the ramdisk (not as module!) and initrd (in Block Devices) and enable CONFIG_ACPI_CUSTOM_DSDT_INITRD at the ACPI options (General Setup|Power Management|ACPI Support|Read custom DSDT from initrd). The patch has also been tested sometimes with swsusp enabled kernels.

After compiling the kernel, prepare your initrd:

echo -n "INITRDDSDT123DSDT123" >> /boot/initrd # magic signature
cat DSDT.aml >> /boot/initrd
Please note, that the -n option for the echo commands is not necessary for the older patches (e.g. for 2.4.x).

If you don't use an initrd yet, the signature is not necessary. In this case, just copy the DSDT.aml file into /boot and pass it as initrd.
If necessary, update your boot loader (e.g. by calling lilo) and reboot. The initrd must not be passed as kernel parameter, but as "initrd=..."!
The message "Looking for DSDT in initrd ..." will tell you if the DSDT was found or not.
If you need to update your DSDT, generate a new initrd and perform the steps above. If you don't use an initrd yet (it's empty), then just delete the old one and perform the steps above.

Problems with initramfs (2.6 kernels)

With version 0.7d, please also apply acpi-dsdt-initramfs-fix-2.6.10-cleanup.patch in case you use initramfs. If you don't know what you are using, you can apply it, it can't hurt.
There is currently a bad interraction between initramfs and the DSDT appended after the initrd. Typically, if you have this problem the kernel will not boot and say:
kernel panic - not syncing: VFS: Unable to mount root fs on unknown block (0,0)
This is because initramfs get confused by the additonal data after the initrd. The current fix is very acpi-dsdt oriented, anyone with a more generic version is welcome.
Thanks go to Gabriel Mitica for reporting this bug and Robert Spanton for a fix to initramfs.

Experimental ACPI DSDT inside initrd

Thomas Renninger has started to work on a slightly different (and much cleaner) approach. It consists in overriding the DSDT from userspace by using initramfs. If you like adventures, you can try this new and nearly untested approach. First, you'll need to apply this two patches:

Kernel versionDSDT in initramfs patch
2.6.11-rc5 (by Hannes Reinecke)initramfs-before-acpi.patch
2.6.11-rc5 (by Thomas Renninger)acpi_dsdt_initrd_initramfs.patch

The creation of the initrd is obviously completly different. You need the experimental mkinitrd available in this directory. The command to prepare your initrd then should look like that:

mkinitrd -k vmlinuz-version -i initrd-version -a /etc/DSDT.aml

If you have any questions, contact Eric at eric(at)gaugusch.at or Markus at dsdt(at)gaugusch.at.