Repository: osbuild/osbuild-composer
Pull request #1129 (2020-12-04 23:47:51)

distro/rhel84: update kernel options
The kernel options are updated to remove the read only option "ro" from all image types that had it set. Also, the qcow2's kernel options are updated to only set console=ttyS0 once. It was declared twice which is redundant so now it is set for both tty0 and ttyS0.


jkozol: > The qcow2 image changes look alright - the kernel options are now the same as in the kickstart. I cannot decide though if removing ro from the other image types is the right thing to do.

I also feel unsure about how to decide what to include in the other image types. In general I've been trying to apply the changes to the qcow2 to the other image types. But, I am happy to only drop the `ro` option from the qcow2 and amazon image since that is what is set in the kickstarters.
ondrejbudai: We have `ro` for other image types than `qcow2` also in `rhel8` definitions so I think I would prefer doing the change only for `qcow2`. We know for sure that it shouldn't have `ro`. We don't know it for the other types so it's probably safer to leave them as they are.

Patch:
diff --git a/internal/distro/rhel84/distro.go b/internal/distro/rhel84/distro.go
index ad74a3300..ba55d964c 100644
--- a/internal/distro/rhel84/distro.go
+++ b/internal/distro/rhel84/distro.go
@@ -816,7 +816,7 @@ func New() distro.Distro {
 			"timedatex",
 		},
 		defaultTarget: "multi-user.target",
-		kernelOptions: "ro console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
+		kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
 		bootable:      true,
 		defaultSize:   6 * GigaByte,
 		assembler: func(options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
@@ -897,7 +897,7 @@ func New() distro.Distro {
 			// https://errata.devel.redhat.com/advisory/47339 lands
 			"timedatex",
 		},
-		kernelOptions: "ro console=ttyS0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto",
+		kernelOptions: "console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto",
 		bootable:      true,
 		defaultSize:   10 * GigaByte,
 		assembler: func(options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
diff --git a/osbuild-composer.spec b/osbuild-composer.spec
index e6dfa53c8..b65a1edbf 100644
--- a/osbuild-composer.spec
+++ b/osbuild-composer.spec
@@ -31,6 +31,8 @@ Source0:        %{gosource}
 BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
 BuildRequires:  systemd
 BuildRequires:  krb5-devel
+BuildRequires:  python3-docutils
+BuildRequires:  make
 %if 0%{?fedora}
 BuildRequires:  systemd-rpm-macros
 BuildRequires:  git
@@ -117,6 +119,7 @@ export GOFLAGS=-mod=vendor
 %gobuild -o _bin/osbuild-composer %{goipath}/cmd/osbuild-composer
 %gobuild -o _bin/osbuild-worker %{goipath}/cmd/osbuild-worker
 
+make man
 
 %if %{with tests} || 0%{?rhel}
 
@@ -160,6 +163,9 @@ install -m 0644 -vp distribution/osbuild-composer.conf          %{buildroot}%{_s
 
 install -m 0755 -vd                                             %{buildroot}%{_localstatedir}/cache/osbuild-composer/dnf-cache
 
+install -m 0755 -vd                                             %{buildroot}%{_mandir}/man7
+install -m 0644 -vp docs/*.7                                    %{buildroot}%{_mandir}/man7/
+
 %if %{with tests} || 0%{?rhel}
 
 install -m 0755 -vd                                             %{buildroot}%{_libexecdir}/osbuild-composer-test
@@ -240,6 +246,7 @@ cd $PWD/_build/src/%{goipath}
 %files
 %license LICENSE
 %doc README.md
+%{_mandir}/man7/%{name}.7*
 %{_libexecdir}/osbuild-composer/osbuild-composer
 %{_libexecdir}/osbuild-composer/dnf-json
 %{_datadir}/osbuild-composer/


Test patch:
diff --git a/test/data/manifests/rhel_84-x86_64-ami-boot.json b/test/data/manifests/rhel_84-x86_64-ami-boot.json
index ac19d76fb..0ae555619 100644
--- a/test/data/manifests/rhel_84-x86_64-ami-boot.json
+++ b/test/data/manifests/rhel_84-x86_64-ami-boot.json
@@ -3084,7 +3084,7 @@
           "name": "org.osbuild.grub2",
           "options": {
             "root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
-            "kernel_opts": "ro console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
+            "kernel_opts": "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
             "legacy": "i386-pc",
             "uefi": {
               "vendor": "redhat"
@@ -8589,7 +8589,7 @@
   },
   "image-info": {
     "boot-environment": {
-      "kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d ro console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto"
+      "kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto"
     },
     "bootloader": "grub",
     "bootmenu": [
diff --git a/test/data/manifests/rhel_84-x86_64-qcow2-boot.json b/test/data/manifests/rhel_84-x86_64-qcow2-boot.json
index 36ca54136..f4483362e 100644
--- a/test/data/manifests/rhel_84-x86_64-qcow2-boot.json
+++ b/test/data/manifests/rhel_84-x86_64-qcow2-boot.json
@@ -3452,7 +3452,7 @@
           "name": "org.osbuild.grub2",
           "options": {
             "root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
-            "kernel_opts": "ro console=ttyS0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto",
+            "kernel_opts": "console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto",
             "legacy": "i386-pc",
             "uefi": {
               "vendor": "redhat"
@@ -9507,7 +9507,7 @@
   },
   "image-info": {
     "boot-environment": {
-      "kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d ro console=ttyS0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto"
+      "kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto"
     },
     "bootloader": "grub",
     "bootmenu": [
diff --git a/test/data/manifests/rhel_84-x86_64-qcow2-customize.json b/test/data/manifests/rhel_84-x86_64-qcow2-customize.json
index b58e3626e..8e7c66918 100644
--- a/test/data/manifests/rhel_84-x86_64-qcow2-customize.json
+++ b/test/data/manifests/rhel_84-x86_64-qcow2-customize.json
@@ -3504,7 +3504,7 @@
           "name": "org.osbuild.grub2",
           "options": {
             "root_fs_uuid": "efe8afea-c0a8-45dc-8e6e-499279f6fa5d",
-            "kernel_opts": "ro console=ttyS0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug",
+            "kernel_opts": "console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug",
             "legacy": "i386-pc",
             "uefi": {
               "vendor": "redhat"
@@ -9617,7 +9617,7 @@
   },
   "image-info": {
     "boot-environment": {
-      "kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d ro console=ttyS0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug"
+      "kernelopts": "root=UUID=efe8afea-c0a8-45dc-8e6e-499279f6fa5d console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto debug"
     },
     "bootloader": "grub",
     "bootmenu": [