From 21550e3ab9c73b8509df371d47e2af4b9441d14c Mon Sep 17 00:00:00 2001 From: mikatammi Date: Thu, 28 Sep 2023 13:10:54 +0000 Subject: [PATCH] deploy: 7fd351b3834d9450218ef8c72a8e897e80c14735 --- 404.html | 2 +- appendices/contributing_general.html | 2 +- appendices/glossary.html | 2 +- architecture/adr.html | 2 +- architecture/adr/minimal-host.html | 2 +- architecture/adr/netvm.html | 2 +- .../adr/platform-bus-passthrough-support.html | 2 +- architecture/architecture.html | 2 +- architecture/stack.html | 2 +- architecture/variants.html | 2 +- features/features.html | 2 +- index.html | 2 +- print.html | 145 +++++++++- ref_impl/build_and_run.html | 6 +- ref_impl/creating_appvm.html | 2 +- ref_impl/cross_compilation.html | 6 +- ref_impl/development.html | 2 +- ref_impl/example_project.html | 2 +- ref_impl/ghaf-based-project.html | 2 +- ref_impl/installer.html | 257 ++++++++++++++++++ ref_impl/modules_options.html | 89 +++++- ref_impl/reference_implementations.html | 2 +- release_notes/ghaf-23.05.html | 2 +- release_notes/ghaf-23.06.html | 2 +- release_notes/release_notes.html | 2 +- research/passthrough/ethernet.html | 2 +- research/research.html | 2 +- scenarios/run_cuttlefish.html | 2 +- scenarios/run_win_vm.html | 2 +- scenarios/showcases.html | 2 +- scs/basics.html | 2 +- scs/ghaf-security-fix-automation.html | 2 +- scs/pki.html | 2 +- scs/sbom.html | 2 +- scs/scs.html | 2 +- scs/slsa-framework.html | 2 +- searchindex.js | 2 +- searchindex.json | 2 +- technologies/compartment.html | 2 +- technologies/hypervisor_options.html | 2 +- technologies/nvidia_agx_pt_pcie.html | 2 +- technologies/nvidia_agx_pt_uart.html | 2 +- technologies/passthrough.html | 2 +- technologies/technologies.html | 2 +- technologies/vfio.html | 2 +- technologies/x86_pcie_crosvm.html | 2 +- 46 files changed, 536 insertions(+), 49 deletions(-) create mode 100644 ref_impl/installer.html diff --git a/404.html b/404.html index 42145dac0..6782c9fdd 100644 --- a/404.html +++ b/404.html @@ -84,7 +84,7 @@ diff --git a/appendices/contributing_general.html b/appendices/contributing_general.html index e37a6b1be..e78f3bbb7 100644 --- a/appendices/contributing_general.html +++ b/appendices/contributing_general.html @@ -83,7 +83,7 @@ diff --git a/appendices/glossary.html b/appendices/glossary.html index 9a4415d32..d65dbdff0 100644 --- a/appendices/glossary.html +++ b/appendices/glossary.html @@ -83,7 +83,7 @@ diff --git a/architecture/adr.html b/architecture/adr.html index 1237d1c5c..d0b4f0c72 100644 --- a/architecture/adr.html +++ b/architecture/adr.html @@ -83,7 +83,7 @@ diff --git a/architecture/adr/minimal-host.html b/architecture/adr/minimal-host.html index 421a55296..fd855b47e 100644 --- a/architecture/adr/minimal-host.html +++ b/architecture/adr/minimal-host.html @@ -83,7 +83,7 @@ diff --git a/architecture/adr/netvm.html b/architecture/adr/netvm.html index ffb63fa7c..04150c56d 100644 --- a/architecture/adr/netvm.html +++ b/architecture/adr/netvm.html @@ -83,7 +83,7 @@ diff --git a/architecture/adr/platform-bus-passthrough-support.html b/architecture/adr/platform-bus-passthrough-support.html index eff3a2c6a..c07bc04a5 100644 --- a/architecture/adr/platform-bus-passthrough-support.html +++ b/architecture/adr/platform-bus-passthrough-support.html @@ -83,7 +83,7 @@ diff --git a/architecture/architecture.html b/architecture/architecture.html index 1b830d1fd..9e0d9cd9c 100644 --- a/architecture/architecture.html +++ b/architecture/architecture.html @@ -83,7 +83,7 @@ diff --git a/architecture/stack.html b/architecture/stack.html index b7c35747d..2fd185f83 100644 --- a/architecture/stack.html +++ b/architecture/stack.html @@ -83,7 +83,7 @@ diff --git a/architecture/variants.html b/architecture/variants.html index 49075068c..0a7b9921e 100644 --- a/architecture/variants.html +++ b/architecture/variants.html @@ -83,7 +83,7 @@ diff --git a/features/features.html b/features/features.html index 9b96d5c50..4c6311834 100644 --- a/features/features.html +++ b/features/features.html @@ -83,7 +83,7 @@ diff --git a/index.html b/index.html index 983a59bd9..7839b7e2c 100644 --- a/index.html +++ b/index.html @@ -83,7 +83,7 @@ diff --git a/print.html b/print.html index 7f1e806c5..b109cafa9 100644 --- a/print.html +++ b/print.html @@ -84,7 +84,7 @@ @@ -771,6 +771,62 @@

Installer

+

Configuring and Building Installer for Ghaf

+

You can obtain the installation image for your Ghaf configuration. To check possible configuration options, see Modules Options.

+
    +
  1. Set ghaf.installer.enable to true.
  2. +
  3. Add nixos-generators module to ghaf.installer.imgModules list to configure installer image type.
  4. +
  5. Choose installer modules from ghaf.installer.installerModules and set ghaf.installer.enabledModules to list of their names.
  6. +
  7. Write code for the installer in ghaf.installer.installerCode.
  8. +
+
{config, ...}: {
+  ghaf.installer = {
+    enable = true;
+    imgModules = [
+      nixos-generators.nixosModules.raw-efi
+    ];
+    enabledModules = ["flushImage"];
+    installerCode = ''
+      echo "Starting flushing..."
+      if sudo dd if=${config.system.build.${config.formatAttr}} of=/dev/${config.ghaf.installer.installerModules.flushImage.providedVariables.deviceName} conv=sync bs=4K status=progress; then
+          sync
+          echo "Flushing finished successfully!"
+          echo "Now you can detach installation device and reboot to Ghaf."
+      else
+          echo "Some error occured during flushing process, exit code: $?."
+          exit
+      fi
+    '';
+  };
+}
+
+

After that you can build an installer image using this command:

+
nix build .#nixosConfigurations.<CONFIGURATION>.config.system.build.installer
+
+

Adding Installer Modules

+

To add an installer module, replace the corresponding placeholders with your code and add this to your configuraiton:

+
ghaf.installer.installerModules.<MODULE_NAME> = {
+  requestCode = ''
+    # Your request code written in Bash
+  '';
+  providedVariables = {
+    # Notice the dollar sign before the actual variable name in Bash.
+    <VARIABLE_NAME> = "$<VARIABLE_NAME>";
+  };
+};
+
+

Built-in Installer Modules

+

Provided variables show variable names in Nix. For actual names of variables in Bash, see the sources of the module.

+

flushImage

+

Provided variables:

+ +

Cross-Compilation

Cross-compilation is currently under development and cannot be used properly on all the supported device configurations.

@@ -1218,6 +1274,81 @@

https://github.com/tiiuae/ghaf/blob/main/modules/host/networking.nix +

ghaf.installer.enable

+

Whether to enable installer image.

+

Type: +boolean

+

Default: +false

+

Example: +true

+

Declared by:

+ +

ghaf.installer.enabledModules

+

Sequence of enabled modules.

+

Type: +list of string

+

Default: +[ ]

+

Declared by:

+ +

ghaf.installer.imgModules

+

Modules that will be passed to the installer image.

+

Type: +list of module

+

Default: +[ ]

+

Declared by:

+ +

ghaf.installer.installerCode

+

Code that will install image based on the information +collected from the installer modules.

+

All code must be written for the current pkgs.runtimeShell.

+

Type: +strings concatenated with “\n”

+

Default: +""

+

Declared by:

+ +

ghaf.installer.installerModules

+

Modules describe the information requested from the user +for the installer.

+

All code must be written for the current pkgs.runtimeShell.

+

Type: +attribute set of (submodule)

+

Declared by:

+ +

ghaf.installer.installerModules.<name>.providedVariables

+

Variable that this modules provides. +Used to detect errors with non-existent variables.

+

Type: +attribute set of string

+

Default: +{ }

+

Declared by:

+ +

ghaf.installer.installerModules.<name>.requestCode

+

Code that will ask user their preferences.

+

Type: +strings concatenated with “\n”

+

Default: +"echo \"Here's should be your installer\""

+

Declared by:

+

ghaf.profiles.applications.enable

Whether to enable Some sample applications.

Type: @@ -1254,6 +1385,18 @@

https://github.com/tiiuae/ghaf/blob/main/modules/profiles/graphics.nix +

ghaf.profiles.installer.enable

+

Whether to enable installer profile.

+

Type: +boolean

+

Default: +false

+

Example: +true

+

Declared by:

+

ghaf.profiles.release.enable

Whether to enable release profile.

Type: diff --git a/ref_impl/build_and_run.html b/ref_impl/build_and_run.html index 02d63336c..7b10a2da6 100644 --- a/ref_impl/build_and_run.html +++ b/ref_impl/build_and_run.html @@ -83,7 +83,7 @@

@@ -361,7 +361,7 @@

- @@ -375,7 +375,7 @@

- diff --git a/ref_impl/creating_appvm.html b/ref_impl/creating_appvm.html index 7e971d9d1..102272504 100644 --- a/ref_impl/creating_appvm.html +++ b/ref_impl/creating_appvm.html @@ -83,7 +83,7 @@ diff --git a/ref_impl/cross_compilation.html b/ref_impl/cross_compilation.html index 71db3bd88..628f55ecd 100644 --- a/ref_impl/cross_compilation.html +++ b/ref_impl/cross_compilation.html @@ -83,7 +83,7 @@ @@ -183,7 +183,7 @@

b