Skip to content

Commit

Permalink
Patch GRUB config: Add --no-floppy option
Browse files Browse the repository at this point in the history
  • Loading branch information
John Liu authored and bk201 committed Apr 7, 2022
1 parent 5b44a35 commit 6bfeb2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion package/harvester-os/files/usr/sbin/harv-install
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ add_debug_grub_entry()
{
cat > "${STATEDIR}/grubmenu" << "EOF"
menuentry "${display_name} (debug)" --id debug {
search.fs_label COS_STATE root
search --no-floppy --set=root --label COS_STATE
set img=/cOS/active.img
set label=COS_ACTIVE
loopback loop0 /$img
Expand Down Expand Up @@ -290,6 +290,14 @@ update_grub_settings()
sed -i "s/^set crash_kernel_params=.*/crash_kernel_params=\"${CRASH_KERNEL_PARAMS}\"/" ${TARGET}/etc/cos/bootargs.cfg
fi

# PATCH: Adding '--no-floppy' option to search command
GRUB_CFG="${STATEDIR}/grub2/grub.cfg"
sed -i "s/search /search --no-floppy /" "$GRUB_CFG"
sed -i "s/search.fs_label /search --no-floppy --label /" "$GRUB_CFG"
sed -i "s/search.file /search --no-floppy --file /" "$GRUB_CFG"
sed -i "s/search.fs_uuid /search --no-floppy --fs-uuid /" "$GRUB_CFG"
sed -i -E 's/^(\s*search\b)(.*)root$/\1 --set=root\2/' "$GRUB_CFG"

add_debug_grub_entry
}

Expand Down
2 changes: 1 addition & 1 deletion package/harvester-os/iso/boot/grub2/grub.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
search --file --set=root /boot/kernel.xz
search --no-floppy --file --set=root /boot/kernel.xz
set default=0
set timeout=10
set timeout_style=menu
Expand Down

0 comments on commit 6bfeb2d

Please sign in to comment.