summaryrefslogtreecommitdiffstats
path: root/firmware/amd_seattle/runtest.sh
blob: b5b4323ffb3933491b064e1ee2ae41cd752e8e7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# Pass BIOS Name and location to get it from.

BIOS=${BIOS_NAME:-ROD0083B}

if [ -n "$LOCATION_URL" ]; then
    wget -O $BIOS $LOCATION/$BIOS
fi

reboot_to_efi_shell() {
    efishell=$(efibootmgr | grep 'Built-in EFI Shell' | cut -c5-8 | head -n 1)
    # set next boot to efi shell
    efibootmgr -n $efishell
    rhts-reboot
}

if [ -n "$RSTRNT_REBOOTCOUNT" ]; then
    if [ $RSTRNT_REBOOTCOUNT -eq 0 ]; then
        echo "Setup Firmware install"
        # copies firmware and startup.nsh to /boot/efi
        ./upBIOS $BIOS
        reboot_to_efi_shell
    else
        echo "Should not get here.."
    fi
fi