Skip to contentSkip to conversation

grub-install: Allow recursive copying of theme dirs

PATCH In review Andreas K. Hüttel 2 participants 2 messages Dec 13, 2025 – Dec 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grub-install: Allow recursive copying of theme dirs

grub-install allows to pass a parameter to install a theme in the boot partition. This works fine for the default starfield theme. However, in general themes can contain subdirectories, as, e.g. "icons", and these are not copied by grub-install. As a result, the icons are missing on the screen.

Fix this by simple recursive copying.

---
 util/grub-install-common.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
util/grub-install-common.c +9 -2
index a913ee61c..c1c3c5704 100644
@@ -803,13 +803,20 @@ copy_all (const char *srcd,
 	  || strcmp (de->d_name, "..") == 0)
 	continue;
       srcf = grub_util_path_concat (2, srcd, de->d_name);
-      if (grub_util_is_special_file (srcf)
-	  || grub_util_is_directory (srcf))
+      if (grub_util_is_special_file (srcf))
 	{
 	  free (srcf);
 	  continue;
 	}
       dstf = grub_util_path_concat (2, dstd, de->d_name);
+      if (grub_util_is_directory (srcf))
+	{
+	  grub_install_mkdir_p (dstf);
+	  copy_all (srcf, dstf);
+	  free (srcf);
+	  free (dstf);
+	  continue;
+	}
       grub_install_compress_file (srcf, dstf, 1);
       free (srcf);
       free (dstf);
Signature · 7 lines
2.51.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Andreas K. Hüttel

grub-install allows to pass a parameter to install a theme in the boot partition. This works fine for the default starfield theme. However, in general themes can contain subdirectories, as, e.g. "icons", and these are not copied by grub-install. As a result, the icons are missing on the screen.

Fix this by simple recursive copying.

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel