#!/bin/bash
echo ''
echo 'Alder and Raptor Lake BIOS updater - Linux 64 bit Version'
echo ''

if [ "$(id -u)" != "0" ]; then
   echo ''
   echo 'This script must be run as root'
   echo ''
   exit 1
fi

if [ -z "$1" ] || [ ! -f $1 ];then
  echo ''
  echo 'Please enter the BIOS file parameter : ./bios_update_x64.sh <official_bios.xxx> '
  echo ''
  exit 1
fi
chmod +x EtaAfuOemLnx64
./EtaAfuOemLnx64 $1 /DESC /EC /GBE /ME /PADDING0 /N /NB /OA /P /NETWORK /AB /FSPS /FSPM /FSPT /B /DATABACKUP /DATA /BB1BACKUP /BB1 /ABU /FSPSU /FSPTU /BBU

if [ $? -eq 0 ] ; then
	echo ""
	echo "Please power off and reboot the system to use the new updated BIOS"
	echo ""
fi
