From 479d3c5f78c80db5d2f2ae2c6f6b128d9beebda9 Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Tue, 5 Dec 2023 12:12:38 +0800 Subject: [PATCH] install: manually create custom grub file - 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 --- .../harvester-os/files/usr/sbin/harv-install | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/package/harvester-os/files/usr/sbin/harv-install b/package/harvester-os/files/usr/sbin/harv-install index fc566fa37..6be586211 100755 --- a/package/harvester-os/files/usr/sbin/harv-install +++ b/package/harvester-os/files/usr/sbin/harv-install @@ -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