cmdline += ["--definitions", definitions]
+ env = dict(TMPDIR=str(state.workspace))
+ for fs, options in state.installer.filesystem_options(state).items():
+ env[f"SYSTEMD_REPART_MKFS_OPTIONS_{fs.upper()}"] = " ".join(options)
+
with complete_step("Generating disk image"):
- output = json.loads(run(cmdline, stdout=subprocess.PIPE, env={"TMPDIR": state.workspace}).stdout)
+ output = json.loads(run(cmdline, stdout=subprocess.PIPE, env=env).stdout)
roothash = usrhash = None
for p in output:
def filesystem(cls) -> str:
raise NotImplementedError
+ @classmethod
+ def filesystem_options(cls, state: "MkosiState") -> dict[str, list[str]]:
+ return {}
+
@staticmethod
def kernel_command_line(state: "MkosiState") -> list[str]:
return []
# https://marc.info/?l=linux-xfs&m=167450838316386&w=2.
return "ext4"
+ @classmethod
+ def filesystem_options(cls, state: MkosiState) -> dict[str, list[str]]:
+ # Hard code the features from /etc/mke2fs.conf from CentOS 8 Stream to ensure that filesystems
+ # created on distros with newer versions of e2fsprogs are compatible with e2fsprogs from CentOS
+ # Stream 8.
+
+ return {
+ "8": {
+ "ext4": ["-O", "none,has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize"],
+ },
+ }.get(state.config.release, {})
+
@staticmethod
def kernel_command_line(state: MkosiState) -> list[str]:
kcl = []