Allow custom DSDT overrides in grub per default

Bug #1045690 reported by Egon A. Rath
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

For some PC models it's necessary to use a custom ACPI DSDT Table for the correct working of Fans and other system stuff. To load such a table you could either compile a new kernel with this custom table in it, or provide it via grub.

It would be a huge benefit for Ubuntu to provide this functionality out of the box.

Current steps necessary:
=====================

1.) Build a new DSDT and place it under /boot/dsdt.aml
2.) Place the following content under /etc/grub.d/01_acpi:

--------------------CUT--------------------
#! /bin/sh -e

# Uncomment to load custom ACPI table
GRUB_CUSTOM_ACPI="/boot/dsdt.aml"

# DON'T MODIFY ANYTHING BELOW THIS LINE!

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

. ${libdir}/grub/grub-mkconfig_lib

# Load custom ACPI table
if [ x${GRUB_CUSTOM_ACPI} != x ] && [ -f ${GRUB_CUSTOM_ACPI} ] \
        && is_path_readable_by_grub ${GRUB_CUSTOM_ACPI}; then
    echo "Found custom ACPI table: ${GRUB_CUSTOM_ACPI}" >&2
    prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_CUSTOM_ACPI}` | sed -e "s/^/ /"
    cat << EOF
acpi (\$root)`make_system_path_relative_to_its_root ${GRUB_CUSTOM_ACPI}`
EOF
fi
--------------------CUT--------------------
3.) update-grub

Desired steps necessary:
=====================

1.) Ship the above (or a similar) script fragment per default
2.) Place the GRUB_CUSTOM_ACPU in /etc/default/grub for centralised access

Additional information
==================

Ubuntu-release:
    Description: Ubuntu 12.04.1 LTS
    Release: 12.04

grub-packages:
grub2:
  Installed: (none)
  Candidate: 1.99-21ubuntu3.1
  Version table:
     1.99-21ubuntu3.1 0
        500 http://susrtumi1/ubuntu/ubuntu/ precise-updates/universe i386 Packages
     1.99-21ubuntu3 0
        500 http://susrtumi1/ubuntu/ubuntu/ precise/universe i386 Packages
test@test01:/etc/default$ dpkg --list | grep grub
ii grub-common 1.99-21ubuntu3.1 GRand Unified Bootloader (common files)
ii grub-gfxpayload-lists 0.6 GRUB gfxpayload blacklist
ii grub-pc 1.99-21ubuntu3.1 GRand Unified Bootloader, version 2 (PC/BIOS version)
ii grub-pc-bin 1.99-21ubuntu3.1 GRand Unified Bootloader, version 2 (PC/BIOS binaries)
ii grub2-common 1.99-21ubuntu3.1 GRand Unified Bootloader (common files for version 2)

Changed in grub (Ubuntu):
status: New → Invalid
Steve Langasek (vorlon)
Changed in grub2 (Ubuntu):
importance: Undecided → Wishlist
no longer affects: grub (Ubuntu)
Revision history for this message
Peter Meiser (meiser79) wrote :

Looking at the current initramfs-tools package, you can put a DSDT.aml into /etc/initramfs-tools/ so that it gets used.

Revision history for this message
Phillip Susi (psusi) wrote :

Support for loading a DSDT from the initramfs was removed from the kernel some time ago. It has to be passed by the boot loader now.

Revision history for this message
Peter Meiser (meiser79) wrote :

Ok, thanks. I'm just trying it with my old Samsung P35. How do I know that the DSDT was loaded successfully? I can't see any hints in dmesg.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Ryan C. Underwood (nemesis-icequake) wrote :

GRUB also accepts an 'acpi' command:
https://www.gnu.org/software/grub/manual/html_node/acpi.html

Perhaps we could just make it easier for that command to be generated as a part of boot entry blocks in grub.cfg.

Revision history for this message
jacobS (jacsalomon) wrote :

This is not for grub only, they need to re-compile kernel with config flag enabled:

# CONFIG_ACPI_CUSTOM_DSDT is not set

+ CONFIG_ACPI_CUSTOM_DSDT = y

Is recommend to enabled this in all generic-kernel versions, otherwise they do not override DSDT bogus tables

Revision history for this message
Ryan C. Underwood (nemesis-icequake) wrote :

No @jacsalomon, that's not true. If you override via grub, there's no need for the kernel override.
That is, this scheme works with Ubuntu's kernel configuration:
CONFIG_ACPI_CUSTOM_DSDT_FILE=""
# CONFIG_ACPI_CUSTOM_DSDT is not set

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.