Jump to content

Clover General discussion


ErmaC
30,171 posts in this topic

Recommended Posts

-f is a kernel flag. Has nothing to do with Clover.

You should not expect different versions of macOS/OS X to treat -f the same.

Yes. But actually not working now 100%. I tested it. -f is very usefull if implemented it.

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

This method worked in 10.6

    // Set boot argument for kernel if no caches, this should force kernel loading
    if (OSFLAG_ISSET(Entry->Flags, OSFLAG_NOCACHES) &&
        (StriStr(Entry->LoadOptions, L"Kernel=") == NULL)) {
      CHAR16 *KernelLocation = NULL;
      CHAR16 *TempOptions;

      if (Entry->OSVersion && AsciiOSVersionToUint64(Entry->OSVersion) <= AsciiOSVersionToUint64("10.9")) {
        KernelLocation =L"\"Kernel=/mach_kernel\"";
      } else {
        // used for 10.10, 10.11, and new version.
        KernelLocation =L"\"Kernel=/System/Library/Kernels/kernel\"";
      }

      TempOptions = AddLoadOption(Entry->LoadOptions, KernelLocation);
      FreePool(Entry->LoadOptions);
      Entry->LoadOptions = TempOptions;
    }

But boot.efi changed and no more look for argument Kernel=...

Link to comment
Share on other sites

Thanks for the good idea. I made this in rev.4295

 

Moreover I fixed one bug in kext injection

 

-  FreePool(KextPath);
+  FreePool(FullPath);
It may cause different effects. Test all again.

 

This is a great feature for testing configurations. I’ve been using 4020 for testing purposes becuase it has it.

Link to comment
Share on other sites

This method worked in 10.6

    // Set boot argument for kernel if no caches, this should force kernel loading
    if (OSFLAG_ISSET(Entry->Flags, OSFLAG_NOCACHES) &&
        (StriStr(Entry->LoadOptions, L"Kernel=") == NULL)) {
      CHAR16 *KernelLocation = NULL;
      CHAR16 *TempOptions;

      if (Entry->OSVersion && AsciiOSVersionToUint64(Entry->OSVersion) <= AsciiOSVersionToUint64("10.9")) {
        KernelLocation =L"\"Kernel=/mach_kernel\"";
      } else {
        // used for 10.10, 10.11, and new version.
        KernelLocation =L"\"Kernel=/System/Library/Kernels/kernel\"";
      }

      TempOptions = AddLoadOption(Entry->LoadOptions, KernelLocation);
      FreePool(Entry->LoadOptions);
      Entry->LoadOptions = TempOptions;
    }

But boot.efi changed and no more look for argument Kernel=...
I will test it again and report. Just set nocache true in config.plist? Or need -f?

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

The kernel (or perhaps boot.efi) definitely does something with it.

The fact that Chameleon does more stuff with it is off-topic wrt Clover.

 

The kernel... loads... the kernel cache???  :hysterical: Chameleon does not use boot.efi, it either directly loads the kernelcache or the kernel. The -f is not a valid kernel flag, -x, -s, and -v are though, at most it could be a boot.efi flag, but it's not or it would work. Maybe when there was a kextcache separate from the kernel -f was a valid flag but it's definitely no longer valid, and I can find no evidence it ever was, the timestamp of the cache being older than /S/L/E was used to ignore it. You could just edit the boot args and add -f, but it's not going to do anything. There is a reason why the kernelcache blocking has always been done differently in clover, because there is no mechanism to prevent the kernelcache from being loaded by boot.efi without preventing it from seeing it. However, it just fails if the kernelcache is not there anymore instead of being allowed to specify the kernel to load. There has been discussions between DF and I about trying to dynamically modify a kernelcache as it's loaded, but we haven't done anything, because usually patching can achieve the same result and that's more work than I have time for.

 

That's the code that used to work, but is now broken (some other mechanism required for later releases).

But still -f does something else by itself.

I don't know the solution to make it work 100% effective like it used to (eg. to keep a kext that has been deleted but is still in cache from loading), but I don't need that feature very often... I only need the -f for the AppleHDA out of cache problem.

 

If someone wants to work on fixing that, go for it...

 

The only solution is to dynamically unlink and relink the kernelcache when boot.efi is trying to load it instead of preventing it from loading. There is nothing else to do unless you propose skipping boot.efi and directly loading kernel, then why not just use chameleon?

 

Yes. But actually not working now 100%. I tested it. -f is very usefull if implemented it.

 

I will test it again and report. Just set nocache true in config.plist? Or need -f?

 

No, it does not work unless you are using an older version of macOS. The ability to specify the kernel to load instead of the kernelcache was removed.

 

 

But boot.efi changed and no more look for argument Kernel=...

 

Yeah, slice knows exactly what it does and is correct.

  • Like 2
Link to comment
Share on other sites

But still -f does something else by itself.

I don't know the solution to make it work 100% effective like it used to (eg. to keep a kext that has been deleted but is still in cache from loading), but I don't need that feature very often... I only need the -f for the AppleHDA out of cache problem.

 

If someone wants to work on fixing that, go for it...

 

I cant see anywhere in latest xnu source that they will read "-f" arg, so I will assumed it will not work for newest os? Maybe you need to block AppleHDA from prelinked & then forceload them.

  • Like 1
Link to comment
Share on other sites

The kernel... loads... the kernel cache???

Obviously, Apple uses the term "kernel flag" loosely, as some of those flags actually are handled by boot.efi.

 

You could just edit the boot args and add -f, but it's not going to do anything.

I use it all the time to correct the situation when AppleHDA falls of out kernel cache (when using AppleHDA injector with symlink).

It works.

 

If you don't want to/don't think you need it, just don't use it. I really don't care.

Link to comment
Share on other sites

Obviously, Apple uses the term "kernel flag" loosely, as some of those flags actually are handled by boot.efi.

 

 

I use it all the time to correct the situation when AppleHDA falls of out kernel cache (when using AppleHDA injector with symlink).

It works.

 

If you don't want to/don't think you need it, just don't use it. I really don't care.

 

Chameleon doesn't use boot.efi, so that flag would never have done anything if not handled by boot.efi. Also it's not present in boot.efi, check with strings command line tool, in fact I see no flags.

 

EDIT: I tried to post the results but it apparently contains square brackets so it disabled the ability for me to post, I had to leave and come back.

EDIT2: Don't get me wrong I have no problem with getting something to work but we had this discussion like five years ago at least on projectosx, and we came to the consensus that it did not work without implementing it to block when -f was in boot args, which then we decided to move to a bit flags style system for determining the boot actions.

EDIT3: I have attached the output of the ASCII and Unicode strings from boot.efi. In order for it to have any effect in boot.efi, there would need to be the unicode string -f, which there is not.

boot.efi.strings.txt

boot.efi.strings.Unicode.txt

  • Like 1
Link to comment
Share on other sites

Is it possible to use nvram reset in gui?

I have made a suggestion once before, but I suggest it again.

This capability is a function in Ozmosis.

cecekpawon has previously applied this ability to clover.

Adding this feature makes it possible to reset the remaining nvda_drv = 1 options in nvram for nvidia graphics or the keys left in hibernation or etc, which can be useful in many situations.

 

in his github

here is commit link

 

thanks in advance

  • Like 2
Link to comment
Share on other sites

Chameleon doesn't use boot.efi, so that flag would never have done anything if not handled by boot.efi. Also it's not present in boot.efi, check with strings command line tool, in fact I see no flags.

 

EDIT: I tried to post the results but it apparently contains square brackets so it disabled the ability for me to post, I had to leave and come back.

EDIT2: Don't get me wrong I have no problem with getting something to work but we had this discussion like five years ago at least on projectosx, and we came to the consensus that it did not work without implementing it to block when -f was in boot args, which then we decided to move to a bit flags style system for determining the boot actions.

EDIT3: I have attached the output of the ASCII and Unicode strings from boot.efi. In order for it to have any effect in boot.efi, there would need to be the unicode string -f, which there is not.

All I know is that -f works for my purpose.

Therefore it is parsed/handled somewhere in the system. I have no need to determine specifically where.

 

Getting "boot without caches" to work "like it does in older OS X" (eg. for getting the system to not load/start kexts in kernel cache), is something I never attempted to fix as I have no need for it.

Link to comment
Share on other sites

 

Is it possible to use nvram reset in gui?
I have made a suggestion once before, but I suggest it again.
This capability is a function in Ozmosis.
cecekpawon has previously applied this ability to clover.
Adding this feature makes it possible to reset the remaining nvda_drv = 1 options in nvram for nvidia graphics or the keys left in hibernation or etc, which can be useful in many situations.
 
in his github
here is commit link
 
thanks in advance

 

 

If you can find it look at the source code for the supposed to exist EFI shell command "default". I see it documented but don't see it implemented anywhere and it doesn't work in virtualbox or my actual firmware. You can always try to iterate through every variable and set every size to zero to remove it and see if that resets it to default when you restart or immediately, or if you then have to actually reset your CMOS.

 

EDIT: Just merge his changes into the main repo dude, I see you mean only the variables clover would ever change and not your whole nvram.

 

All I know is that -f works for my purpose.

Therefore it is parsed/handled somewhere in the system. I have no need to determine specifically where.

 

Getting "boot without caches" to work "like it does in older OS X" (eg. for getting the system to not load/start kexts in kernel cache), is something I never attempted to fix as I have no need for it.

 

But the problem is that there are all of us saying that it doesn't work because we developed this and went through this, and just you saying it does. I am just trying to figure out why man, I'm not attacking you or anything. But evidence and stuff. Science. I'm asking for why it works, the evidence.

  • Like 1
Link to comment
Share on other sites

But the problem is that there are all of us saying that it doesn't work because we developed this and went through this, and just you saying it does. I am just trying to figure out why man, I'm not attacking you or anything. But evidence and stuff. Science. I'm asking for why it works, the evidence.

Depends on expectations for what you mean by "works".

I think different people have different expectations for it.

 

If you implement audio with an AppleHDA injector (with symlink) + Clover patches, you would eventually run into a situation where you need "-f, rebuild cache, reboot," to restore lost audio. It is super common with that particular technique for implementing audio (which admittedly is a bit sketchy) and the -f flag (followed by rebuild caches) works every time to fix it. As for the "why", no certainty on it... Lack of time and interest... other things higher priority.

If you use some other method to implement audio, you would likely want "without caches" to do what it used to do, as you're probably looking to prevent a kext that is in cache from starting (because it is crashing), and of course that doesn't work in current macOS/OS X with Clover as written, but requires other methods to removoe the kernel cache or reset it.

  • Like 1
Link to comment
Share on other sites

@Sherlocks According to source Clover will do that job for you as long as you have gSettings.NvidiaWeb leave unset. Isnt it?

I see. I didn't look code in detail that you take a link before.

I just saw that someone reported nvram issue related nvda_drv=1 in nvram before in this thread. He always kept nvda_drv=1 in his nvram storage. Not sure. I can' test. Now i don't have any nvidia graphic. i just suggested nvram reset. Also in various situation, seems your commit is usefull. Can we use nvram reset features for latest clover?

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

I see. I didn't look code in detail that you take a link before.

I just saw that someone reported nvram issue related nvda_drv=1 in nvram before in this thread. He always kept nvda_drv=1 in his nvram storage. Not sure. I can' test. Now i don't have any nvidia graphic. i just suggested nvram reset. Also in various situation, seems your commit is usefull. Can we use nvram reset features for latest clover?

 

He did not change the license, you can always merge downstream commits back upstream.

Depends on expectations for what you mean by "works".

I think different people have different expectations for it.

 

If you implement audio with an AppleHDA injector (with symlink) + Clover patches, you would eventually run into a situation where you need "-f, rebuild cache, reboot," to restore lost audio. It is super common with that particular technique for implementing audio (which admittedly is a bit sketchy) and the -f flag (followed by rebuild caches) works every time to fix it. As for the "why", no certainty on it... Lack of time and interest... other things higher priority.

If you use some other method to implement audio, you would likely want "without caches" to do what it used to do, as you're probably looking to prevent a kext that is in cache from starting (because it is crashing), and of course that doesn't work in current macOS/OS X with Clover as written, but requires other methods to removoe the kernel cache or reset it.

 

But you are rebuilding the caches... So don't you think that's what is solving your issue? Have you tried not using -f and just rebuilding caches? If -f was working, the kext would have loaded and you should have working audio on that boot... No?

  • Like 1
Link to comment
Share on other sites

Can we use nvram reset features for latest clover?

 

You can take whatever you want from there. You can start to merge all known variable  set by Clover here with mine, and list em all into GUI with checkbox / set a combo key for that.

 

He did not change the license, you can always merge downstream commits back upstream.

 

Please dont, Im afraid it will screwed up current Clover. Just take some with carefully while merging. Maybe including this hacky way to block individual kext from prelinked to help Rehabman.

Link to comment
Share on other sites

You can take whatever you want from there. You can start to merge all known variable  set by Clover here with mine, and list em all into GUI with checkbox / set a combo key for that.

 

 

Please dont, Im afraid it will screwed up current Clover. Just take some with carefully while merging. Maybe including this hacky way to block individual kext from prelinked to help Rehabman.

 

Lol, I didn't mean actually merge the commits into the current repo, I just meant that yes he can take downstream commits and implement them. Plus there would be no way to solve the merge conflicts since you are using a git repo and the official is svn, and yours is based off like 1000 revisions behind too, so yes that would be not good.

 

EDIT: Ok only like 500.

Link to comment
Share on other sites

Depends on expectations for what you mean by "works".

I think different people have different expectations for it.

 

If you implement audio with an AppleHDA injector (with symlink) + Clover patches, you would eventually run into a situation where you need "-f, rebuild cache, reboot," to restore lost audio. It is super common with that particular technique for implementing audio (which admittedly is a bit sketchy) and the -f flag (followed by rebuild caches) works every time to fix it. As for the "why", no certainty on it... Lack of time and interest... other things higher priority.

If you use some other method to implement audio, you would likely want "without caches" to do what it used to do, as you're probably looking to prevent a kext that is in cache from starting (because it is crashing), and of course that doesn't work in current macOS/OS X with Clover as written, but requires other methods to removoe the kernel cache or reset it.

I use a patched AppleHDA and also lose the sound after an update, but after rebuilding the cache and restart it works again without any boot flags.

Link to comment
Share on other sites

I use a patched AppleHDA and also lose the sound after an update, but after rebuilding the cache and restart it works again without any boot flags.

Yes, sometimes only a rebuild cache is needed.

Except when it doesn't work.

Link to comment
Share on other sites

 

Switch off Fusion drive then install High Sierra and then switch on Fusion drive again.

Sorry for the delay, I'm in a test week in college.

 

Would doing this make me lose all my files and programs? The intention would be to be able to upgrade from 10.13 to 10.13.1 and in future updates too, without starting from 0. If do not lose any files and programs, how can I do this turn off, turn on ? Command lines in the terminal?.

 

No! Don't mount the virtualized core storage volume, that gets you nowhere. Inspect the individual volumes on the disks themselves, they should have multiple partitions. That's why I said terminal, because Finder will only allow you to see the core storage volume. I believe there is a preboot volume that contains the actual loaders, they are in some weird named folders, they might have changed the folders. Your boot.log section where it says your disks/volumes would be nice too cause it should say in that as well.

I formatted the Fusion Drive. First I installed the updates on the notebook HD, then I cloned the HD image to Fusion Drive. Just this way I'm getting the system updated, the problem is that I lose all files and programs. But I had to do this to deliver a college project.

 

 

When I formatted it, I took some photos to try to solve the problem.

This is the correct path that OsxAptioFix2Drv takes to make the update successful (I took this picture when I updated the notebook's HD system)

post-748259-0-32316000-1510281193_thumb.jpg

 

This is the path that OSXAptionFix takes to upgrade via Fusion Drive. So I guess it is not finding the installation location properly.

 

How do I fix this path? Is it possible to fix this in a future clover update?
post-748259-0-62375600-1507264577_thumb.jpg
Link to comment
Share on other sites

You should read the comment by fusion71au, a few back, it fully answers your question and how to solve it. I have no idea if it's fixed yet or not, it's weird that it would just stop working all the sudden because that's the same method that it was using previously so I'm not sure why it failed unless it had to do with another fix for the installer fusion71au sugguested.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...