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

This commit is contained in:
Alexandre Aubin
2024-09-03 19:12:38 +02:00
parent 37a5b6995f
commit 2b8511ffe8
2 changed files with 96 additions and 0 deletions

View File

@@ -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")