Add support for deploying eBPF to arbitrary filesystem locations (#1995)
* add support for deploying ebpf to arbitrary filesystem locations * fix typo * add documentation * fix coding style
This commit is contained in:
Родитель
27fee383cd
Коммит
c556b4dfae
|
@ -71,6 +71,10 @@ has already built the binaries for `x64/Debug` or `x64/Release`.
|
|||
```ps
|
||||
.\x64\debug\deploy-ebpf --vm="<test-vm-name>" -t
|
||||
```
|
||||
or, to copy files to a specific directory, including file shares, run:
|
||||
```ps
|
||||
.\x64\debug\deploy-ebpf -l="c:\some\path"
|
||||
```
|
||||
|
||||
2. From within the VM, install the binaries by starting an administrator Command Prompt shell (cmd.exe)
|
||||
, and running the following commands:
|
||||
|
|
|
@ -179,7 +179,7 @@ OVERVIEW:
|
|||
|
||||
Copies eBPF framework files into a temp directory on the local machine or into a VM
|
||||
|
||||
$ deploy-ebpf [--dir="..."] [-h] [-l] [-m] [-t] [--vm="..."]
|
||||
$ deploy-ebpf [--dir="..."] [-h] [-l[=path]] [-m] [-t] [--vm="..."]
|
||||
|
||||
OPTIONS:
|
||||
--dir Specifies the source directory path, which defaults to "."
|
||||
|
@ -202,8 +202,11 @@ OPTIONS:
|
|||
$vm=($arg -split "=")[1];
|
||||
break
|
||||
}
|
||||
{ @("-l", "--local") -contains $_ }
|
||||
"^(?:-l|--list)(?:=(.+))?$"
|
||||
{
|
||||
if ($matches[1]) {
|
||||
$destination_directory = $matches[1]
|
||||
}
|
||||
Clear-Variable -name vm
|
||||
break
|
||||
}
|
||||
|
@ -234,22 +237,24 @@ if ($vm -eq $null) {
|
|||
foreach ( $file in $built_files ) {
|
||||
$source_path = "$build_directory\$file"
|
||||
$destination_path = "$destination_directory\$file"
|
||||
$destination_full_directory = Split-Path $destination_path
|
||||
Write-Host " $source_path -> $destination_path"
|
||||
Copy-Item "$source_path" -Destination "$destination_path"
|
||||
if (! $?) {
|
||||
exit 1
|
||||
if (! (Test-Path $destination_full_directory)) {
|
||||
New-Item -Type Directory $destination_full_directory -ErrorAction Stop | Write-Verbose
|
||||
}
|
||||
Copy-Item "$source_path" -Destination "$destination_path" -ErrorAction Stop
|
||||
}
|
||||
|
||||
Write-Host "Copying files from `"$source_directory`" to `"$destination_directory`""
|
||||
foreach ( $file in $source_files ) {
|
||||
$source_path = "$source_directory\$file"
|
||||
$destination_path = "$destination_directory\$file"
|
||||
$destination_full_directory = Split-Path $destination_path
|
||||
Write-Host " $source_path -> $destination_path"
|
||||
Copy-Item "$source_path" -Destination "$destination_path"
|
||||
if (! $?) {
|
||||
exit 1
|
||||
if (! (Test-Path $destination_full_directory)) {
|
||||
New-Item -Type Directory $destination_full_directory -ErrorAction Stop | Write-Verbose
|
||||
}
|
||||
Copy-Item "$source_path" -Destination "$destination_path" -ErrorAction Stop
|
||||
}
|
||||
exit 0
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче