#!/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() { bootorder=$(efibootmgr | grep 'BootOrder' | awk '{ print $2 }') # This job will end up aborting.. Next time the system is power cycled # we will boot from the wrong device. restore the correct boot order and # reboot again. echo "efibootmgr -o 0004,0005,0002,0003,0001" >> /etc/rc.d/rc.local echo "sleep 5" >> /etc/rc.d/rc.local echo "reboot" >> /etc/rc.d/rc.local chmod +x /etc/rc.d/rc.local efishell=$(efibootmgr | grep 'Built-in EFI Shell' | cut -c5-8 | head -n 1) # set next boot to efi shell efibootmgr -n $efishell shutdown -r now } 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 # This will never actually happen.. rstrnt-report-result $RSTRNT_TASKNAME PASS fi fi