mkimage.sh: add --efishell option

This commit is contained in:
Harald Hoyer 2018-09-14 11:48:24 +02:00
parent 04f270c58e
commit 55a963613d

View file

@ -17,12 +17,13 @@ EOF
TEMP=$( TEMP=$(
getopt -o '' \ getopt -o '' \
--long crypt \ --long crypt \
--long crypttpm2 \ --long crypttpm2 \
--long simple \ --long simple \
--long update \ --long update \
--long efishell \
--long help \ --long help \
-- "$@" -- "$@"
) )
if (( $? != 0 )); then if (( $? != 0 )); then
@ -36,25 +37,29 @@ unset TEMP
while true; do while true; do
case "$1" in case "$1" in
'--efishell')
USE_EFISHELL="y"
shift 1; continue
;;
'--crypt') '--crypt')
USE_CRYPT="y" USE_CRYPT="y"
shift 1; continue shift 1; continue
;; ;;
'--crypttpm2') '--crypttpm2')
USE_TPM="y" USE_TPM="y"
shift 1; continue shift 1; continue
;; ;;
'--simple') '--simple')
SIMPLE="y" SIMPLE="y"
shift 1; continue shift 1; continue
;; ;;
'--update') '--update')
UPDATE="y" UPDATE="y"
shift 1; continue shift 1; continue
;; ;;
'--help') '--help')
usage usage
exit 0 exit 0
;; ;;
'--') '--')
shift shift
@ -158,18 +163,20 @@ if ! [[ $UPDATE ]]; then
mkfs.fat -nEFI -F32 ${DEV_PART}1 mkfs.fat -nEFI -F32 ${DEV_PART}1
fi fi
mkdir "$MY_TMPDIR"/boot mkdir "$MY_TMPDIR"/boot
mount ${DEV_PART}1 "$MY_TMPDIR"/boot mount "${DEV_PART}1" "$MY_TMPDIR"/boot
mkdir -p "$MY_TMPDIR"/boot/EFI/Boot mkdir -p "$MY_TMPDIR"/boot/EFI/Boot
mkdir -p "$MY_TMPDIR"/boot/EFI/FedoraBook mkdir -p "$MY_TMPDIR"/boot/EFI/FedoraBook
if [[ -e "${SOURCE}"/Shell.efi ]] && [[ -e "${SOURCE}"/startup.nsh ]] && [[ -e "${SOURCE}"/LockDown.efi ]]; then
cp "${SOURCE}"/startup.nsh "$MY_TMPDIR"/boot/ if [[ $USE_EFISHELL ]]; then
cp "${SOURCE}"/LockDown.efi "$MY_TMPDIR"/boot/ [[ -e "${SOURCE}"/startup.nsh ]] && cp "${SOURCE}"/startup.nsh "$MY_TMPDIR"/boot/
[[ -e "${SOURCE}"/LockDown.efi ]] && cp "${SOURCE}"/LockDown.efi "$MY_TMPDIR"/boot/
cp "${SOURCE}"/Shell.efi "$MY_TMPDIR"/boot/EFI/Boot/bootx64.efi cp "${SOURCE}"/Shell.efi "$MY_TMPDIR"/boot/EFI/Boot/bootx64.efi
cp "$SOURCE"/bootx64.efi "$MY_TMPDIR"/boot/EFI/FedoraBook/bootx64.efi cp "$SOURCE"/bootx64.efi "$MY_TMPDIR"/boot/EFI/FedoraBook/bootx64.efi
else else
cp "$SOURCE"/bootx64.efi "$MY_TMPDIR"/boot/EFI/Boot/bootx64.efi cp "$SOURCE"/bootx64.efi "$MY_TMPDIR"/boot/EFI/Boot/bootx64.efi
fi fi
umount "$MY_TMPDIR"/boot umount "$MY_TMPDIR"/boot
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -179,7 +186,7 @@ dd if="$SOURCE"/root.img of=${DEV_PART}2 status=progress
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# data # data
if ! [[ $UPDATE ]]; then if ! [[ $UPDATE ]]; then
mkfs.xfs -L data ${DEV_PART}3 mkfs.xfs -L data "${DEV_PART}3"
fi fi
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# DONE # DONE