Support both bullseye and bookworm images
This commit is contained in:
@@ -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/security_host string security.debian.org
|
||||||
|
|
||||||
d-i apt-setup/local0/repository string \
|
d-i apt-setup/local0/repository string \
|
||||||
http://forge.yunohost.org/debian/ bullseye stable
|
http://forge.yunohost.org/debian/ __DIST__ stable __TESTING__
|
||||||
d-i apt-setup/local0/key string http://forge.yunohost.org/yunohost_bullseye.asc
|
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 apt-setup/local0/comment string YunoHost repository
|
||||||
#d-i debian-installer/allow_unauthenticated string true
|
#d-i debian-installer/allow_unauthenticated string true
|
||||||
|
|
||||||
|
|||||||
@@ -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/security_host string security.debian.org
|
||||||
|
|
||||||
d-i apt-setup/local0/repository string \
|
d-i apt-setup/local0/repository string \
|
||||||
http://forge.yunohost.org/debian/ bullseye stable
|
http://forge.yunohost.org/debian/ __DIST__ stable __TESTING__
|
||||||
d-i apt-setup/local0/key string http://forge.yunohost.org/yunohost_bullseye.asc
|
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 apt-setup/local0/comment string YunoHost repository
|
||||||
#d-i debian-installer/allow_unauthenticated string true
|
#d-i debian-installer/allow_unauthenticated string true
|
||||||
|
|
||||||
|
|||||||
@@ -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).expanduser()
|
||||||
path_to_output_iso_file = Path(path_to_output_iso_file).resolve()
|
path_to_output_iso_file = Path(path_to_output_iso_file).resolve()
|
||||||
if path_to_output_iso_file.is_file():
|
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():
|
if not path_to_output_iso_file.parent.is_dir():
|
||||||
raise NotADirectoryError(f"No such directory: '{path_to_output_iso_file.parent}'.")
|
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.")
|
p.ok("MBR extraction complete.")
|
||||||
|
|
||||||
arch = "amd" if "amd64" in path_to_input_iso_file.name else "386"
|
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
|
# 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
|
# 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"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"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@__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}/isolinux")
|
||||||
|
os.system(f"chmod -R -w {path_to_extracted_iso_dir}/preseeds")
|
||||||
|
|
||||||
# This stuff gotta go into the initrd with cpio trick etc
|
# This stuff gotta go into the initrd with cpio trick etc
|
||||||
temp_file_dir = TemporaryDirectory()
|
temp_file_dir = TemporaryDirectory()
|
||||||
|
|||||||
Reference in New Issue
Block a user