From 2b8511ffe8917e9b34cff35e1d647c59413ff4bc Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 3 Sep 2024 19:12:38 +0200 Subject: [PATCH] Yolotweak the grub.cfg to try to fix scenario on some machine booting on Grub (I guess?) instead of isolinux (? i have no idea what i'm talking about), but preseed file wasnt loaded on grub --- files_to_inject/boot/grub/grub.cfg | 92 ++++++++++++++++++++++++++++++ iso/injection.py | 4 ++ 2 files changed, 96 insertions(+) create mode 100644 files_to_inject/boot/grub/grub.cfg diff --git a/files_to_inject/boot/grub/grub.cfg b/files_to_inject/boot/grub/grub.cfg new file mode 100644 index 0000000..757bbf4 --- /dev/null +++ b/files_to_inject/boot/grub/grub.cfg @@ -0,0 +1,92 @@ +if loadfont $prefix/font.pf2 ; then + set gfxmode=800x600 + set gfxpayload=keep + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod gfxterm + insmod png + terminal_output gfxterm +fi + +if background_image /isolinux/splash.png; then + set color_normal=light-gray/black + set color_highlight=white/black +elif background_image /splash.png; then + set color_normal=light-gray/black + set color_highlight=white/black +else + set menu_color_normal=cyan/blue + set menu_color_highlight=white/blue +fi + +insmod play +play 960 440 1 0 4 440 1 +set theme=/boot/grub/theme/1 +menuentry --hotkey=g 'Graphical install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/default.preseed vga=788 --- quiet + initrd /install.amd/gtk/initrd.gz +} +menuentry --hotkey=i 'Install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/default.preseed vga=788 --- quiet + initrd /install.amd/initrd.gz +} +menuentry --hotkey=s 'Install with speech synthesis' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/default.preseed vga=788 speakup.synth=soft --- quiet + initrd /install.amd/gtk/initrd.gz +} +submenu --hotkey=a 'Advanced options ...' { + set menu_color_normal=cyan/blue + set menu_color_highlight=white/blue + set theme=/boot/grub/theme/1-1 + set gfxpayload=keep + menuentry '... Graphical expert install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/expert.preseed priority=low vga=788 --- + initrd /install.amd/gtk/initrd.gz + } + menuentry --hotkey=x '... Expert install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/expert.preseed priority=low vga=788 --- + initrd /install.amd/initrd.gz + } + menuentry --hotkey=w '... Expert install with speech-enabled' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/expert.preseed priority=low vga=788 speakup.synth=soft --- + initrd /install.amd/gtk/initrd.gz + } +} +submenu --hotkey=d 'Accessible dark contrast installer menu ...' { + set menu_color_normal=white/black + set menu_color_highlight=yellow/black + set color_normal=white/black + set color_highlight=yellow/black + background_image + set theme=/boot/grub/theme/dark-1-2 + set gfxpayload=keep + menuentry --hotkey=g '... Graphical install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/default.preseed vga=788 theme=dark --- quiet + initrd /install.amd/gtk/initrd.gz + } + menuentry --hotkey=i '... Install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/default.preseed vga=788 theme=dark --- quiet + initrd /install.amd/initrd.gz + } + menuentry '... Graphical expert install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/expert.preseed priority=low vga=788 theme=dark --- + initrd /install.amd/gtk/initrd.gz + } + menuentry --hotkey=x '... Expert install' { + set background_color=black + linux /install.amd/vmlinuz preseed/file=/cdrom/preseeds/expert.preseed priority=low vga=788 theme=dark --- + initrd /install.amd/initrd.gz + } +} + diff --git a/iso/injection.py b/iso/injection.py index e2d1f16..da4db04 100644 --- a/iso/injection.py +++ b/iso/injection.py @@ -494,11 +494,15 @@ def inject_files_into_iso( os.system(f"chmod -w '{path_to_extracted_iso_dir}/install.{arch}'") # ADd the input files to the extracted ISO + os.system(f"chmod +w {path_to_extracted_iso_dir}/boot/grub") + os.system(f"chmod +w {path_to_extracted_iso_dir}/boot/grub/grub.cfg") os.system(f"chmod -R +w {path_to_extracted_iso_dir}/isolinux") os.system(f"cp -r ./files_to_inject/* {path_to_extracted_iso_dir}/") os.system(f'sed "s@__ARCH__@{arch}@g" -i "{path_to_extracted_iso_dir}/isolinux/menu.cfg"') os.system(f'sed "s@__DIST__@{dist}@g" -i "{path_to_extracted_iso_dir}/preseeds/"*') os.system(f'sed "s@__TESTING__@{testing}@g" -i "{path_to_extracted_iso_dir}/preseeds/"*') + os.system(f"chmod -w {path_to_extracted_iso_dir}/boot/grub") + os.system(f"chmod -w {path_to_extracted_iso_dir}/boot/grub/grub.cfg") os.system(f"chmod -R -w {path_to_extracted_iso_dir}/isolinux") os.system(f"chmod -R -w {path_to_extracted_iso_dir}/preseeds")