From bd27507f9136cad6938545166b1a03ede7665590 Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Sat, 19 Feb 2022 12:19:07 +0000
Subject: [PATCH] grub: link squash4.mod into the executable

Make sure that GRUB can load squashfs, so that it can mount the system
image and load the kernel, or other modules, from there directly.

Closes: https://booting.oniroproject.org/distro/oniro/-/issues/243

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 meta-oniro-core/recipes-bsp/grub/grub-efi_%.bbappend | 4 ++++
 meta-oniro-core/recipes-bsp/grub/grub_%.bbappend     | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/meta-oniro-core/recipes-bsp/grub/grub-efi_%.bbappend b/meta-oniro-core/recipes-bsp/grub/grub-efi_%.bbappend
index 1a81aa19..d9811a91 100644
--- a/meta-oniro-core/recipes-bsp/grub/grub-efi_%.bbappend
+++ b/meta-oniro-core/recipes-bsp/grub/grub-efi_%.bbappend
@@ -10,3 +10,7 @@
 # globally in OPTIMIZE_FOR=security mode.
 
 TARGET_CFLAGS:remove = "-Werror=array-bounds"
+
+# Make sure that GRUB can load squashfs, so that it can mount the system image
+# and load the kernel, or other modules, from there directly.
+GRUB_BUILDIN:append = " squash4"
diff --git a/meta-oniro-core/recipes-bsp/grub/grub_%.bbappend b/meta-oniro-core/recipes-bsp/grub/grub_%.bbappend
index 1a81aa19..d9811a91 100644
--- a/meta-oniro-core/recipes-bsp/grub/grub_%.bbappend
+++ b/meta-oniro-core/recipes-bsp/grub/grub_%.bbappend
@@ -10,3 +10,7 @@
 # globally in OPTIMIZE_FOR=security mode.
 
 TARGET_CFLAGS:remove = "-Werror=array-bounds"
+
+# Make sure that GRUB can load squashfs, so that it can mount the system image
+# and load the kernel, or other modules, from there directly.
+GRUB_BUILDIN:append = " squash4"
-- 
GitLab