Skip to content

Intel 12th Generation Devices Issues

Nuttapong Punpipat edited this page Jan 26, 2023 · 2 revisions

S5 (ACPI shutdown or regular shutdown) does not work

  • Workarounds:
    • Reboot the system and then do the one of followings:
      • Boot to Windows and do shutdown
      • Boot to EFI shell and do reset -s, this can also done via EFI shell scripting.
    • for automate booting to specified EFI entry, can be done by setting EFI boot next.
    • see section "Power state/operation workaround via EFI Shell" for information about EFI boot next, EFI scripting, and workaround automation.

Miscellaneous

Power state/operation workaround via EFI Shell

You are required to setup the workaround by this below (this required disabling secure boot or sign the EFI file by yourself):

  1. Getting compiled EFI shell source or prebuilt one. The x86_64 version is required. The EDK2 EFI shell is tested for this workaround. (Sample prebuilt: https://github.com/pbatard/UEFI-Shell ; you can grab prebuilt from non-DEBUG iso file located in latest release, the x86_64 EFI executable file of EFI Shell application is located inside <iso file>/efi/boot/bootx64.efi)
  2. Copy x86_64 EFI executable file of EFI Shell application to your desired directory path in <EFI partition> (ex. /EFI/EFI_Shell/Shell.efi) (recommended in EFI partition of local disk, in case using Linux from external disk)
  3. For setting-up EFI Shell auto-shutdown scripting, see step 4-5, or else skip these steps
  4. Create file in desired directory (ex. /EFI/EFI_Shell/Scripts/shutdown.nsh)
  5. Put this line in the file @reset -s
  6. Read comment and set all the variable and execute the command to create new EFI entry
# Remark1: see https://uefi.org/sites/default/files/resources/UEFI_Shell_2_2.pdf for information
# Remark2: for manual shutdown or using EFI shell
#  - SHUTDOWNSCRIPT is not required
#  - remove "-u -@ ./cmdline.bin"
#  - the command from "cd ..." to "iconv ..." is not required
# Path to device file to disk contains selected EFI partition
DISKFILE=/dev/nvme0n1
# selected EFI partition, index start at 1
PARTNUM=1
# entry number do you want to create entry, recommened to be the equals to highest entry number visibled in the command `efibootmgr` added 1.
ENTRYNUM=0006
# Path to EFI Shell executable file relative to selected EFI partition, using backslash
EFIFILE='\EFI\EFI_Shell\Shell.efi'
# Path to auto-shutdown script relative to selected EFI partition, using backslash
SHUTDOWNSCRIPT='\EFI\EFI_Shell\Scripts\shutdown.nsh'
# Name of EFI entry
ENTRYNAME="Auto Shutdown workaround for Surface+Linux"
cd `mktemp -d`
echo -n "-nostartup -noconsoleout -noconsolein -nointerrupt -nomap -noversion $SHUTDOWNSCRIPT" > ./cmdline.text
iconv -f ascii -t ucs-2 ./cmdline.text > ./cmdline.bin
efibootmgr -v -b $ENTRYNUM -c -d $DISKFILE -l "$EFIFILE" -p $PARTNUM -L "$ENTRYNAME" -u -@ ./cmdline.bin
# for disabling the entry so we dont have to worry about entry sorting
efibootmgr -b $ENTRYNUM -A

After that you can boot to new EFI entry to perform shutdown. By using efibootmgr -n <Entry Number>, you can temporarily boot to selected entry after reboot. And you can apply this in init/PM scripts for automation too (For systemd, see here.

Clone this wiki locally