Skip to content

Commit

Permalink
bin/fai-cd create_grub2_image(): Add grub background image + DejaVuSa…
Browse files Browse the repository at this point in the history
…nsMono font to memdisk.

Background image: /usr/share/images/desktop-base/desktop-grub.png
Font file: /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
  • Loading branch information
dzatoah committed Jul 3, 2024
1 parent 2f2e63b commit bbe730f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions bin/fai-cd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/
Expand All @@ -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
Expand Down

0 comments on commit bbe730f

Please sign in to comment.