diff options
author | Bill Peck <bpeck@redhat.com> | 2015-09-18 13:07:19 -0400 |
---|---|---|
committer | Bill Peck <bpeck@redhat.com> | 2015-09-18 13:07:19 -0400 |
commit | bd58f608263c4897fcf1e97c7ac3779ee7f3e081 (patch) | |
tree | b7914125edddafe6ee9f391c9b898dd871abda9e | |
parent | 50f42d9c9e82ad672d51e94d1b8f93dbf79b1d77 (diff) | |
download | tests-bd58f608263c4897fcf1e97c7ac3779ee7f3e081.tar.gz tests-bd58f608263c4897fcf1e97c7ac3779ee7f3e081.tar.xz tests-bd58f608263c4897fcf1e97c7ac3779ee7f3e081.zip |
New task to update AMD Seattle firmware from beaker/restraint
-rw-r--r-- | firmware/amd_seattle/ROD0083B.zip | bin | 0 -> 3229414 bytes | |||
-rw-r--r-- | firmware/amd_seattle/metadata | 13 | ||||
-rw-r--r-- | firmware/amd_seattle/runtest.sh | 27 | ||||
-rw-r--r-- | firmware/amd_seattle/upBIOS | 181 |
4 files changed, 221 insertions, 0 deletions
diff --git a/firmware/amd_seattle/ROD0083B.zip b/firmware/amd_seattle/ROD0083B.zip Binary files differnew file mode 100644 index 0000000..cd936c7 --- /dev/null +++ b/firmware/amd_seattle/ROD0083B.zip diff --git a/firmware/amd_seattle/metadata b/firmware/amd_seattle/metadata new file mode 100644 index 0000000..b41e9a2 --- /dev/null +++ b/firmware/amd_seattle/metadata @@ -0,0 +1,13 @@ +[General] +name=/firmware/update/amd_seattle +owner=Bill Peck <bpeck@redhat.com> +description=Used to automatically upgrade firmware on amd seattle systems +license=GPLv2 +confidential=no +destructive=no + +[restraint] +entry_point=./runtest.sh +dependencies=coreutils +max_time=2h +#repoRequires=restraint/sanity/common diff --git a/firmware/amd_seattle/runtest.sh b/firmware/amd_seattle/runtest.sh new file mode 100644 index 0000000..b5b4323 --- /dev/null +++ b/firmware/amd_seattle/runtest.sh @@ -0,0 +1,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 diff --git a/firmware/amd_seattle/upBIOS b/firmware/amd_seattle/upBIOS new file mode 100644 index 0000000..d782cb5 --- /dev/null +++ b/firmware/amd_seattle/upBIOS @@ -0,0 +1,181 @@ +#!/bin/bash + +# Description : This script will copy and setup the ROM to be +# flashed on next boot. +# +# +# Create Date : Thu Nov 13 13:16:11 PST 2014 +# +# Author : Kim Naru (kim.naru@amd.com) +# +# Bug Fixs : +# +# +#Thu Sep 10 15:02:32 PDT 2015 +# Improved usage message. More error checking. SsiFalshARM64.EFI check +# was in the wrong spot, fixed. +# +# Mon Aug 31 18:10:19 EDT 2015 +# Do not assume SsiFlashARM64.EFI is in the EFI dir. Copy +# it over. +# +# Mon Apr 13 12:43:37 PDT 2015 +# Cleaned up comments and fixed a bug. +# Mon Apr 13 12:43:37 PDT 2015 +# +# Thu Apr 9 11:58:55 EDT 2015 +# Changed named from go72 upBIOS which is more generic. Also +# since the location of the rom file changes on weekly needed +# to change paths +# +# Fri Nov 14 14:39:55 PST 2014 +# Was not getting the right path to efi grub command. +# Fixed for Fedora and Acadia +# +# +# +# NOTE: If a zip file has a name similar the following +# +# Overdrive_AMI_UEFI-VerROD0084E_0378-NDA.zip +# +# then you will first have to unzip it before running this script. The reason +# being there is a zip file within a zip file. + +bios=$1 +file="$bios" +zipFile="$file.zip" +#romFile="./$file/Binaries/$bios.rom" +romFile="./$bios.rom" +logFile="./$bios.log" +efiDir="/boot/efi" +osrel="/etc/os-release" +unzip="/usr/bin/unzip" + +if [ $# -ne 1 ] +then + echo "Usage : $0 BIOS" + echo "Example: If the BIOS version is ROD0084E then: $0 ROD0084E" + exit 1 +fi + +if [ ! -f "$zipFile" ] +then + echo "$zipFile is missing exiting..." + exit 2 +fi + + +grep -i red $osrel > /dev/null 2>&1 +status=$? + +if [ $status -eq 0 ] +then + # Acadia + grub="FS0:\EFI\redhat\grubaa64.efi" +fi + +grep -i fedora $osrel > /dev/null 2>&1 +status=$? +if [ $status -eq 0 ] +then + # Fedora + grub="FS0:\EFI\fedora\grubaa64.efi" +fi + + +SsiFlash="FS0:\SsiFlashARM64.EFI FS0:\\$romFile /U " + + +if [ ! -f $unzip ] +then + echo "$unzip is missing,installing..." + yum install unzip +fi + + +if [ ! -f $zipFile ] +then + echo "[$zipFile] not found..exiting" + echo + exit 3 +else + # If files exist unzip prompts which we do not want + /bin/rm -f SsiFlashARM64.EFI + /bin/rm -f $romFile + /bin/rm -f $logFile + $unzip $zipFile > /dev/null 2>&1 +fi + +# Force copy the utility. +if [ ! -f SsiFlashARM64.EFI ] +then + echo "SsiFlashARM64.EFI is missing exiting..." + exit 4 +else + cp -f SsiFlashARM64.EFI $efiDir +fi + + +if [ ! -f $romFile ] +then + echo "[$romFile] not found..exiting" + echo + exit 5 +fi + +if [ ! -d $efiDir ] +then + echo "[/boot/efi] does not exist..exiting\n" + echo + exit 6 +fi + +cp $romFile $efiDir +echo "Copied $romFile to $efiDir" +rm -f $efiDir/flashed + +#backup original startup.nsh. + +if [ -f $efiDir/startup.nsh ] +then + cp $efiDir/startup.nsh $efiDir/startup.nsh.bak +fi + +# ----------------------------------------------------------------- +# Create UEFI boot script startup.nsh based on variables above +# and place it in the UEFI partition. +# ----------------------------------------------------------------- +cat << EOF > $efiDir/startup.nsh +# If fs0:\flashed doesn't exit it will assume the system needs to be flashed. +# Subsequent boots will not reflash. To force a reflash do : +# del fs0:\flashed. +# +# kim naru(kim.naru@amd.com) +# `date` + +@echo -off + +if exist fs0:\flashed then +echo System has already been flashed with $bios +goto FOUND +endif + +echo Flashing system with $bios. +$SsiFlash +echo $bios > fs0:\flashed +echo Flashing completed. + +:REBOOT +echo "System has been flashed. Please power cycle." +goto END + +:FOUND +$grub + +:END +EOF +echo "Installation complete, please reboot your system. " +echo +# ----------------------------------------------------------------- +# End +# ----------------------------------------------------------------- |