tiiuae / ghaf

TII SSRC Secure Technologies: Ghaf Framework
https://tiiuae.github.io/ghaf/
Apache License 2.0
35 stars 56 forks source link

Bump: flake.lock #703

Closed brianmcgillion closed 3 weeks ago

brianmcgillion commented 1 month ago

Description of changes

nix flake update to the latest versions of the inputs. Primarily focused on updating to the latest nixos-unstable

Checklist for things done

Testing

This needs to be tested on all platforms as it has considerable changes to the package versions

leivos-unikie commented 1 month ago

Test results on Lenovo-X1:

leivos-unikie commented 1 month ago

Tried to test if the shutdown issue would have been fixed but now lenovo-x1 boot fails:

IMG_2922

IMG_2923

Milla double checked and got the same result.

leivos-unikie commented 1 month ago

It turned out that

Failed to start Import ZFP pool "zfspool"

bug is from the mainline, not caused by this PR.

brianmcgillion commented 1 month ago

Test results on Lenovo-X1:

  • Reboot / Shutdown does not work properly. Display shuts down but the laptop still stays on very long (~1,5min).

This is fixed in the latest push.

leivos-unikie commented 1 month ago

Flashed USB SSD with https://github.com/tiiuae/ghaf/pull/713 Test results on Lenovo-X1:

milva-unikie commented 1 month ago

Tested on Orin-AGX, Orin-NX and Microchip

milva-unikie commented 1 month ago

Tested on Orin-NX-cross

[ghaf@ghaf-host:~]$ microvm -l
net-vm: current(nixos-system-net-vm-24.11pre-git), not booted: systemctl start microvm@net-vm.service

[ghaf@ghaf-host:~]$ sudo systemctl start microvm@net-vm.service

[ghaf@ghaf-host:~]$ sudo systemctl status microvm@net-vm.service
● microvm@net-vm.service - MicroVM 'net-vm'
     Loaded: loaded (/etc/systemd/system/microvm@.service; static)
    Drop-In: /nix/store/cwfx2pjghv1ghdq1ilj9fjx1sjnhd0f5-system-units/microvm@net-vm.service.d
             └─overrides.conf
     Active: activating (auto-restart) (Result: exit-code) since Fri 2024-07-05 18:05:48 UTC; 4s ago
 Invocation: 128d2da6d7244f558062939ba62afabd
    Process: 2184 ExecStartPre=/nix/store/f0m6kw07d5awvifii86d1ys44s63ly86-unit-script-microvm_-pre-start/bin/microvm_-pre-start (code=exited, status=0/SUCCES>
    Process: 2190 ExecStart=/var/lib/microvms/net-vm/current/bin/microvm-run (code=exited, status=203/EXEC)
    Process: 2194 ExecStopPost=/nix/store/p76i7dsjaqscmhwr845lggzcdlvksgic-unit-script-microvm_-post-stop/bin/microvm_-post-stop (code=exited, status=0/SUCCES>
   Main PID: 2190 (code=exited, status=203/EXEC)
         IP: 0B in, 0B out
        CPU: 140ms

I will check AGX-cross next.

milva-unikie commented 1 month ago

Tested on Orin-NX-cross

* Net-vm is not booted, in current mainline it is working normally.

* Manually starting net-vm does not work, it gets stuck at activating status.
[ghaf@ghaf-host:~]$ microvm -l
net-vm: current(nixos-system-net-vm-24.11pre-git), not booted: systemctl start microvm@net-vm.service

[ghaf@ghaf-host:~]$ sudo systemctl start microvm@net-vm.service

[ghaf@ghaf-host:~]$ sudo systemctl status microvm@net-vm.service
● microvm@net-vm.service - MicroVM 'net-vm'
     Loaded: loaded (/etc/systemd/system/microvm@.service; static)
    Drop-In: /nix/store/cwfx2pjghv1ghdq1ilj9fjx1sjnhd0f5-system-units/microvm@net-vm.service.d
             └─overrides.conf
     Active: activating (auto-restart) (Result: exit-code) since Fri 2024-07-05 18:05:48 UTC; 4s ago
 Invocation: 128d2da6d7244f558062939ba62afabd
    Process: 2184 ExecStartPre=/nix/store/f0m6kw07d5awvifii86d1ys44s63ly86-unit-script-microvm_-pre-start/bin/microvm_-pre-start (code=exited, status=0/SUCCES>
    Process: 2190 ExecStart=/var/lib/microvms/net-vm/current/bin/microvm-run (code=exited, status=203/EXEC)
    Process: 2194 ExecStopPost=/nix/store/p76i7dsjaqscmhwr845lggzcdlvksgic-unit-script-microvm_-post-stop/bin/microvm_-post-stop (code=exited, status=0/SUCCES>
   Main PID: 2190 (code=exited, status=203/EXEC)
         IP: 0B in, 0B out
        CPU: 140ms

I will check AGX-cross next.

Same issue with AGX-cross.

avnik commented 1 month ago

It turned out that

Failed to start Import ZFP pool "zfspool"

bug is from the mainline, not caused by this PR.

Does we use zfs at all?

avnik commented 1 month ago

Would try to bisect this.... Could I somehow extract logs from failing vm?

vunnyso commented 1 month ago

Would try to bisect this.... Could I somehow extract logs from failing vm?

ZFS partitioning scheme is now part of mainline ghaf details here. You can check logs here, please let me know if you need credentials.

leivos-unikie commented 1 month ago

Debugging cross compiled build on Orin AGX, booted from USB SSD.

This happens in journalctl -f when running sudo systemctl start microvm@net-vm.service

Aug 09 07:35:55 ghaf-host sudo[6596]:     ghaf : TTY=pts/0 ; PWD=/home/ghaf ; USER=root ; COMMAND=/run/current-system/sw/bin/systemctl start microvm@net-vm.service
Aug 09 07:35:55 ghaf-host sudo[6596]: pam_unix(sudo:session): session opened for user root(uid=0) by ghaf(uid=1000)
Aug 09 07:35:55 ghaf-host systemd[1]: Setup MicroVM 'net-vm' MACVTAP interfaces was skipped because of an unmet condition check (ConditionPathExists=/var/lib/microvms/net-vm/curr
ent/share/microvm/macvtap-interfaces).
Aug 09 07:35:55 ghaf-host systemd[1]: VirtioFS daemons for MicroVM 'net-vm' was skipped because of an unmet condition check (ConditionPathExists=/var/lib/microvms/net-vm/current/
share/microvm/virtiofs).

journalctl -f also shows repeating attempts to start net-vm (without running manually any commands)

Aug 09 07:35:24 ghaf-host systemd[1]: Starting MicroVM 'net-vm'...
Aug 09 07:35:24 ghaf-host systemd[1]: Started MicroVM 'net-vm'.
Aug 09 07:35:25 ghaf-host (rovm-run)[6391]: microvm@net-vm.service: Failed to execute /var/lib/microvms/net-vm/current/bin/microvm-run: Exec format error
Aug 09 07:35:25 ghaf-host (rovm-run)[6391]: microvm@net-vm.service: Failed at step EXEC spawning /var/lib/microvms/net-vm/current/bin/microvm-run: Exec format error
Aug 09 07:35:25 ghaf-host systemd[1]: microvm@net-vm.service: Main process exited, code=exited, status=203/EXEC
Aug 09 07:35:25 ghaf-host systemd[1]: 5:185m5:185mmicrovm@net-vm.service: Failed with result 'exit-code'.
Aug 09 07:35:25 ghaf-host kernel: virbr0: port 1(tap-net-vm) entered disabled state
Aug 09 07:35:26 ghaf-host systemd-networkd[924]: virbr0: Lost carrier

journalctl.log

leivos-unikie commented 3 weeks ago

Debugging cross compiled build on Orin AGX, booted from USB SSD.

This happens in journalctl -f when running sudo systemctl start microvm@net-vm.service

Aug 09 07:35:55 ghaf-host sudo[6596]:     ghaf : TTY=pts/0 ; PWD=/home/ghaf ; USER=root ; COMMAND=/run/current-system/sw/bin/systemctl start microvm@net-vm.service
Aug 09 07:35:55 ghaf-host sudo[6596]: pam_unix(sudo:session): session opened for user root(uid=0) by ghaf(uid=1000)
Aug 09 07:35:55 ghaf-host systemd[1]: Setup MicroVM 'net-vm' MACVTAP interfaces was skipped because of an unmet condition check (ConditionPathExists=/var/lib/microvms/net-vm/curr
ent/share/microvm/macvtap-interfaces).
Aug 09 07:35:55 ghaf-host systemd[1]: VirtioFS daemons for MicroVM 'net-vm' was skipped because of an unmet condition check (ConditionPathExists=/var/lib/microvms/net-vm/current/
share/microvm/virtiofs).

journalctl -f also shows repeating attempts to start net-vm (without running manually any commands)

Aug 09 07:35:24 ghaf-host systemd[1]: Starting MicroVM 'net-vm'...
Aug 09 07:35:24 ghaf-host systemd[1]: Started MicroVM 'net-vm'.
Aug 09 07:35:25 ghaf-host (rovm-run)[6391]: microvm@net-vm.service: Failed to execute /var/lib/microvms/net-vm/current/bin/microvm-run: Exec format error
Aug 09 07:35:25 ghaf-host (rovm-run)[6391]: microvm@net-vm.service: Failed at step EXEC spawning /var/lib/microvms/net-vm/current/bin/microvm-run: Exec format error
Aug 09 07:35:25 ghaf-host systemd[1]: microvm@net-vm.service: Main process exited, code=exited, status=203/EXEC
Aug 09 07:35:25 ghaf-host systemd[1]: 5:185m5:185mmicrovm@net-vm.service: Failed with result 'exit-code'.
Aug 09 07:35:25 ghaf-host kernel: virbr0: port 1(tap-net-vm) entered disabled state
Aug 09 07:35:26 ghaf-host systemd-networkd[924]: virbr0: Lost carrier

journalctl.log

Tested cross-compiled Orin AGX target again. Now net-vm is running, can be accessed. WiFi works too.