From bd50862552f417f9d01d4a0d13ccc921ff26c5bf Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Tue, 5 Sep 2017 22:35:47 -0400 Subject: Create grub-helper function grub_build_font The idea is to build a font from source and then make a PF2 format file from it using grub-mkfont. This cuts down on the number of binary files committed to history in the repository. --- projects/grub/grub-helper | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'projects') diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index 3e1420ac..e7e8a1fe 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -17,6 +17,9 @@ ARCH='arch' CONFIG='config' +FONTS='fonts' +FONT_FILE='font-file' +FONT_PROJECT='font-project' FORMAT='format' MODMIN='modules-minimal' PLATFORM='platform' @@ -27,6 +30,14 @@ grub_arch() { project_file_contents "${project}" "${CONFIGS}" "${ARCH}" "$@" } +grub_font_file() { + project_file_contents "${project}" "${CONFIGS}" "${FONT_FILE}" "$@" +} + +grub_font_project() { + project_file_contents "${project}" "${CONFIGS}" "${FONT_PROJECT}" "$@" +} + grub_format() { project_file_contents "${project}" "${CONFIGS}" "${FORMAT}" "$@" } @@ -60,6 +71,21 @@ grub_copy_modules() { cp -a "${grub_module_dir}"/*.@(mod|lst) "${keep_dir}" } +grub_build_font() { + # Font project-specific filenames and paths + local font_file="$(grub_font_file "${FONTS}" "$@")" + local font_project="$(grub_font_project "${FONTS}" "$@")" + local font_build_dir="${root}/${BUILD}/${font_project}" + + local grub_mkfont="${sources_path}/grub-mkfont" + + # GRUB font directory for outputting the built PF2 file + mkdir -p "${build_path}/${FONTS}" + + "${grub_mkfont}" --output="${build_path}/${FONTS}/${font_file%.*}.pf2" \ + "${font_build_dir}/${font_file}" +} + grub_build_utils() { ( # If arch and/or platform files don't exist, -- cgit v1.2.3-70-g09d2