Closed komali2 closed 6 years ago
According to the blog linked, this is probably what I need to do. I will try this:
We yet have to tell GRUB to load our new DSDT table on boot in its configuration file, usually located in /boot/grub/grub.cfg or something similar. Look out for the GRUB menu entry you're usually booting, and simply add our new image to the initrd line. It should look somewhat like that (if your initrd line contains other elements, leave them as they are and simply add the new ACPI override):
initrd /acpi_override /initramfs-linux.img Note: You will need to do this again when your distribution updates the kernel and re-writes the GRUB configuration. I'm looking for a more automated approach, but was too lazy to do it so far.
The blog recommends editing /boot/grub/grub.cfg
directly, but the file itself has a warning at the top about doing so. I'd like to heed this warning if possible, because I am not a clever man.
There is no line like /initramfs-linux.img
.
There are other .img
type type things, like
initrd /boot/initrd.img-4.15.0-29-generic
Here is what the "Ubuntu" menuentry looks like in grub.cfg
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-98288c11-f198-435b-af7b-eb4fc5a1da41' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root 98288c11-f198-435b-af7b-eb4fc5a1da41
else
search --no-floppy --fs-uuid --set=root 98288c11-f198-435b-af7b-eb4fc5a1da41
fi
linux /boot/vmlinuz-4.15.0-29-generic root=UUID=98288c11-f198-435b-af7b-eb4fc5a1da41 ro quiet splash mem_sleep_default=deep $vt_handoff
initrd /boot/initrd.img-4.15.0-29-generic
}
I tried editing that file and completely nuked my system to the point that recovery was possible only by reinstalling Ubuntu. Do not edit grub.cfg directly.
Have you figured out how to do it? I am stuck in the same place.
No, I was unable to get it to work. However, I did a small fix that makes s2idle really not so bad.
See my comment on the lenovo forums: https://forums.lenovo.com/t5/Linux-Discussion/X1-Carbon-Gen-6-cannot-enter-deep-sleep-S3-state-aka-Suspend-to/m-p/4156860/highlight/true#M11455
Also, the people on the forums are saying that a BIOS patch has been released. There's information on the last page on how to do that , though I haven't tried it yet.
BIOS update didn't change any of the sleep issues.
Good to know
After the BIOS update, when you do dmesg | grep -i "acpi: (supports"
, what do you see?
[ 0.121298] ACPI: (supports S0 S4 S5)
Try switching to s5 mode see what happens. Or try them all
On my Ubuntu installation, I edited the /etc/grub.d/10_linux
script to add the /acpi_override
to all the initrd lines when the configurations are generated. On line 314 of the script, you should find a line like this:
initrd="$i"
Change that line to the following:
initrd="acpi_override /$i"
Save your changes (you'll need to edit the file as root due to permissions) and re-generate the GRUB config by running sudo update-grub
. This should add the acpi_override to every boot entry. Try rebooting to see if it works.
NOTE: If you typo something here or if your script is different for some reason (I did these changes on Ubuntu 18.04), these changes might lead you to be unable to boot. GRUB should still offer you a chance to edit the boot configuration if it's faulty. Try and erase the acpi_override part to boot back in to the OS, then revert the changes and run sudo update-grub
again to re-create the GRUB configuration.
I'm not sure if this is the best way to get the acpi_override
defined, but at least it has worked for me. Also worth noting that any changes to BIOS settings or upgrading the Lenovo firmware might require re-applying the DDST patch. To do that, you first need to boot into an environment without the acpi_override
, otherwise you'll end up getting the already patched DDST
Closing this, since Lenovo added S3 support.
Hey, great work on this, I appreciate all the work everyone is putting in here.
This isn't my world so I'm doing my best to keep up here: I'm using the latest hottest thing Ubuntu has slung our way, which ships with Grub2.
I disabled secureboot. I Made sure
ACPI table ovverride is restricted
didn't appear. I ensured I installediasl
andcpio
. I downloaded,chmod
'd and ran thegenerate_and_apply_patch
script.Now, I am stuck at the "Loading the override on boot" step.
From what I understand, "Edit your boot loader configuration" in grub 2 means do
cd /etc/default
thensudo gedit grub
There, you'll see something like
There, the internet tells me that
GRUB_CMDLINE_LINUX_DEFAULT
is most likely what this repo is referring to when it mentions "kernel parameters" in the line "addmem_sleep_default=deep
to your kernel paramters.So, I do that, and then my
etc/default/grub
looks likeBut what I don't understand is what is meant by "add
/acpi_override
to theinitrd
line.I don't see anything about
initrd
here. I am hunting through all the files in/etc/grub.d
, which is apparently where other GRUB2 config files are located, but I am not seeing anything like the example given, or anything referring toinitrd
. There are many files.Just to experiment, I did try just throwing it in the
GRUB_CMDLINE_LINUX_DEFAULT
like so:Then I
sudo update-grub
, which succeeds, and reboots. However,dmesg | grep -i "acpi: (supports"
is missings3
, so clearly whatever I am doing is not working.So, where do I "add
/acpi_override
in Ubuntu 18 with GRUB2?