Skip to content

Commit

Permalink
Bump version to 1.3.2, fix nvram.plist saving in Catalina, new path i…
Browse files Browse the repository at this point in the history
…s used when the root folder is not writable: /System/Volumes/Data/nvram.plist
  • Loading branch information
lvs1974 committed Dec 4, 2019
1 parent a3bda6b commit c6215a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
@@ -1,5 +1,8 @@
HibernationFixup Changelog
============================
#### v1.3.2
- Fix nvram.plist saving in Catalina, new path is used when the root folder is not writable: /System/Volumes/Data/nvram.plist

#### v1.3.1
- Code refactoring, fix duplicates in log, auto-hibernate can work without power source

Expand Down
4 changes: 2 additions & 2 deletions HibernationFixup.xcodeproj/project.pbxproj
Expand Up @@ -391,7 +391,7 @@
MODULE_NAME = as.lvs1974.HibernationFixup;
MODULE_START = "$(PRODUCT_NAME)_kern_start";
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
MODULE_VERSION = 1.3.1;
MODULE_VERSION = 1.3.2;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down Expand Up @@ -439,7 +439,7 @@
MODULE_NAME = as.lvs1974.HibernationFixup;
MODULE_START = "$(PRODUCT_NAME)_kern_start";
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
MODULE_VERSION = 1.3.1;
MODULE_VERSION = 1.3.2;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down
4 changes: 3 additions & 1 deletion HibernationFixup/kern_hbfx.cpp
Expand Up @@ -23,6 +23,7 @@


#define FILE_NVRAM_NAME "/nvram.plist"
#define BACKUP_FILE_NVRAM_NAME "/System/Volumes/Data/nvram.plist"

// Only used in apple-driven callbacks
static HBFX *callbackHBFX = nullptr;
Expand Down Expand Up @@ -114,7 +115,8 @@ IOReturn HBFX::IOHibernateSystemSleep(void)
else
SYSLOG("HBFX", "Variable %s can't be found!", kBootNextKey);

callbackHBFX->nvstorage.save(FILE_NVRAM_NAME);
if (!callbackHBFX->nvstorage.save(FILE_NVRAM_NAME))
callbackHBFX->nvstorage.save(BACKUP_FILE_NVRAM_NAME);

if (callbackHBFX->sync)
callbackHBFX->sync(kernproc, nullptr, nullptr);
Expand Down

0 comments on commit c6215a1

Please sign in to comment.