- Disable FileVault (System Preferences -> Security & Privacy -> FileVault -> Turn Off Filevault)
- Boot to recovery mode by holding
Command + R
during boot
- Open Terminal
- Run
csrutil authenticated-root disable
to disable signature validation on the bootable snapshots - Run
ioreg -l | grep board-id
to get your board ID and write it down. - Find your root mount's device - run
diskutil list
and search forYourDriveName
and note the identifier, egdisk1s2
- Run
diskutil mount disk1s2
and the drive will be mounted under/Volumes/YourDriveName
- Mount disk as writeable using
mount -uw /Volumes/YourDriveName
- Navigate to
/Volumes/YourDriveName/System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources
- Change ownership of the files using
sudo chmod a+rw *.plist
- Look for a file in the current directory that has your board ID (from step 2.3) as the filename (*.plist file)
- Open the file using
vi
orvim
and then change these key values with a text editor so that they match these settings:
<key>TCPKeepAliveDuringSleep</key>
<false/>
...
<key>NotificationWake</key>
<false/>
<key>DNDWhileDisplaySleeps</key>
<true/>
- Save changes and exit the editor
- Run the commands below (choice) to create and bless a new bootable snapshot
sudo bless --folder /Volumes/YourDiskName/System/Library/CoreServices --bootefi --create-snapshot
or
-
Create snapshot
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -s "BatteryFix" -v /Volumes/YourDiskName
-
Mark the snapshot as bootable
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "BatteryFix" -v /Volumes/YourDiskName
- Verify that the snapshot has been made using
diskutil apfs listSnapshots disk1s2
(using the disk from step 2.4). Results should like something like
Snapshots for disk1s2 (2 found)
|
+-- FEE397E8-F5C5-42E5-8372-BD5BDDFF903D
| Name: com.apple.os.update-779BDF1556C6F688504E24FB29C75AFFABFCB91E701806FFFF35235E19914F1E
| XID: 3678974
| Purgeable: No
| NOTE: This snapshot limits the minimum size of APFS Container disk1
|
+-- 1357DDAF-0CBC-4909-94D5-65F334DEAEA4
Name: com.apple.bless.209A7AB5-0806-4C92-8043-F9C6882A838D
XID: 9223372036858584732
Purgeable: Yes
- Reboot the Macbook, this might take a while
- Verify it's running of the snapshot by opening
Disk Utility
and clickYourDriveName
. Under System Snapshot Mounted it should show the latest snapshot from step 4.2
Reboot can take a while, don't worry. If the system hasn't booted after 10 minutes or so you can "activate" the original snapshot by running /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "First_Guid_From_Snapshotlist" -v /Volumes/YourDiskName
Hi, thanks for this gist, do you know if this needs to be redone when an os update happens? would you mind extending the page with that info?
btw there are a few small findings: