2021-07-13 17:32:30 +08:00
|
|
|
|
Param([Parameter(Mandatory=$true)][String]$CodeName)
|
|
|
|
|
Set-Location -Path (Split-Path -Parent $MyInvocation.MyCommand.Definition)
|
|
|
|
|
$Configs="definitions"
|
|
|
|
|
$DefConfig="sdm845-generic"
|
|
|
|
|
$Config=Join-Path `
|
|
|
|
|
-Path $Configs `
|
|
|
|
|
-ChildPath (-Join ($CodeName,".txt"))
|
|
|
|
|
If( -Not (Test-Path -Path $Config)){
|
2021-07-27 00:10:01 +08:00
|
|
|
|
Write-Output "ERROR: your model has no definition file, please check"
|
|
|
|
|
exit 1
|
2021-07-13 17:32:30 +08:00
|
|
|
|
}
|
|
|
|
|
If(Test-Path -Path output){
|
|
|
|
|
Remove-Item `
|
|
|
|
|
-Recurse `
|
|
|
|
|
-Force `
|
|
|
|
|
-Path output
|
|
|
|
|
}
|
2021-07-18 22:12:01 +08:00
|
|
|
|
Write-Output "copying drivers..."
|
2021-07-13 17:32:30 +08:00
|
|
|
|
$Output=New-Item `
|
|
|
|
|
-ItemType Directory `
|
|
|
|
|
-Path output
|
|
|
|
|
Get-Content `
|
|
|
|
|
-Path $Config | `
|
|
|
|
|
Copy-Item `
|
2021-07-18 22:39:20 +08:00
|
|
|
|
-Force `
|
2021-07-13 17:32:30 +08:00
|
|
|
|
-Recurse `
|
|
|
|
|
-Path { "."+$_ } `
|
|
|
|
|
-Destination $Output
|
2021-07-18 22:12:01 +08:00
|
|
|
|
Write-Output "rename drivers..."
|
2021-07-13 17:32:30 +08:00
|
|
|
|
Get-ChildItem `
|
|
|
|
|
-Recurse `
|
|
|
|
|
-Path $Output `
|
|
|
|
|
-Filter *.inf_ | `
|
2021-07-18 22:12:01 +08:00
|
|
|
|
Rename-Item `
|
|
|
|
|
-NewName { `
|
|
|
|
|
$_.FullName `
|
|
|
|
|
-Replace '\.inf_','.inf' `
|
|
|
|
|
}
|
|
|
|
|
Write-Output "done"
|
|
|
|
|
|