Skip to content

Conversation

@jjqq2013
Copy link
Contributor

@jjqq2013 jjqq2013 commented Jul 12, 2025

Problem:

No way to override kernel boot arg console=tty... due to the immutable /etc/cos/bootargs.cfg took precedence.

Solution:

move the console_params definition from /etc/cos/bootargs.cfg (in the immutable rootfs) to /grubenv

console_params=console=ttyS... console=tty...

Related Issue(s):

Issue harvester/harvester#8650

Test plan:

https://github.com/jjqq2013/harvester-os-raw-disk-image-builder
Use the test branch.

Tested result (PXE installer):

after installation, in the result image, the /oem/grubenv now contains the console_params.

harvester1-5-0-dd:/oem # cat grubenv
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub2-editenv!!!
third_party_kernel_args=multipath=off
console_params=console=ttyS0 console=tty1
####################...

and the /etc/cos/bootargs.cfg no longer contain the console_params=... definition.

harvester1-5-0-dd:~ # cat /etc/cos/bootargs.cfg
set kernel=/boot/vmlinuz
set crash_kernel_params="crashkernel=219M,high crashkernel=72M,low"
...
    set kernelcmd="$console_params root=LABEL=$state_label ...

Note that I have also simulated the effect of removing console_params line from /etc/cos/bootargs.cfg from the ISO image by modify it in the rootfs.squashfs before pass it to kvm.
See the logic.

$ cat test/harvester1.5.0.dd.tmp/rootfs.squashfs.unzipped/etc/cos/bootargs.cfg
set kernel=/boot/vmlinuz
set crash_kernel_params="crashkernel=219M,high crashkernel=72M,low"
...
    set kernelcmd="$console_params root=LABEL=$state_label ...

But I have not tested the stream-disk install mode.

Additional documentation or context

@votdev
Copy link
Member

votdev commented Jul 21, 2025

@jjqq2013 Could you please add the Signed-off-by: Author Name <[email protected]> line to your commit message to let the DCO test pass.

@jjqq2013 jjqq2013 force-pushed the james-grub-console branch from a7d14c9 to be5ad5f Compare July 22, 2025 04:35
@jjqq2013
Copy link
Contributor Author

@votdev Now the commit message become

Be able to change console_params in <OEM>/grubenv

Signed-off-by: jjqq2013 <[email protected]>

@jjqq2013
Copy link
Contributor Author

@votdev thanks for pointing out the "signed off" that I forgot.
I have added it to all my PRs, no wonder no one is reviewing my PRs.
Could anyone please review other PRs of mine? such as #1078

@votdev
Copy link
Member

votdev commented Jul 22, 2025

After building the ISO and installing a cluster node it looks like the console_params variable is not set in /oem/grubenv.

screenshot

The system started without showing the Harvester console; the login prompt was shown instead.
I was able to get it working again by running

$ sudo grub2-editenv /oem/grubenv set "console_params=console=ttyS1 console=tty1"

and rebooting the system.

@jjqq2013
Copy link
Contributor Author

What is the content of /etc/cos/bootargs.cfg in the ISO image?

@jjqq2013
Copy link
Contributor Author

I guess the ISO you built did not contain the harv-install script I modified in this PR, could you please check it again in the rootfs of the ISO file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants