Mac for sleep and hibernate wake-up

Source: Internet
Author: User


Because Apple defaults to the hibernation file encryption, Clover cannot be decrypted. So you need to go through some setup to get rid of this moral integrity encrypted file sleepimage. Before that, I had to mention the Emuvariableuefi-64.efi drive. We know that UEFI motherboards generally support the NVRAM save function, that is, to save the brightness, volume and other information, so that after the boot can be restored to the same state as before the shutdown. The same is true of Apple machines. However, some motherboards do not have the NVRAM function, this time Emuvariableuefi will be useful (emulated Variable analog variable). It can simulate all the variables in the NVRAM in memory and save it to the memory, write to the hard disk at shutdown, that is the familiar nvram.plist file. But it wasn't designed by Apple at all. During hibernation, memory is in a power-off state, meaning that the simulated nvram in memory disappears. So in order to avoid this problem, I strongly recommend that you remove Emuvariableuefi as much as possible to remove it in order to get closer to the Apple machine way.

In the following, the method of solving the dormant encryption is slightly different because of the emuvariableuefi existence.
If your machine does not need Emuvariableuefi, the terminal input:

    1. sudo pmset-a hibernatemode 57
Copy Code

* This is the best mode and is with hibernation preview.

If your machine requires Emuvariableuefi, the terminal input:

    1. sudo pmset-a Hibernatemode 29
Copy Code

* No hibernation preview.

Maybe some people wonder how the numbers are coming, and I'll introduce some of the hibernatemode of each number. First the Hibernatemode length is a byte, which is 8 2 binary digits. The definition of certain numbers can be found on the Apple website:

    1. ____ ___1 (bit 0) turns on hibernation, if 0 is sleep.
    2. ____ __1_ (bit 1) and bit 01 are used. When hibernation is turned on, the system will sleep first so that it can wake up quickly. But when the battery is below the threshold, it automatically loses sleep. This is also the Apple's way of silent, safe sleep mode.
    3. ____ 1___ (bit 3) takes advantage of dynamic space management to take up less space unless the active space sleeps.
    4. ___1 ____ (bit 4) uses dynamic space management to remove more space for sleep, taking up less space.
Copy Code


Later the great gods from kernel source code found that when Hibernatemode contains 0x20 (that is, bit 5), kernel will set boot-switch-vars. Hibernation file encryption is controlled by bit 2 and is set to 1 when encryption is canceled.

Now we can analyze the meaning of the hibernatemode numbers above. 0b0001 = 1101, where bit 0,2,3,4 is all 1, that is, direct hibernation (rather than prior sleep), and minimize the size of the sleep file, using an unencrypted format. This allows the clover to read the hibernation file directly when it wakes up, thus enabling wake-up. However, the disadvantage is that clover cannot support the Hibernate preview feature. The boot-switch-vars must be managed by the Emuvariableuefi driver, not kernel, so bit 5 is 0.

The recommended 0b0011 = 1001,bit 0,3,4,5 is set to 1, so the benefit is that Boot-switch-vars is given to kernel instead of clover. The hibernate file can also be encrypted because the wake-up is completed by kernel.

The recommended 0b0011 1011,bit 0,1,3,4,5 is set to 1, so the benefit is that Boot-switch-vars gives kernel instead of clover, first sleep, and hibernate after a period of time. The hibernate file can also be encrypted because the wake-up is completed by kernel.

In 10.11.x,pmset can not directly modify the Hibernatemode, if you want to freely switch hibernatemode, directly modify/library/preferences/systemconfiguration/ Com.apple.PowerManagement.plist, reboot.

In 10.12.x,pmset can not directly modify the Hibernatemode, if you want to freely switch hibernatemode, directly modify/library/preferences/ Com.apple.powermanagement-xxxxxxxxxxx.plist, reboot.


End of sleep section!

Mac for sleep and hibernate wake-up

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.