KernelModuleUtils

public class KernelModuleUtils
extends Object

java.lang.Object
com.android.tradefed.util.KernelModuleUtils


요약

공개 생성자

KernelModuleUtils()

공개 메서드

static String[] getDependentModules(String modName, String lsmodOutput)

지정된 모듈이 종속된 모듈의 이름을 반환합니다.

static String getDisplayedModuleName(String fullPath)

로드 후 표시되는 모듈 이름을 반환합니다.

static CommandResult installModule(ITestDevice device, String modulePath, String arg, long timeoutMs)

지정된 기기에 커널 모듈을 설치합니다.

static String removeKoExtension(String s)

`.ko` 확장자가 있는 경우 삭제합니다.

static CommandResult removeModuleWithDependency(ITestDevice device, String moduleName)

지정된 기기에서 커널 모듈 및 종속 모듈을 삭제합니다.

static CommandResult removeSingleModule(ITestDevice device, String moduleName)

지정된 기기에서 커널 모듈을 삭제합니다.

공개 생성자

KernelModuleUtils

public KernelModuleUtils ()

공개 메서드

getDependentModules

public static String[] getDependentModules (String modName, 
                String lsmodOutput)

지정된 모듈이 종속된 모듈의 이름을 반환합니다.

예를 들어 지정된 모듈이 `kunit`이고 `lsmod` 출력이 다음과 같은 경우입니다.

$ lsmod
 Module        Size    Used by
 kunit_test    663552  0
 time_test     663558  0
 kunit         57344   15 kunit_test,time_test
 
그러면 이 메서드는 `kunit_test` 및 `time_test`가 포함된 배열을 반환합니다.

매개변수
modName String

lsmodOutput String

반환
String[]

getDisplayedModuleName

public static String getDisplayedModuleName (String fullPath)

로드 후 표시되는 모듈 이름을 반환합니다.

예를 들어 파일 이름과 `lsmod`에서 반환된 이름 간의 차이점을 확인하세요.

$ insmod kunit.ko
 $ lsmod | grep kunit
 kunit 20480 0
 

매개변수
fullPath String

반환
String

installModule

public static CommandResult installModule (ITestDevice device, 
                String modulePath, 
                String arg, 
                long timeoutMs)

지정된 기기에 커널 모듈을 설치합니다.

매개변수
device ITestDevice: 모듈을 설치할 기기

modulePath String: 설치할 모듈의 경로

arg String: 설치 명령어에 전달할 인수

timeoutMs long: 시간 제한(밀리초)

반환
CommandResult

생성 값
DeviceNotAvailableException 기기를 사용할 수 없는 경우
TargetSetupError 모듈을 설치할 수 없는 경우

removeKoExtension

public static String removeKoExtension (String s)

`.ko` 확장자가 있는 경우 삭제합니다.

매개변수
s String

반환
String

removeModuleWithDependency

public static CommandResult removeModuleWithDependency (ITestDevice device, 
                String moduleName)

지정된 기기에서 커널 모듈 및 종속 모듈을 삭제합니다.

이 메서드는 기기에서 타겟 커널 모듈을 삭제하려고 시도합니다. 모듈에 종속 항목이 있는 경우 타겟 모듈 전에 종속 모듈이 최대한 삭제됩니다.

매개변수
device ITestDevice: 모듈을 삭제할 기기

moduleName String: 삭제할 모듈의 이름

반환
CommandResult

생성 값
DeviceNotAvailableException 기기를 사용할 수 없는 경우

removeSingleModule

public static CommandResult removeSingleModule (ITestDevice device, 
                String moduleName)

지정된 기기에서 커널 모듈을 삭제합니다.

이 메서드는 기기에서 타겟 커널 모듈을 삭제하려고 시도합니다. 종속 모듈은 삭제되지 않습니다.

매개변수
device ITestDevice: 모듈을 삭제할 기기

moduleName String: 삭제할 모듈의 이름

반환
CommandResult

생성 값
DeviceNotAvailableException 기기를 사용할 수 없는 경우