From 92c842e46f9f4ec4c839f267cb11737d37b4c5d5 Mon Sep 17 00:00:00 2001 From: Aiden <53726630+aiden3c@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:45:09 -0400 Subject: [PATCH] NAS-130002 / 24.10 / Show vendor name during install (#666) --- scale_build/image/iso.py | 10 ++++++++-- scripts/grub.cfg | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scale_build/image/iso.py b/scale_build/image/iso.py index 282a085..1518080 100644 --- a/scale_build/image/iso.py +++ b/scale_build/image/iso.py @@ -34,8 +34,14 @@ def install_iso_packages_impl(): for package in get_manifest()['iso-packages']: run_in_chroot(['apt', 'install', '-y', package]) + # Inject vendor name into grub.cfg + with open(CONF_GRUB, 'r') as f: + grub_cfg = f.read() + grub_cfg = grub_cfg.replace('$vendor', TRUENAS_VENDOR or 'TrueNAS SCALE') + os.makedirs(os.path.join(CHROOT_BASEDIR, 'boot/grub'), exist_ok=True) - shutil.copy(CONF_GRUB, os.path.join(CHROOT_BASEDIR, 'boot/grub/grub.cfg')) + with open(os.path.join(CHROOT_BASEDIR, 'boot/grub/grub.cfg'), 'w') as f: + f.write(grub_cfg) def make_iso_file(): @@ -113,7 +119,7 @@ def make_iso_file(): # Debian GRUB EFI searches for GRUB config in a different place os.makedirs(os.path.join(CD_DIR, 'EFI/debian'), exist_ok=True) - shutil.copy(CONF_GRUB, os.path.join(CD_DIR, 'EFI/debian/grub.cfg')) + shutil.copy(os.path.join(CHROOT_BASEDIR, 'boot/grub/grub.cfg'), os.path.join(CD_DIR, 'EFI/debian/grub.cfg')) os.makedirs(os.path.join(CD_DIR, 'EFI/debian/fonts'), exist_ok=True) shutil.copy(os.path.join(CHROOT_BASEDIR, 'usr/share/grub/unicode.pf2'), os.path.join(CD_DIR, 'EFI/debian/fonts/unicode.pf2')) diff --git a/scripts/grub.cfg b/scripts/grub.cfg index 5594c4e..4e519a0 100644 --- a/scripts/grub.cfg +++ b/scripts/grub.cfg @@ -68,13 +68,13 @@ fi insmod play play 960 440 1 0 4 440 1 -menuentry --hotkey=i --id=video 'Start TrueNAS SCALE Installation' { +menuentry --hotkey=i --id=video 'Start $vendor Installation' { load_video set background_color=black linux /vmlinuz gfxpayload=text quiet nomodeset boot=live toram=filesystem.squashfs $gfx_console initrd /initrd.img } -menuentry --hotkey=j --id=serial 'Start TrueNAS SCALE Installation (115200 baud)' { +menuentry --hotkey=j --id=serial 'Start $vendor Installation (115200 baud)' { load_video set background_color=black linux /vmlinuz gfxpayload=text quiet nomodeset boot=live toram=filesystem.squashfs $gfx_console $serial_console