]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/grub-install: Allow recursive copying of theme dirs
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 13 Dec 2025 19:59:58 +0000 (20:59 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sun, 21 Dec 2025 15:41:46 +0000 (16:41 +0100)
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.

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-install-common.c

index a913ee61c4ceec23c258b974842d28b815aaee33..c1c3c570495a3fdf5cd3571276b61b7dc3f061f9 100644 (file)
@@ -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);