diff --git a/files_to_inject/preseeds/default.preseed b/files_to_inject/preseeds/default.preseed index fd80cf0..5647b8d 100644 --- a/files_to_inject/preseeds/default.preseed +++ b/files_to_inject/preseeds/default.preseed @@ -72,8 +72,8 @@ d-i apt-setup/services-select multiselect security, updates d-i apt-setup/security_host string security.debian.org d-i apt-setup/local0/repository string \ - http://forge.yunohost.org/debian/ bullseye stable -d-i apt-setup/local0/key string http://forge.yunohost.org/yunohost_bullseye.asc + http://forge.yunohost.org/debian/ __DIST__ stable __TESTING__ +d-i apt-setup/local0/key string http://forge.yunohost.org/yunohost___DIST__.asc d-i apt-setup/local0/comment string YunoHost repository #d-i debian-installer/allow_unauthenticated string true diff --git a/files_to_inject/preseeds/expert.preseed b/files_to_inject/preseeds/expert.preseed index 967dcd9..4610478 100644 --- a/files_to_inject/preseeds/expert.preseed +++ b/files_to_inject/preseeds/expert.preseed @@ -73,8 +73,8 @@ d-i apt-setup/services-select multiselect security, updates d-i apt-setup/security_host string security.debian.org d-i apt-setup/local0/repository string \ - http://forge.yunohost.org/debian/ bullseye stable -d-i apt-setup/local0/key string http://forge.yunohost.org/yunohost_bullseye.asc + http://forge.yunohost.org/debian/ __DIST__ stable __TESTING__ +d-i apt-setup/local0/key string http://forge.yunohost.org/yunohost___DIST__.asc d-i apt-setup/local0/comment string YunoHost repository #d-i debian-installer/allow_unauthenticated string true diff --git a/iso/injection.py b/iso/injection.py index 0ebe290..e2d1f16 100644 --- a/iso/injection.py +++ b/iso/injection.py @@ -449,7 +449,7 @@ def inject_files_into_iso( path_to_output_iso_file = Path(path_to_output_iso_file).expanduser() path_to_output_iso_file = Path(path_to_output_iso_file).resolve() if path_to_output_iso_file.is_file(): - raise FileExistsError(f"Output file exists: '{path_to_input_iso_file}'.") + raise FileExistsError(f"Output file exists: '{path_to_output_iso_file}'.") if not path_to_output_iso_file.parent.is_dir(): raise NotADirectoryError(f"No such directory: '{path_to_output_iso_file.parent}'.") @@ -482,6 +482,8 @@ def inject_files_into_iso( p.ok("MBR extraction complete.") arch = "amd" if "amd64" in path_to_input_iso_file.name else "386" + dist = "bookworm" if "debian-12" in path_to_input_iso_file.name else "bullseye" + testing = "testing" if dist == "bookworm" else "" # For some reason this 'xen' thing takes up an extra 50-70ish MB compared # to the original iso ... not sure to understand ... but doesn't seem to be @@ -495,7 +497,10 @@ def inject_files_into_iso( 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 -R -w {path_to_extracted_iso_dir}/isolinux") + os.system(f"chmod -R -w {path_to_extracted_iso_dir}/preseeds") # This stuff gotta go into the initrd with cpio trick etc temp_file_dir = TemporaryDirectory()