#! /usr/bin/sh

# Settings from /etc/sysconfig/filename are available as environment vars
# with the name 'SYS__FILENAME__KEY' (filename converted to upper case).
#
# Not all files are parsed, current list is:
#   bootloader, language
#

# include common functions
. "$PBL_INCLUDE/library"

err=0
if [ -x /usr/bin/sdbootutil ] ; then
  ( set -x ; sdbootutil install ) || err=1
else
  if [ -x /usr/bin/bootctl ] ; then
    ( set -x ; bootctl --make-machine-id-directory=yes install ) || err=1
  else
    echo "bootctl: command not found"
    err=1
  fi
fi

lib_efi_log_boot_entry

exit $err
