删除驱动程序启动的plist文件后,使kextcache无效 [英] Invalidate kextcache after removing driver launchd plist file

查看:96
本文介绍了删除驱动程序启动的plist文件后,使kextcache无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的驱动程序创建了卸载程序,该卸载程序从/Library/LaunchDaemons 中删除了与其匹配的plist文件,因此在下一个引导周期中不会再次加载该文件.但是,它似乎对引导计算机后仍在正常加载的驱动程序没有任何影响.

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.

在对此事进行了一些研究之后,我发现 kextcache 是此行为的原因,为了清除/使之失效,我需要 touch 安装目标卷所在的文件夹.但是,它没有任何作用.

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.

我的问题是如何适当地使kext缓存无效,以便在删除对应的plist文件后,启动的不会加载kext.

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.

由于下面的回答,我使kext缓存无效.但是,我想拥有等效的权限来访问我的卸载程序帮助程序所基于的Objective-C中的现有文件夹.

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.

准确地说,这是我想转换为Objective-C的代码:

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

sudo touch/系统/库/扩展;sudo touch/库/扩展

推荐答案

使kext缓存无效的正确方法是

The proper way to invalidate the kext caches is

sudo touch /System/Library/Extensions

或在支持从/Library加载扩展名的OS版本中:

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

sudo touch /Library/Extensions

执行此操作后,将自动重新生成kext缓存.

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

这篇关于删除驱动程序启动的plist文件后,使kextcache无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆