(isHostDriver bool, hostRoot string, driverInstallDir string, driverInstallDirCtrPath string)
| 39 | } |
| 40 | |
| 41 | func getDriverInfo(isHostDriver bool, hostRoot string, driverInstallDir string, driverInstallDirCtrPath string) driverInfo { |
| 42 | if isHostDriver { |
| 43 | return driverInfo{ |
| 44 | isHostDriver: true, |
| 45 | hostRoot: hostRoot, |
| 46 | driverRoot: hostRoot, |
| 47 | driverRootCtrPath: "/host", |
| 48 | devRoot: hostRoot, |
| 49 | devRootCtrPath: "/host", |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // For drivers not installed directly on the host, devRoot can either be |
| 54 | // hostRoot or driverInstallDir |
| 55 | var devRoot, devRootCtrPath string |
| 56 | devRoot = root(driverInstallDirCtrPath).getDevRoot() |
| 57 | if devRoot == "/" { |
| 58 | devRoot = hostRoot |
| 59 | devRootCtrPath = "/host" |
| 60 | } else { |
| 61 | devRoot = driverInstallDir |
| 62 | devRootCtrPath = "/driver-root" |
| 63 | } |
| 64 | |
| 65 | return driverInfo{ |
| 66 | isHostDriver: false, |
| 67 | hostRoot: hostRoot, |
| 68 | driverRoot: driverInstallDir, |
| 69 | driverRootCtrPath: "/driver-root", |
| 70 | devRoot: devRoot, |
| 71 | devRootCtrPath: devRootCtrPath, |
| 72 | } |
| 73 | } |
no test coverage detected