]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
centos: Mount root partition rw by default on CentOS Stream 8 1349/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 14 Feb 2023 21:13:43 +0000 (22:13 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 15 Feb 2023 10:04:19 +0000 (11:04 +0100)
mkosi/__init__.py
mkosi/distributions/__init__.py
mkosi/distributions/centos.py

index e988edf6bd0a8619c1cce9188b3dbba7b860c8c8..a396b120cbc17e5f234dadd55601e1d98b2fbb9c 100644 (file)
@@ -776,6 +776,8 @@ def install_unified_kernel(state: MkosiState, roothash: Optional[str]) -> None:
             else:
                 cmdline = []
 
+            cmdline += state.installer.kernel_command_line(state)
+
             if roothash:
                 cmdline += [roothash]
 
index af42b4e0db35d81c83c27b7a030f66a831f56290..226d934718a12efbca8be86f7c3695add11182a9 100644 (file)
@@ -33,3 +33,7 @@ class DistributionInstaller:
     @classmethod
     def filesystem(cls) -> str:
         raise NotImplementedError
+
+    @staticmethod
+    def kernel_command_line(state: "MkosiState") -> list[str]:
+        return []
index d8fb01adc709e95214dbfaab9f120294ebe2d135..7384ad5f1e8b3be86d33a2bf384a1faec2686891 100644 (file)
@@ -37,6 +37,18 @@ class CentosInstaller(DistributionInstaller):
         # https://marc.info/?l=linux-xfs&m=167450838316386&w=2.
         return "ext4"
 
+    @staticmethod
+    def kernel_command_line(state: MkosiState) -> list[str]:
+        kcl = []
+
+        # systemd-gpt-auto-generator only started applying the GPT partition read-only flag to gpt-auto
+        # mounts from v240 onwards, while CentOS Stream 8 ships systemd v239, so we have to nudge gpt-auto to
+        # mount the root partition rw by default.
+        if state.config.bootable and int(state.config.release) <= 8:
+            kcl += ["rw"]
+
+        return kcl + DistributionInstaller.kernel_command_line(state)
+
     @classmethod
     @complete_step("Installing CentOS…")
     def install(cls, state: "MkosiState") -> None: