Commit 022bbe6a authored by Ophélie Gagnard's avatar Ophélie Gagnard

installation/:

- Stop copying the EFI directory.
- Fix the variables locating the EFI material.
parent 223fe903
...@@ -31,12 +31,12 @@ MCA_PACKAGE_URL=${URL_PATTERN}/${MCA_PACKAGE_FILE} ...@@ -31,12 +31,12 @@ MCA_PACKAGE_URL=${URL_PATTERN}/${MCA_PACKAGE_FILE}
FLUENTBIT_PACKAGE_URL=${URL_PATTERN}/${FLUENTBIT_PACKAGE_FILE} FLUENTBIT_PACKAGE_URL=${URL_PATTERN}/${FLUENTBIT_PACKAGE_FILE}
# used mainly in installation/install.sh and installation/uninstall.sh # used mainly in installation/install.sh and installation/uninstall.sh
SOURCE_EFI_DIR=/boot/efi/EFI/ EFI_PARTITION_MOUNT_POINT=/boot/efi/
TARGET_EFI_DIR=/EFI/ RELATIVE_EFI_IMAGE_DIR=/EFI/Linux/
SOURCE_EFI_DIR=`realpath -m $SOURCE_EFI_DIR` EFI_IMAGE_DIR=${EFI_PARTITION_MOUNT_POINT}/${RELATIVE_EFI_IMAGE_DIR}
TARGET_EFI_DIR=`realpath -m $TARGET_EFI_DIR` EFI_PARITITON_MOUNT_POINT=$(realpath -m $EFI_PARTITION_MOUNT_POINT)
SOURCE_IMAGE_DIR=$SOURCE_EFI_DIR/Linux/ RELATIVE_EFI_IMAGE_DIR=$(realpath -m $RELATIVE_EFI_IMAGE_DIR)
TARGET_IMAGE_DIR=$TARGET_EFI_DIR/Linux/ EFI_IMAGE_DIR=$(realpath -m $EFI_IMAGE_DIR)
dracut_output_file=dracut-output dracut_output_file=dracut-output
#TARGET_DISK=/dev/nvme1n1 #TARGET_DISK=/dev/nvme1n1
......
...@@ -40,7 +40,7 @@ get_partition_id () { ...@@ -40,7 +40,7 @@ get_partition_id () {
root_partition_type="Linux filesystem" root_partition_type="Linux filesystem"
efi_partition_type="EFI System" efi_partition_type="EFI System"
TARGET_EFI_PARTITION=$(get_partition_path "$efi_partition_type") EFI_PARTITION_MOUNT_POINT=$(get_partition_path "$efi_partition_type")
ROOT_PARTITION_ID=$(get_partition_id "$root_partition_type") ROOT_PARTITION_ID=$(get_partition_id "$root_partition_type")
default_boot_num=100 default_boot_num=100
...@@ -63,13 +63,13 @@ efibootmgr -b "$default_boot_num" -B || true ...@@ -63,13 +63,13 @@ efibootmgr -b "$default_boot_num" -B || true
rm -f $dracut_output_file rm -f $dracut_output_file
dracut -c ./dracut.module/dracut.conf --force |& tee -a $dracut_output_file dracut -c ./dracut.module/dracut.conf --force |& tee -a $dracut_output_file
# the next line parses dracut output and extracts the path of the newly generated image # the next line parses dracut output and extracts the path of the newly generated image
uefi_image_name=`grep "Creating image file" $dracut_output_file | sed -E "s|.*$SOURCE_IMAGE_DIR(.*)'.*|\1|g"` uefi_image_name=`grep "Creating image file" $dracut_output_file | sed -E "s|.*$EFI_IMAGE_DIR(.*)'.*|\1|g"`
# Why? The boot manager seems to forget the boot option if this is not done. # Why? The boot manager seems to forget the boot option if this is not done.
mkdir -p $TARGET_EFI_DIR #mkdir -p $TARGET_EFI_DIR
cp -rv $SOURCE_EFI_DIR/* $TARGET_EFI_DIR #cp -rv $SOURCE_EFI_DIR/* $TARGET_EFI_DIR
# Set the image as a boot option # Set the image as a boot option
efibootmgr -b "$default_boot_num" --create --disk $TARGET_EFI_PARTITION --label "test_deploy" --loader $TARGET_IMAGE_DIR/$uefi_image_name efibootmgr -b "$default_boot_num" --create --disk $EFI_PARTITION_MOUNT_POINT --label "test_deploy" --loader ${RELATIVE_EFI_IMAGE_DIR}/$uefi_image_name
echo "New initramfs image: "$TARGET_IMAGE_DIR/$uefi_image_name echo "New initramfs image: "${EFI_IMAGE_DIR}/$uefi_image_name
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment