aboutsummaryrefslogtreecommitdiff
path: root/projects/grub
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-09-05 22:35:47 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-09-06 21:31:50 -0400
commitbd50862552f417f9d01d4a0d13ccc921ff26c5bf (patch)
tree9eaa73e953ae3908b134b18ce0b965f350159481 /projects/grub
parent4c46577f91de37c09cfb37bc828eddb43df60ffc (diff)
downloadlibrebootfr-bd50862552f417f9d01d4a0d13ccc921ff26c5bf.tar.gz
librebootfr-bd50862552f417f9d01d4a0d13ccc921ff26c5bf.zip
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.
Diffstat (limited to 'projects/grub')
-rwxr-xr-xprojects/grub/grub-helper26
1 files changed, 26 insertions, 0 deletions
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,