tluck Posted February 4, 2017 Share Posted February 4, 2017 @sherlocks - ok - your 1.8 nvram script works... BUT it does a few things that may need some further scrutiny - and of course is the reason I use the attached scripts. Question: do you use LogoutHook or as shutdown script in CloverDaemon sleep loop only run on shutdown? The general logical flow of the script is: 1) fndESP - loop to find all ESP partitions on all disks - mount the ESP to check for EFI/CLOVER - and if no EFI/CLOVER unmount since it is not needing nvram file. 2) dmpNVRAM the loop on all the mounted ESP locations to write nvram.plist Questions/issues: -------- 1) _fndESP your script will try to unmount an ESP if it is already mounted. why bother to do this unmount? - the mounting of the filesystem is the most time-consuming and resource intensive aspect, so (A) why not use the existing mount? - the unmount procedure - if busy - you revert to forced unmount - why risk corrupting the filesystem only to remount it in the next step? ( And then why remove the mount point with "rm -r" - VERY UNSAFE action for a mount point - "rmdir" is enough if you need to remove a directory and not the tree. again, there is no need unmount ESP in the first place. 2) _dmpNVRAM (A) why write out the nvram file - then check to see if there is a change? echo "${gNVRAMbuf}" > "${gTarPath}/${gNVRAMf}" if [[ "${gOldNVRAM}" != "${gNVRAMbuf}" ]]; then nvram -x -p >"${gTarPath}/${gNVRAMf}" ... fi ( why leave ESP mounted? this is ok if this script is used in CloverDaemon as a shutdown script but if it used in a LogoutHook - the ESP should not be left mounted. --------------------- please review the attached script 1) cleaned up aspects - removed all extra variables and items not needed - remove redirects to log file - doesn't work well when called from CloverDaemon - loses synchronous output. 2) fndESP feature - uses current ESP mount in stead of unmount / mount 3) dmpNVRAM feature - ONLY writes to / of OS, if there is NO ESP found - writes the current nvram settings if there is a CLOVER directory. Note: there is no "win" in checking the file to see if there is no change. meaning there is no performance gain - so just write out current nvram to the file. - finally, try to unmount ESP - if it fails to unmount (busy) that's ok. to avoid, busy upon write, the best practice here is to put .metadata_never_index in the ESP. Note: I use LogoutHook (CloverDaemon-stopservice) instead of use the original CloverDaemon sleep loop. nvram_v1.9.zip 1 Link to comment Share on other sites More sharing options...
Sherlocks Posted February 4, 2017 Share Posted February 4, 2017 @sherlocks - ok - your 1.8 nvram script works... BUT it does a few things that may need some further scrutiny - and of course is the reason I use the attached scripts. Question: do you use LogoutHook or as shutdown script in CloverDaemon sleep loop only run on shutdown? The general logical flow of the script is: 1) fndESP - loop to find all ESP partitions on all disks - mount the ESP to check for EFI/CLOVER - and if no EFI/CLOVER unmount since it is not needing nvram file. 2) dmpNVRAM the loop on all the mounted ESP locations to write nvram.plist Questions/issues:-------- 1) _fndESP your script will try to unmount an ESP if it is already mounted. why bother to do this unmount? - the mounting of the filesystem is the most time-consuming and resource intensive aspect, so (A) why not use the existing mount? - the unmount procedure - if busy - you revert to forced unmount - why risk corrupting the filesystem only to remount it in the next step? ( And then why remove the mount point with "rm -r" - VERY UNSAFE action for a mount point - "rmdir" is enough if you need to remove a directory and not the tree. again, there is no need unmount ESP in the first place. 2) _dmpNVRAM (A) why write out the nvram file - then check to see if there is a change? echo "${gNVRAMbuf}" > "${gTarPath}/${gNVRAMf}" if [[ "${gOldNVRAM}" != "${gNVRAMbuf}" ]]; then nvram -x -p >"${gTarPath}/${gNVRAMf}" ... fi ( why leave ESP mounted? this is ok if this script is used in CloverDaemon as a shutdown script but if it used in a LogoutHook - the ESP should not be left mounted.---------------------please review the attached script 1) cleaned up aspects - removed all extra variables and items not needed - remove redirects to log file - doesn't work well when called from CloverDaemon - loses synchronous output. 2) fndESP feature - uses current ESP mount in stead of unmount / mount 3) dmpNVRAM feature - ONLY writes to / of OS, if there is NO ESP found - writes the current nvram settings if there is a CLOVER directory. Note: there is no "win" in checking the file to see if there is no change. meaning there is no performance gain - so just write out current nvram to the file. - finally, try to unmount ESP - if it fails to unmount (busy) that's ok. to avoid, busy upon write, the best practice here is to put .metadata_never_index in the ESP. Note: I use LogoutHook (CloverDaemon-stopservice) instead of use the original CloverDaemon sleep loop. I use clover daemon(i dont touch clover script(ESP)). Im not prefer to touch other script. I tested your script(r3998). But shown fail case. I did try to find fail case. Your script still has problem. I attached fact pic previous reply before. So i returned unmount method. I did test 1.8 to find fail case. 1.8 never shown fail case. I did debug to check each parts I will check 1.9 and test. If 1.9 never has fail, we can select more better. Thank you. 나의 LG-F410S 의 Tapatalk에서 보냄 Link to comment Share on other sites More sharing options...
D-an-W Posted February 4, 2017 Share Posted February 4, 2017 With your 3998 v3 fix my audio is still switching back to headphones on a reboot, perhaps its nothing to do with Clover after all. Link to comment Share on other sites More sharing options...
Common Sense Posted February 4, 2017 Share Posted February 4, 2017 Thank you. Still need test for RTC, other pathes included in kext_inject.c from users I'm waiting. 나의 LG-F410S 의 Tapatalk에서 보냄 please test again thanks in advance It works for me too. Link to comment Share on other sites More sharing options...
tluck Posted February 4, 2017 Share Posted February 4, 2017 @sherlocks - ok. thanks for reviewing. when you say fail case, i am not sure what that means exactly. the previous pictures were not explaining anything to me. what part of the script fails? failure to mount ESP? failure to write to ESP? failure to unmount ESP? Link to comment Share on other sites More sharing options...
Sherlocks Posted February 4, 2017 Share Posted February 4, 2017 @sherlocks - ok. thanks for reviewing. when you say fail case, i am not sure what that means exactly. the previous pictures were not explaining anything to me. what part of the script fails? failure to mount ESP? failure to write to ESP? failure to unmount ESP? Not sure. But i see that exist nvram file in /.http://www.insanelymac.com/forum/index.php?/topic/284656-Clover-General-discussion&do=findComment&comment=2361248 I want version that dont touch ESP script. Also suggest "remove nvram dummy file" if have ESP, when exist vram file in /, automately remove it. 1.8 can do this. I guess Mount fail? Not sure. Maybe when osx update or something. Anyway i get pic above. I understand latest your script. I knew need or not need from 1.8. I learned your script. Thank you 나의 LG-F410S 의 Tapatalk에서 보냄 Link to comment Share on other sites More sharing options...
Micky1979 Posted February 4, 2017 Share Posted February 4, 2017 ...anyway you, Sherlocks, you are great! 1 Link to comment Share on other sites More sharing options...
tluck Posted February 4, 2017 Share Posted February 4, 2017 @sherlocks ok. 1) ESP script? - you mean use /Library/A S/CloverDaemon - which calls /etc/rc.shutdown.d/* when a shutdown happens? 2) if /nvram.plist exists and ESP exists -> then remove /nvram.plist. Link to comment Share on other sites More sharing options...
Sherlocks Posted February 4, 2017 Share Posted February 4, 2017 @sherlocks ok. 1) ESP script? - you mean use /Library/A S/CloverDaemon - which calls /etc/rc.shutdown.d/* when a shutdown happens? 2) if /nvram.plist exists and ESP exists -> then remove /nvram.plist. 1)suggest for testing you added CloverDaemon-disable. Also i want to version that only touch RC script 2)suggest if user with ESP has nvram in "/", script automately find it and remove. Because no need nvram in "/" for ESP user if script has no problem. Your script is good. But i found fail case. I like debug and report for bug. I'm ready to resolve bug. We have to research fail case. Thank you 나의 LG-F410S 의 Tapatalk에서 보냄 Link to comment Share on other sites More sharing options...
tluck Posted February 4, 2017 Share Posted February 4, 2017 great. please provide more information on the failure when you have it. understood: 1) requirement - the /etc/rc.shutdown.d/script will work with standard CloverDaemon (and LogoutHook) 2) feature - add check to remove OS /nvram.plist if at least 1 ESP is found. i will test and repost soon. 1 Link to comment Share on other sites More sharing options...
erice Posted February 5, 2017 Share Posted February 5, 2017 Sorry to interrupt. I have a problem: the id of my amd hd 5770 is described in the new graphics kexts of 12.4, the kext are loaded but the board does not maintain stable colors and is slow. Help or expert advice would be very welcome. Thanks. Link to comment Share on other sites More sharing options...
Slice Posted February 5, 2017 Share Posted February 5, 2017 Sorry to interrupt. I have a problem: the id of my amd hd 5770 is described in the new graphics kexts of 12.4, the kext are loaded but the board does not maintain stable colors and is slow. Help or expert advice would be very welcome. Thanks. Yes, the problem is known "Colors flickering of Radeon I have to sale my Radeon HD6670 because of that. 1 Link to comment Share on other sites More sharing options...
Laavuska Posted February 5, 2017 Share Posted February 5, 2017 Nice. I found some point. Thank you 나의 LG-F410S 의 Tapatalk에서 보냄 The fix v3 fixed my CMOS errors too! Nice work! 1 Link to comment Share on other sites More sharing options...
Rocky12 Posted February 5, 2017 Share Posted February 5, 2017 yes i can confirm have the same problem Radeon HD5770 Sierra 10.12.4 CMOS reset error on Sierra is fix Sherlocks you are Great Link to comment Share on other sites More sharing options...
Micky1979 Posted February 5, 2017 Share Posted February 5, 2017 yes i can confirm have the same problem Radeon HD5770 Sierra 10.12.4 Another card to sell Link to comment Share on other sites More sharing options...
FredWst Posted February 5, 2017 Share Posted February 5, 2017 Hi, HD 4350 still working fine Sierra 10.12.4. Fred Link to comment Share on other sites More sharing options...
Wowfunhappy Posted February 5, 2017 Share Posted February 5, 2017 I use a Bluetooth mouse and keyboard, so I'm trying to figure out how to reboot into Windows (and then reboot again back into OS X) without actually activating the Clover menu. On a real Mac, the following terminal reboots into Windows, and restarting again from windows boots into OS X. bless --device /dev/[Windows Partition Identifier] --mount /Volumes/[Windows Volume] --setBoot --nextonly && reboot My EFI-boot, Clover-based Hackintosh also reboots into Windows after running this command, but once done I can't seem to get back into OS X (without lugging out my old USB keyboard to activate the Clover menu). For whatever reason, the --nextonly option is getting completely ignored. It goes without saying that I have my mac partition set as the default boot volume in config.plist. Any help? Thanks! Link to comment Share on other sites More sharing options...
tluck Posted February 6, 2017 Share Posted February 6, 2017 @wowfunhappy so it works to go to windows. then why dont you create a default volume Clover to boot macOS - that way, macOS can boot and does not require any intervention. Link to comment Share on other sites More sharing options...
cecekpawon Posted February 6, 2017 Share Posted February 6, 2017 What does this flag do, and how can I enable it permanently? Look here <key>RtVariables</key> <dict> <key>BooterConfig</key> <string>0x2</string> - or - sudo nvram bootercfg=%02%00 Link to comment Share on other sites More sharing options...
nekonoko Posted February 6, 2017 Share Posted February 6, 2017 http://www.insanelymac.com/forum/topic/306156-clover-bugissue-report-and-patch/?p=2360985 @nekonoko @Common Sense please test and report I tested v3, solves CMOS reset for me too. Thanks! Link to comment Share on other sites More sharing options...
smolderas Posted February 6, 2017 Share Posted February 6, 2017 Congratulations every dev on the 4000th commit. However I have a little issue with kext patching. Following fails to get patched, although the logs say it successfully patched: <dict> <key>Comment</key> <string>Boot screen fix</string> <key>Find</key> <data>AQAAdSU=</data> <key>Name</key> <string>IOGraphicsFamily</string> <key>Replace</key> <data>AQAA6yU=</data> </dict> Latest working version was r3998. Link to comment Share on other sites More sharing options...
Sherlocks Posted February 6, 2017 Share Posted February 6, 2017 @Slice Congratulations to clover's 4000th commit. i tested fix v3 r3998 build with other users. also checked build in edk2 r23837 they said no problem about rtc, audio patch, etc. here is fix file. please check thank you so much. add. have to return r3998's String.c file SafeString.c-clover fix.zip Link to comment Share on other sites More sharing options...
tluck Posted February 6, 2017 Share Posted February 6, 2017 congrats on b4000! on Lenovo T460 with BCM 4352 b3998 / edk2 23837 - works great BUT b4000 / edk2 23837 - breaks my bluetooth - suspect it to be kext patching? what should info provide? Link to comment Share on other sites More sharing options...
Matgen84 Posted February 6, 2017 Share Posted February 6, 2017 Hello, With r4000 on Sierra 10.12.3, I've some issue: no apple logo before logging to my session. On desktop, I can't access the finder. I need to use shortcuts to restart. So I returned to the version r3998. Please tell me if there is a solution Link to comment Share on other sites More sharing options...
Sherlocks Posted February 6, 2017 Share Posted February 6, 2017 Hello, With r4000 on Sierra 10.12.3, I've some issue: no apple logo before logging to my session. On desktop, I can't access the finder. I need to use shortcuts to restart. So I returned to the version r3998. Please tell me if there is a solution here is fix build r4000 with edk2 r23837 enjoy deleted build file to avoid confusion Link to comment Share on other sites More sharing options...
Recommended Posts