Skip to content

Dasharo Compatibility: Generic test setup

Test setup

Test setup is a set of procedures to be executed before the test execution. Typically, the same setup can be reused by multiple test cases, so there is no need to execute the setup actions before each independent case.

Generic test setup

Firmware

  1. Obtain FIRMWARE binary:
    1. you can download it from Releases page dedicated for your platform
    2. or you can build one yourself as shown in the Building manual page dedicated for platform which is used by you.
  2. Flash FIRMWARE binary to the DUT according to the instructions in docs.dasharo for your device.
    1. If the device already has Dasharo, see the Firmware update page
    2. If the device has a different firmware installed, see the Firmware transition page
    3. If the device is bricked, see the Recovery page.

OS installation

Install all the supported operating systems. In case the 'OPERATING_SYSTEM' is supported by Dasharo Preseeds use the instructions from there. Otherwise continue with the steps below:

OS installer
  1. Download an OPERATING_SYSTEM installer image
  2. Attach USB stick to the PC.
  3. Flash OPERATING_SYSTEM image to the USB stick.
  4. Attach the USB stick to the DUT.
Installing the OS
  1. Power on the DUT
  2. Enter the boot menu using the BIOS_SETUP_KEY.
  3. Select the Boot Menu and press Enter.
  4. Select the USB stick and press Enter.
    1. In case of the Ubuntu 22.04, select the Ubuntu (safe graphics) in the GRUB menu.
  5. Wait for the OPERATING_SYSTEM installer to start.
  6. Install OPERATING_SYSTEM on the disk.
  7. Power off the DUT.
  8. Remove the installation media (USB stick with installer).

OS Preparation

Logging in

If the OS was installed using the Dasharo Preseeds the hostname, username and password will be the same as in the OSFV repository. Make sure that the hostname, username and password are the same as in the OSFV repository in order for the automatic tests to run properly if the device already had the OS installed.

Windows

1.(Windows 11) Run PowerShell as an Administrator. 1. Install the OpenSSH Client

```powershell
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
```
  1. Install the OpenSSH Server

    Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
    
  2. Start the sshd service

    Start-Service sshd
    
  3. Make the sshd service start automatically on startup:

    Set-Service -Name sshd -StartupType 'Automatic'
    
  4. Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify

    if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
        Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
        New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
    } else {
        Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
    }
    
  5. If during connection via SSH you want to run PowerShell.exe instead of cmd.exe use below command:

    New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell \
        -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" \
        -PropertyType String -Force
    
  6. Sets the PowerShell execution policies for Windows computers.

    Set-ExecutionPolicy RemoteSigned
    
  7. Use powercfg.exe to control power plans to prevent sleep.

    Powercfg /Change standby-timeout-ac 0
    Powercfg /Change standby-timeout-dc 0
    
Linux
  1. Open the terminal.
  2. Disable the shutdown confirmation dialogues

    sudo gsettings set org.gnome.SessionManager logout-prompt false
    
  3. Set up a serial terminal:

    sudo nano /etc/default/grub
    
  4. Edit the file /etc/default/grub by adding console=tty0 console=ttyS0,115200 in variable GRUB_CMDLINE_LINUX_DEFAULT.

  5. Update grub

    sudo update-grub
    
  6. Configure SSH:

    sudo apt install openssh-server
    systemctl start sshd
    

NVIDIA drivers - Ubuntu

Only necessary if the device has an Nvidia GPU

  1. Power on the DUT.
  2. Wait until the OPERATING_SYSTEM boots from disk.
  3. Login into the OPERATING_SYSTEM.
  4. Open a terminal window.
  5. Search for the newest driver version
sudo apt update
sudo apt search nvidia-driver --names-only
  1. Install the newest driver (you might find a version higher than 560)
sudo apt install nvidia-driver-560
  1. A password prompt for secure boot configuration will appear. Choose a password (you can use your system password) and press Enter.
  2. Reboot the DUT.
  3. Upon entry into MOKUtil, select Enroll MOK and enter the password you chose during driver installation.
  4. Select the option Continue boot.
  5. Wait until the OPERATING_SYSTEM boots from disk.
  6. Login into the OPERATING_SYSTEM.
  7. Open the NVIDIA X Server Settings application.
  8. Open the PRIME Profiles section.
  9. Select NVIDIA On-demand and apply.
  10. Enter the OPERATING_SYSTEM password when prompted.

Post installation

  1. Look for an optional Post-Installation Setup document in the device's documentation at the Supported Hardware documentation and perform the instructions in it.

Special cases

Special cases are documented in Open Source Firmware Validation repo docs