From bbe730f6076e35bd2413cc8b200b309718d9fea4 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 2 Jul 2024 12:23:51 +0200 Subject: [PATCH] bin/fai-cd create_grub2_image(): Add grub background image + DejaVuSansMono font to memdisk. Background image: /usr/share/images/desktop-base/desktop-grub.png Font file: /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf --- bin/fai-cd | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bin/fai-cd b/bin/fai-cd index 9326c75bd..d3a80e9ee 100755 --- a/bin/fai-cd +++ b/bin/fai-cd @@ -188,10 +188,15 @@ create_squashfs_image() { # - - - - - - - - - - - - - - - - - - - - - - - - - - create_grub2_image() { - mkdir -p $tmp/boot + mkdir -p $tmp/boot + # Needs 'grub2-common' and 'fonts-dejavu-core' packages. + grub-mkfont -s 16 -o "$tmp/DejaVuSansMono.pf2" /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf if [ -d $NFSROOT/usr/lib/grub/x86_64-efi ]; then cp $grub_config $NFSROOT/tmp/grub.cfg + # Needs 'desktop-base' package. + cp /usr/share/images/desktop-base/desktop-grub.png $NFSROOT/tmp/background.png + # insert date into grub menu perl -pi -e "s/_VERSIONSTRING_/ $isoversion /" $NFSROOT/tmp/grub.cfg if [ -n "$config_space" ] || [ $configset -eq 1 ]; then @@ -202,10 +207,13 @@ create_grub2_image() { --format=x86_64-efi \ --output=/tmp/bootx64.efi \ --locales="" --fonts="" \ - "boot/grub/grub.cfg=/tmp/grub.cfg" + "boot/grub/grub.cfg=/tmp/grub.cfg" \ + "boot/grub/background.png=/tmp/background.png" \ + "boot/grub/DejaVuSansMono.pf2=/tmp/DejaVuSansMono.pf2" + mv $NFSROOT/tmp/bootx64.efi $scratch - dd if=/dev/zero of=$scratch/efiboot.img bs=1M count=3 2>/dev/null + dd if=/dev/zero of=$scratch/efiboot.img bs=1M count=5 2>/dev/null mkfs.vfat $scratch/efiboot.img mmd -i $scratch/efiboot.img efi efi/boot mcopy -i $scratch/efiboot.img $scratch/bootx64.efi ::efi/boot/ @@ -217,9 +225,11 @@ create_grub2_image() { --format=i386-pc \ --output=/tmp/core.img \ --locales="" --fonts="" \ - --install-modules="linux normal iso9660 biosdisk memdisk search ls echo test chain msdospart part_msdos part_gpt minicmd ext2 keystatus all_video font sleep gfxterm regexp" \ + --install-modules="linux normal iso9660 biosdisk memdisk search ls echo test chain msdospart part_msdos part_gpt minicmd ext2 keystatus all_video font sleep gfxterm gfxterm_background png regexp" \ --modules="linux normal iso9660 biosdisk search" \ - "boot/grub/grub.cfg=/tmp/grub.cfg" + "boot/grub/grub.cfg=/tmp/grub.cfg" \ + "boot/grub/background.png=/tmp/background.png" \ + "boot/grub/DejaVuSansMono.pf2=/tmp/DejaVuSansMono.pf2" cat $NFSROOT/usr/lib/grub/i386-pc/cdboot.img $NFSROOT/tmp/core.img > $scratch/bios.img rm $NFSROOT/tmp/core.img else