In UEFI, there is a standard method for an operating system to indicate that the user wants to access the firmware setup at the next system reboot. Internally, Windows uses that standard method. As Austin Hemmelgarn said in his answer, this is done using the EFI variables.
#!/bin/sh
EFIVARFS=/sys/firmware/efi/efivars
EFI_OSINDSUPP=OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c
EFI_OSIND=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
if [ ! -d $EFIVARFS ]
then
echo "ERROR: no efivarfs present"
exit 72 # EX_OSFILE
fi
cd $EFIVARFS
if [ ! -f $EFI_OSINDSUPP ]
then
echo "ERROR: no support for EFI OsIndications"
exit 72 # EX_OSFILE
fi
FWSUP=$(od -An -t x4 $EFI_OSINDSUPP | cut -c 18)
case $FWSUP in
[02468ace])
echo "ERROR: no support for boot-to-fw-ui OsIndication" >&2
exit 69 # EX_UNAVAILABLE
;;
esac
# grab OsIndications header (4 bytes)
EFI_OSINDHDR=$(head -c 4 $EFI_OSIND)
printf '%s\x01\x00\x00\x00\x00\x00\x00\x00' "$EFI_OSINDHDR" > $EFI_OSIND
if [ $? -eq 0 ]
then
echo "Success. The system will boot to UEFI setup at next reboot."
exit 0 # EX_OK
else
echo "FAIL: could not update the OsIndications UEFI variable."
exit 69 # EX_UNAVAILABLE
fi