/modules/04 # lsmod 
	test 787 0 - Live 0xbf010000 (PO)
	func 633 1 test, Live 0xbf00c000 (PO)		test -> func
			 ^ 引用计数
	/modules/04 # rmmod func					引用计数>0 不能卸载
	rmmod: remove 'func': Resource temporarily unavailable	

 	modprobe自动解决依赖:
	/ # modprobe test
	[  307.800000] test: Unknown symbol print (err 0)
	[  307.850000] hello kernel		<-- insmod func.ko ; insmod test.ko
	/ # lsmod 
	test 787 0 - Live 0xbf01c000 (PO)
	func 633 1 test, Live 0xbf018000 (PO)
	
	/ # modprobe -r func			<-- 引用计数>0 不能卸载
	modprobe: remove 'func': Resource temporarily unavailable
	/ # modprobe -r test			<-- rmmod test.ko ; rmmod func.ko
	[  363.130000] cleanup module

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐