Skip to content

Commit

Permalink
install: manually create custom grub file
Browse files Browse the repository at this point in the history
    - Some firmware will make bootup stuck on the grub about 30 minutes.
      We could manually create these files to avoid seaching hang up.

Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
  • Loading branch information
Vicente-Cheng authored and bk201 committed Dec 7, 2023
1 parent 6d76c36 commit 479d3c5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions package/harvester-os/files/usr/sbin/harv-install
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,20 @@ update_grub_settings()
# stuck on the grub file search for about 30 minutes, this can be
# mitigated by adding the `grubenv` file.
#
# PATCH: add /oem/grubenv if it does not exist
# We need to patch grubenv, grubcustom
oem_dir=${TARGET}/oem
GRUBENV_FILE="${oem_dir}/grubenv"
if ! [ -f ${GRUBENV_FILE} ]; then
grub2-editenv ${GRUBENV_FILE} create

# PATCH1: add /oem/grubenv if it does not exist
# grubenv use load_env to load, so we use grub2-editenv
TARGET_FILE="${oem_dir}/grubenv"
if ! [ -f ${TARGET_FILE} ]; then
grub2-editenv ${TARGET_FILE} create
fi
# PATCH2: add /oem/grubcustom if it does not exist
# grubcustom use source to load, so we can use touch directly
TARGET_FILE="${oem_dir}/grubcustom"
if ! [ -f ${TARGET_FILE} ]; then
touch ${TARGET_FILE}
fi

add_debug_grub_entry
Expand Down

0 comments on commit 479d3c5

Please sign in to comment.