|
1 | 1 | fn install_message() {
|
2 |
| - info("memflow-kvm kernel module installation finished"); |
3 |
| - info("you might have to manually invoke 'modprobe memflow' after installation and make sure the /dev/memflow device is present and you have access to it."); |
4 |
| - info("it is also recommended to setup a 'memflow' user group in linux and add your user to it"); |
5 |
| - info("additionally, you might want to setup a udev rule thatll make /dev/memflow accessible to that group."); |
6 |
| - info("see the readme for more details"); |
| 2 | + info("memflow-kvm kernel module installation finished"); |
| 3 | + info("you might have to manually invoke 'modprobe memflow' after installation and make sure the /dev/memflow device is present and you have access to it."); |
| 4 | + info("it is also recommended to setup a 'memflow' user group in linux and add your user to it"); |
| 5 | + info("additionally, you might want to setup a udev rule thatll make /dev/memflow accessible to that group."); |
| 6 | + info("see the readme for more details"); |
7 | 7 | }
|
8 | 8 |
|
9 | 9 | // builds the connector from a given path (never called by the engine directly)
|
10 | 10 | fn build_from_path(ctx, repo_path) {
|
11 |
| - info("Installing connector"); |
12 |
| - cargo("build --release --all-features", repo_path); |
13 |
| - ctx.copy_cargo_plugin_artifact(repo_path, name_to_lib(ctx.crate_name())); |
| 11 | + info("Installing connector"); |
| 12 | + cargo("build --release --all-features", repo_path); |
| 13 | + ctx.copy_cargo_plugin_artifact(repo_path, name_to_lib(ctx.crate_name())); |
14 | 14 |
|
15 |
| - info("Installing memflow-kvm kernel module"); |
16 |
| - ctx.dkms_install(repo_path); |
| 15 | + info("Installing memflow-kvm kernel module"); |
| 16 | + ctx.dkms_install(repo_path); |
17 | 17 |
|
18 |
| - post_install(); |
| 18 | + post_install(); |
19 | 19 |
|
20 |
| - install_message(); |
| 20 | + install_message(); |
21 | 21 | }
|
22 | 22 |
|
23 | 23 | // builds the connector from local path
|
24 | 24 | fn build_local(ctx) {
|
25 |
| - build_from_path(ctx, ctx.build_path()) |
| 25 | + build_from_path(ctx, ctx.build_path()) |
26 | 26 | }
|
27 | 27 |
|
28 | 28 | fn get_source(ctx) {
|
29 |
| - ctx.clone_repository() |
| 29 | + // clone the repository with all submodules via git |
| 30 | + ctx.clone_repository() |
30 | 31 | }
|
31 | 32 |
|
32 | 33 | // builds the connector from source
|
33 | 34 | fn build_from_source(ctx) {
|
34 |
| - build_from_path(ctx, get_source(ctx)) |
| 35 | + build_from_path(ctx, get_source(ctx)) |
35 | 36 | }
|
36 | 37 |
|
37 | 38 | // downloads a binary release of the plugin, still needs dkms
|
38 | 39 | fn install(ctx) {
|
39 |
| - let release = ctx.github_latest_release(); |
40 |
| - let libname = name_to_lib_with_arch(ctx.crate_name()); |
41 |
| - let artifact = download(ctx.github_release_artifact(release, libname)); |
42 |
| - write_plugin_artifact(artifact); |
| 40 | + let libname = name_to_lib_with_arch(ctx.crate_name()); |
| 41 | + let artifact = ctx.github_release_artifact(libname); |
| 42 | + ctx.write_plugin_artifact(artifact, name_to_lib(ctx.crate_name())); |
43 | 43 |
|
44 |
| - info("Installing memflow-kvm kernel module"); |
45 |
| - let tarball = download(ctx.github_release_artifact(release, "memflow-" + release.semver() + "-source-only.dkms.tar.gz")); |
46 |
| - ctx.dkms_install(tarball); |
| 44 | + info("Installing memflow-kvm kernel module"); |
| 45 | + let tarball = download(ctx.github_release_artifact(release, "memflow-" + release.semver() + "-source-only.dkms.tar.gz")); |
| 46 | + ctx.dkms_install(tarball); |
47 | 47 |
|
48 |
| - post_install(); |
| 48 | + post_install(); |
49 | 49 |
|
50 |
| - install_message(); |
| 50 | + install_message(); |
51 | 51 | }
|
52 | 52 |
|
53 | 53 | fn post_install() {
|
54 |
| - try { |
55 |
| - udev_add_rule("memflow-kvm", "KERNEL==\"memflow\" SUBSYSTEM==\"misc\" GROUP=\"memflow\" MODE=\"0660\""); |
56 |
| - } catch (err) { |
57 |
| - info("Your memflowup installation might be out of date, please make sure to use the latest version.") |
58 |
| - } |
| 54 | + try { |
| 55 | + udev_add_rule("memflow-kvm", "KERNEL==\"memflow\" SUBSYSTEM==\"misc\" GROUP=\"memflow\" MODE=\"0660\""); |
| 56 | + } catch (err) { |
| 57 | + info("Your memflowup installation might be out of date, please make sure to use the latest version.") |
| 58 | + } |
59 | 59 | }
|
0 commit comments