Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

Please try v1.4, improvements:

 

- 20.mount.ESP.local will write logoutHook to system at startup

- 80.save_nvram_plist.local now will compare old nvram.plist, if the content is same, then we do not dump to it(reduce write to hard disk each time and improve shutdown time on HDD)

- now the sleep cannot dump nvram to EFI/ issue should have gone

 

@Sherlock @tluck @cnrd @cjfly @RehabMan @Dr.Hurt @Slice ...

 

Note: this time, you should ensure that msdosfs.kext hasn't been loaded when startup. To force it unload, just type

sudo kextunload /System/Library/Extensions/msdosfs.kext

syscl_nvram_save.zip

 

 

Best wishes,

syscl

  • Like 1
Link to comment
Share on other sites

if you put the file here:

 

/etc/rc.shutdown.d/80.save_nvram_plist.local

 

won't the cloverdaemon script and logoutHook both run it?

if so, then i guess  this means one needs to disable the CloverDaemon in /Library/LaunchDaemons

Link to comment
Share on other sites

Please try v1.4, improvements:

 

- 20.mount.ESP.local will write logoutHook to system at startup

- 80.save_nvram_plist.local now will compare old nvram.plist, if the content is same, then we do not dump to it(reduce write to hard disk each time and improve shutdown time on HDD)

- now the sleep cannot dump nvram to EFI/ issue should have gone

 

@Sherlock @tluck @cnrd @cjfly @RehabMan @Dr.Hurt @Slice ...

 

Note: this time, you should ensure that msdosfs.kext hasn't been loaded when startup. To force it unload, just type

sudo kextunload /System/Library/Extensions/msdosfs.kext

attachicon.gifsyscl_nvram_save.zip

 

 

Best wishes,

syscl

 

perfectly work with stable now.

 

thank you.

  • Like 1
Link to comment
Share on other sites

if you put the file here:

 

/etc/rc.shutdown.d/80.save_nvram_plist.local

 

won't the cloverdaemon script and logoutHook both run it?

That's what we have to consider, but, at this stage, the most important thing is to solve NVRAM dump to EFI/

 

2x write to EFI/ has no problem because in v1.4:

- the script has one more procedure to see if the NVRAM need to be refreshed

- @Slice and other Clover developers' still don't give any information where this file should be placed, thus we just simply leave the file in the original place

 

syscl

  • Like 1
Link to comment
Share on other sites

Please try v1.4, improvements:

 

- 20.mount.ESP.local will write logoutHook to system at startup

...

I'm pretty sure we'll only have to write this value once, so I don't think we need to run it on each boot, unless someone were to delete it manually, but then we should probably let them do so?

 

We could probably just let clover write the value as a part of the install, if scripts are chosen.

 

EDIT: Or we could do something like:

#!/bin/bash

gLogoutHookf="/etc/logoutHook/save_nvram_to_efi.sh"

if [[ ! $(defaults read com.apple.loginwindow LogoutHook) && -f "${gLogoutHookf}" ]]; then
	defaults write com.apple.loginwindow LogoutHook ${gLogoutHookf}
fi

But that would be the same (But not overwriting LogoutHook if people have something else in there.

 

Also I don't think this should be added to 20.mount_ESP.local, as that file is for mounting ESP on boot, not writing extra config for save_nvram.

Link to comment
Share on other sites

personally, i am not a fan adding the LogoutHook creation from the rc.boot 20 script.

i already am using LogoutHook and will just add the 80.save_nvram to my LogoutHook script.

i dont know of a good way to automate this addition. 

Link to comment
Share on other sites

personally, i am not a fan adding the LogoutHook creation from the rc.boot 20 script.

i already am using LogoutHook and will just add the 80.save_nvram to my LogoutHook script.

i dont know of a good way to automate this addition. 

 

I edited the post just above yours, what about that idea? (Not overwriting LogoutHook, and letting people add it to their own scripts if they need to).

Link to comment
Share on other sites

yes - 

1) leave 20 script for use mounting ESP - which i never use personally.

2) write LogoutHook - if not defined.

 

3)  instead my preference  - is put clover stuff same place as other items - gLogoutHookf="/Library/Application Support/Clover/CloverLogoutHook.sh"

Link to comment
Share on other sites

yes - 

1) leave 20 script for use mounting ESP - which i never use personally.

2) write LogoutHook - if not defined.

 

3)  instead my preference  - is put clover stuff same place as other items - gLogoutHookf="/Library/Application Support/Clover/CloverLogoutHook.sh"

 

What about this?

#!/bin/bash

mkdir -p "/Library/Application Support/Clover/LogoutHook"

gLogoutHookf="/Library/Application Support/Clover/LogoutHook/CloverLogoutHook.sh"
saveNVMRAM="/Library/Application Support/Clover/LogoutHook/save_nvram_to_efi.sh"

if [[ ! $(defaults read com.apple.loginwindow LogoutHook) && -f "${saveNVMRAM}" ]]; then
	echo "#!/bin/bash" >> "${gLogoutHookf}"
	echo -e "\"${saveNVMRAM}\"" >> "${gLogoutHookf}"
	chown root:wheel "${gLogoutHookf}"
	chmod 755 "${gLogoutHookf}"
	defaults write com.apple.loginwindow LogoutHook "${gLogoutHookf}"
elif [[ "$(defaults read com.apple.loginwindow LogoutHook)" != ${saveNVMRAM} && -f "${saveNVMRAM}" ]]; then
	rm "${gLogoutHookf}"
	echo "#!/bin/bash" >> "${gLogoutHookf}"
	echo -e "\"$(defaults read com.apple.loginwindow LogoutHook)\"" >> "${gLogoutHookf}"
	echo -e "\"${saveNVMRAM}\"" >> "${gLogoutHookf}"
	chown root:wheel "${gLogoutHookf}"
	chmod 755 "${gLogoutHookf}"
	defaults write com.apple.loginwindow LogoutHook "${gLogoutHookf}"
fi 

It will add the logoutHook in case there is none, if logoutHook is already set, then create a script contaning old logoutHook and the EFI script, meaning that our EFI script will work, while the old logoutHook will also work.

 

(Yes I know it's fugly, too tired to clean it up).

 

EDIT: This won't work, stuck on reboot.

  • Like 1
Link to comment
Share on other sites

Please try v1.4, improvements:

 

- 20.mount.ESP.local will write logoutHook to system at startup

- 80.save_nvram_plist.local now will compare old nvram.plist, if the content is same, then we do not dump to it(reduce write to hard disk each time and improve shutdown time on HDD)

- now the sleep cannot dump nvram to EFI/ issue should have gone

 

@Sherlock @tluck @cnrd @cjfly @RehabMan @Dr.Hurt @Slice ...

 

Note: this time, you should ensure that msdosfs.kext hasn't been loaded when startup. To force it unload, just type

sudo kextunload /System/Library/Extensions/msdosfs.kext

attachicon.gifsyscl_nvram_save.zip

 

 

Best wishes,

syscl

hi syscl :) , 1.4 works like a charm, and if I do not change brightness, the /Volumes/EFI/nvram.plist will not be updated, nice!

 

Seems like it's almost the final version?

 

Cheers ^_^

v1.4 (c) 2017 syscl/lighting/Yating Zhou
Found EFI disk0s1
Target path: /Volumes/EFI01
EmuVariable is present
dump nvram
  • Like 1
Link to comment
Share on other sites

hi syscl :) , 1.4 works like a charm, and if I do not change brightness, the /Volumes/EFI/nvram.plist will not be updated, nice!

 

Seems like it's almost the final version?

 

Cheers ^_^

v1.4 (c) 2017 syscl/lighting/Yating Zhou
Found EFI disk0s1
Target path: /Volumes/EFI01
EmuVariable is present
dump nvram
Me too. Laptop need brightness value refesh if we change brighness before reboot.

 

Syscl script shown best result now. I tested it during 2 days

Stable and generated nvram in ESP.

 

나의 LG-F410S 의 Tapatalk에서 보냄

  • Like 1
Link to comment
Share on other sites

Please try v1.4, improvements:

 

- 20.mount.ESP.local will write logoutHook to system at startup

- 80.save_nvram_plist.local now will compare old nvram.plist, if the content is same, then we do not dump to it(reduce write to hard disk each time and improve shutdown time on HDD)

- now the sleep cannot dump nvram to EFI/ issue should have gone

 

@Sherlock @tluck @cnrd @cjfly @RehabMan @Dr.Hurt @Slice ...

 

Note: this time, you should ensure that msdosfs.kext hasn't been loaded when startup. To force it unload, just type

sudo kextunload /System/Library/Extensions/msdosfs.kext

attachicon.gifsyscl_nvram_save.zip

 

 

Best wishes,

syscl

I can confirm @syscl's script work prefectly

Last login: Sun Jan  8 10:26:33 on ttys000
DremaboatdeMac-Pro:~ zhanghongmin$ sudo cat /Library/Logs/CloverEFI/rc.shutdown.log
Password:
v1.4 (c) 2017 syscl/lighting/Yating Zhou
Found EFI disk0s1
Found EFI disk1s1
Target path: /Volumes/EFI01
EmuVariable is present
dump nvram
Target path: /Volumes/EFI11>> End Script: /private/etc/rc.shutdown.d/80.save_nvram_plist.local

n
DremaboatdeMac-Pro:~ zhanghongmin$ 

post-1333486-0-95341600-1483842638_thumb.png

 

I propose Clover could merge syscl's 1.4. It's great!

  • Like 3
Link to comment
Share on other sites

Please try v1.4, improvements:

 

- 20.mount.ESP.local will write logoutHook to system at startup

- 80.save_nvram_plist.local now will compare old nvram.plist, if the content is same, then we do not dump to it(reduce write to hard disk each time and improve shutdown time on HDD)

- now the sleep cannot dump nvram to EFI/ issue should have gone

 

@Sherlock @tluck @cnrd @cjfly @RehabMan @Dr.Hurt @Slice ...

 

Note: this time, you should ensure that msdosfs.kext hasn't been loaded when startup. To force it unload, just type

sudo kextunload /System/Library/Extensions/msdosfs.kext

attachicon.gifsyscl_nvram_save.zip

 

 

Best wishes,

syscl

Thanks, accepted in 3975

  • Like 3
Link to comment
Share on other sites

Thanks, accepted in 3975

Thanks, and thank you @Sherlock who provided some more detail information such that I can refine the script to v1.5+. Maybe the new script will release this week. Improvements will be:

  • Safe mode(-x) dump NVRAM to EFI/
  • Installation mode dump NVRAM to EFI/
  • Use just logoutHook method
  • Use unmount with argument -f to force release EFI/ just in case
  • ...

 

syscl

  • Like 2
Link to comment
Share on other sites

Thanks, and thank you @Sherlock who provided some more detail information such that I can refine the script to v1.5+. Maybe the new script will release this week. Improvements will be:

  • Safe mode(-x) dump NVRAM to EFI/
  • Installation mode dump NVRAM to EFI/
  • Use just logoutHook method
  • Use unmount with argument -f to force release EFI/ just in case
  • ...

 

syscl

You shouldn't block LogoutHook for others. There may be users who use LogoutHook for something else.

Link to comment
Share on other sites

Hi,

 

New 80.save_nvram_plist.local has a few small issues:

  • if anything is written to stderr it seems to end the script
    • gpt show writes to stderr in case of an hybrid mbr
    • diskutil is no longer available at shutdown, instead force umount
  • CloverEFI EmuVariable is not detected
  • For each MBR disk "/" is added to the list to write nvram to since there is no EFI partition, why not write nvram to all EFI partitions that contain Clover and only if there are none write to root ("/")

Patch attached.

 

80.save_nvram_plist.local.patch.zip

  • Like 1
Link to comment
Share on other sites

Hi,

 

New 80.save_nvram_plist.local has a few small issues:

  • if anything is written to stderr it seems to end the script
    • gpt show writes to stderr in case of an hybrid mbr
    • diskutil is no longer available at shutdown, instead force umount
  • CloverEFI EmuVariable is not detected
  • For each MBR disk "/" is added to the list to write nvram to since there is no EFI partition, why not write nvram to all EFI partitions that contain Clover and only if there are none write to root ("/")
Patch attached.
Good. I interest in nvram script to solve issue.

I will test this script during about 2days. And will report.

 

Thank you

 

나의 LG-F410S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Hi,

 

New 80.save_nvram_plist.local has a few small issues:

  • if anything is written to stderr it seems to end the script
    • gpt show writes to stderr in case of an hybrid mbr
    • diskutil is no longer available at shutdown, instead force umount
  • CloverEFI EmuVariable is not detected
  • For each MBR disk "/" is added to the list to write nvram to since there is no EFI partition, why not write nvram to all EFI partitions that contain Clover and only if there are none write to root ("/")

Patch attached.

 

good! 

 

report.

1.4 script has problems

 1. if we try update macos or usb installer to install osx. after we try it, first boot, we always get nvram file in root.(this is mount or unmount issue), 2nd boot, generated nvram in ESP and remove it in root again like before.

 2. very rare generate nvram file is fail in ESP(this is mount or unmount issue)

 

i already report this to syscl. 

 

 

they are resolved in your script. also nvram refresh is good.

 

Supreme-MBP:~ supreme$ sudo cat /Library/Logs/CloverEFI/rc.shutdown.log 

Password:

v1.4 © 2017 syscl/lighting/Yating Zhou

Found EFI disk0s1

Found Clover /Volumes/EFI01/EFI/CLOVER

Target path: /Volumes/EFI01

Save NVRAM to /Volumes/EFI01

Failed to s>> End Script: /private/etc/rc.shutdown.d/80.save_nvram_plist.local

 

Supreme-MBP:~ supreme$ sudo /etc/rc.shutdown.d/80.save_nvram_plist.local

 

Supreme-MBP:~ supreme$ 

 

as result, shown good result.

 

i want to talk this "Failed to s" above log

 

you added

        nvram -x -p >"${gTarPath}/${gNVRAMf}" 2>&1 && RETURN_VAL=${kBASHReturnSuccess} || RETURN_VAL=${kBASHReturnFailure}; echo "Failed to save NVRAM"

 

it means good result? or fail result?

 

i saw nvram file is refresh after reboot(good result).

 

 

thank you so much.

Link to comment
Share on other sites

Added ability to show Debian and Kali Linux distro in the Clover GUI

 

Just added "DADDY" Debian on the top of all his Debian-based releases (derivatives) with one of his child (Kali) to the list.

 

Debian

A.png

 

Kali

B.png

 

folder.png

 

diff...

 

 

diff --git a/rEFIt_UEFI/entry_scan/loader.c b/rEFIt_UEFI/entry_scan/loader.c
index 25657a9..5f1e86f 100644
--- a/rEFIt_UEFI/entry_scan/loader.c
+++ b/rEFIt_UEFI/entry_scan/loader.c
@@ -80,8 +80,6 @@ STATIC LINUX_PATH_DATA LinuxEntryData[] = {
   { L"\\EFI\\Gentoo\\grubx64.efi", L"Gentoo EFI boot menu", L"gentoo,linux", "Gentoo" },
   { L"\\EFI\\Gentoo\\kernelx64.efi", L"Gentoo EFI kernel", L"gentoo,linux" },
   { L"\\EFI\\RedHat\\grubx64.efi", L"RedHat EFI boot menu", L"redhat,linux", "Redhat" },
+  { L"\\EFI\\debian\\grubx64.efi", L"Debian EFI boot menu", L"debian,linux", "Debian" },
+  { L"\\EFI\\kali\\grubx64.efi", L"Kali EFI boot menu", L"kali,linux", "Kali" },
   { L"\\EFI\\ubuntu\\grubx64.efi", L"Ubuntu EFI boot menu", L"ubuntu,linux", "Ubuntu" },
   { L"\\EFI\\kubuntu\\grubx64.efi", L"kubuntu EFI boot menu", L"kubuntu,linux", "kubuntu" },
   { L"\\EFI\\LinuxMint\\grubx64.efi", L"Linux Mint EFI boot menu", L"mint,linux", "Linux Mint" },
- rEFIt_UEFI/entry_scan/loader.c

 

Cordially

 

ErmaC

  • Like 2
Link to comment
Share on other sites

Hi,

 

New 80.save_nvram_plist.local has a few small issues:

  • if anything is written to stderr it seems to end the script
    • gpt show writes to stderr in case of an hybrid mbr
    • diskutil is no longer available at shutdown, instead force umount
  • CloverEFI EmuVariable is not detected
  • For each MBR disk "/" is added to the list to write nvram to since there is no EFI partition, why not write nvram to all EFI partitions that contain Clover and only if there are none write to root ("/")

Patch attached.

Thanks, I will look into your patch later. Because I got very bad/heavy fever these days, need some rest. 

 

I have some other improvements on v1.4, but address @Sherlock's issue first :)

 

Thank you,

syscl

good! 

 

report.

1.4 script has problems

 1. if we try update macos or usb installer to install osx. after we try it, first boot, we always get nvram file in root.(this is mount or unmount issue), 2nd boot, generated nvram in ESP and remove it in root again like before.

 2. very rare generate nvram file is fail in ESP(this is mount or unmount issue)

 

i already report this to syscl. 

 

 

they are resolved in your script. also nvram refresh is good.

 

as result, shown good result.

 

i want to talk this "Failed to s" above log

 

you added

        nvram -x -p >"${gTarPath}/${gNVRAMf}" 2>&1 && RETURN_VAL=${kBASHReturnSuccess} || RETURN_VAL=${kBASHReturnFailure}; echo "Failed to save NVRAM"

 

it means good result? or fail result?

 

i saw nvram file is refresh after reboot(good result).

 

 

thank you so much.

Failed to save NVRAM in the log isn't good. Need to see what's wrong.

 

syscl

You shouldn't block LogoutHook for others. There may be users who use LogoutHook for something else.

@smolderas, can logoutHook run multiple scripts at the same time? 

 

syscl

Link to comment
Share on other sites

Thanks, I will look into your patch later. Because I got very bad/heavy fever these days, need some rest. 

 

I have some other improvements on v1.4, but address @Sherlock's issue first :)

 

Thank you,

syscl

Failed to save NVRAM in the log isn't good. Need to see what's wrong.

 

syscl

@smolderas, can logoutHook run multiple scripts at the same time? 

 

syscl

Sadly no, there can only be one LogoutHook at one time...

If I understood all of this correctly, you replaced the script with commands that still could be used in the log out process. So why do you need the logout hook?

 

Why are you loading kexts in the login, is it really necessary?

Link to comment
Share on other sites

Added ability to show Debian and Kali Linux distro in the Clover GUI

 

Just added "DADDY" Debian on the top of all his Debian-based releases (derivatives) with one of his child (Kali) to the list.

 

Debian

attachicon.gifA.png

 

Kali

attachicon.gifB.png

 

attachicon.giffolder.png

 

diff...

 

diff --git a/rEFIt_UEFI/entry_scan/loader.c b/rEFIt_UEFI/entry_scan/loader.c
index 25657a9..5f1e86f 100644
--- a/rEFIt_UEFI/entry_scan/loader.c
+++ b/rEFIt_UEFI/entry_scan/loader.c
@@ -80,8 +80,6 @@ STATIC LINUX_PATH_DATA LinuxEntryData[] = {
   { L"\\EFI\\Gentoo\\grubx64.efi", L"Gentoo EFI boot menu", L"gentoo,linux", "Gentoo" },
   { L"\\EFI\\Gentoo\\kernelx64.efi", L"Gentoo EFI kernel", L"gentoo,linux" },
   { L"\\EFI\\RedHat\\grubx64.efi", L"RedHat EFI boot menu", L"redhat,linux", "Redhat" },
+  { L"\\EFI\\debian\\grubx64.efi", L"Debian EFI boot menu", L"debian,linux", "Debian" },
+  { L"\\EFI\\kali\\grubx64.efi", L"Kali EFI boot menu", L"kali,linux", "Kali" },
   { L"\\EFI\\ubuntu\\grubx64.efi", L"Ubuntu EFI boot menu", L"ubuntu,linux", "Ubuntu" },
   { L"\\EFI\\kubuntu\\grubx64.efi", L"kubuntu EFI boot menu", L"kubuntu,linux", "kubuntu" },
   { L"\\EFI\\LinuxMint\\grubx64.efi", L"Linux Mint EFI boot menu", L"mint,linux", "Linux Mint" },
- rEFIt_UEFI/entry_scan/loader.c

 

Cordially

 

ErmaC

 

Yes, debian is really very important distr!

Committed to 3977.

Link to comment
Share on other sites

on nvram.plist save.

 

i dont think loading any kexts are needed. the key issue seems to be - the same thing we saw quite awhile ago with CloverDaemon - "running out of time" to run /etc/rc.shutdown.d scripts. 

the LogoutHook method is a better approach as it can start running its stuff before too late.

 

I tested FrodoKenny's script today and it has been working great.

3 points:

- no /etc/rc.boot.d/20 script for me - no need to load any kexts etc.

- commented out last 5 lines of CloverDaemon script - no need to run shutdown script a 2nd time. 

- made a minor addition to unmount the ESP volumes in 80.save_nvram script - since it is a LogoutHook, And I dont always reboot after a logout - I do not want the ESP mounted after re-login (without a shutdown)

Link to comment
Share on other sites

Sadly no, there can only be one LogoutHook at one time...

If I understood all of this correctly, you replaced the script with commands that still could be used in the log out process. So why do you need the logout hook?

 

Why are you loading kexts in the login, is it really necessary?

 

on nvram.plist save.

 

i dont think loading any kexts are needed. the key issue seems to be - the same thing we saw quite awhile ago with CloverDaemon - "running out of time" to run /etc/rc.shutdown.d scripts. 

the LogoutHook method is a better approach as it can start running its stuff before too late.

 

I tested FrodoKenny's script today and it has been working great.

3 points:

- no /etc/rc.boot.d/20 script for me - no need to load any kexts etc.

- commented out last 5 lines of CloverDaemon script - no need to run shutdown script a 2nd time. 

- made a minor addition to unmount the ESP volumes in 80.save_nvram script - since it is a LogoutHook, And I dont always reboot after a logout - I do not want the ESP mounted after re-login (without a shutdown)

I do not load any kext during logoutHook, it has been deprecated very long time ago if you look into the code. The key issue of failure umount ESP is due to msdosfs.kext or exFat.kext failed to load during mount/umount process. Which kext need to be loaded depends on what file system you have on your EFI. 

 

It's not logoutHook method fix the issue, is because during logout, system allows us to load msdosfs.kext/exFat.kext...

 

umount ESP after dumping NVRAM is what I will add in v1.5...

 

syscl

Link to comment
Share on other sites

×
×
  • Create New...