Invalidate kextcache after removing driver launchd plist file

人走茶凉 提交于 2019-12-12 01:36:34

问题


I've created uninstaller for my driver, that remove its matching plist file from /Library/LaunchDaemons so that it won't be loaded again by launchd on the next boot cycle. However, it doesn't seems to take any effect on my driver that is still being loaded normally after booting the machine.

After doing some research in this matter, I've found out that the kextcache is the reason for this behaviour, and in order clean/invalidate it, I need to touch the folder where the installation target volume. however, it haven't had any effect.

My question is how to properly invalidate the kext cache so that launchd won't load the kext after it's corresponding plist file was removed.

Thanks to the answer below, I invalidated kext cache. However, I'd like to have the equivalent for access existing folder in objective-c which my uninstaller helper is based on.

To be precise, here's the code I'd like to convert to objective-C:

sudo touch /System/Library/Extensions; sudo touch /Library/Extensions


回答1:


The proper way to invalidate the kext caches is

sudo touch /System/Library/Extensions

or in OS versions that support loading extensions from /Library:

sudo touch /Library/Extensions

As soon as you do this, the kext caches are automatically regenerated.



来源:https://stackoverflow.com/questions/39357305/invalidate-kextcache-after-removing-driver-launchd-plist-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!