Hello, Although the "quiet" parameter is added to the kernel boot parameters, the kernel messages (printk) are still displayed in the console. Also, adding "loglevel=3" has not impact. cat /proc/sys/kernel/printk always returns "7 4 1 7" regardless of the kernel boot parameters.
What kernel are you using? Can you give emerge --info?
I think there is a misunderstanding regarding "quiet" mode. Even if you enable "quiet" mode, you will run with loglevel 4 (see include/linux/printk.h). Set loglevel kernel command-line argument is not supposed to alter values seen in /proc/sys/kernel/printk. It's an additional runtime value kernel compares against when executing printk function, see call_console_drivers() in kernel/printk/printk.c. And I am sorry, I don't get the reference to genkernel. Could you please explain why you filed this bug against genkernel and what you are expecting from genkernel to do?
(In reply to Thomas Deutschmann from comment #2) > I think there is a misunderstanding regarding "quiet" mode. > > Even if you enable "quiet" mode, you will run with loglevel 4 (see > include/linux/printk.h). > > Set loglevel kernel command-line argument is not supposed to alter values > seen in /proc/sys/kernel/printk. It's an additional runtime value kernel > compares against when executing printk function, see call_console_drivers() > in kernel/printk/printk.c. > > And I am sorry, I don't get the reference to genkernel. Could you please > explain why you filed this bug against genkernel and what you are expecting > from genkernel to do? I expect that all the console messages to be suppressed when adding "quiet" to the kernel boot parameters. According to the linuxrc script, the printk loglevel is restored to 7. The kernel messages are only suppressed priors the linuxrc script. Please check this code from the linuxrc script: if [[ "${CONSOLE_LOGLEVEL}" != "${GK_CONSOLE_LOGLEVEL}" ]] then good_msg "Restoring console log level (${CONSOLE_LOGLEVEL}) ..." echo ${CONSOLE_LOGLEVEL} > /proc/sys/kernel/printk \ && log_msg "COMMAND: 'echo \"${CONSOLE_LOGLEVEL}\" > /proc/sys/kernel/printk'" fi The console log level is restored regardless of the "quiet" kernel boot parameter.
The expected behavior is to get a fully silent console.
OK, then this report is invalid. Like said, quiet mode will not alter printk values. It is a runtime value kernel checks against in addition when calling the console driver. Genkernel only sets printk during genkernel initramfs execution and will restore previous value before transfering control to real system.
The point is that "quiet" should suppress all the console kernel messages but genkernel (i.e. initramfs execution) prevents that. Could you please let me know how can I get a completely silence console having the ramdisk generated by genkernel?
I don't understand about what you are talking. When I boot a genkernel system with "quiet" kernel command-line parameter set, I have zero output until genkernel transfers control to real system and init will be started.
Created attachment 706662 [details] quiet kernel boot parameter not working with initramfs (genkernel) (In reply to Thomas Deutschmann from comment #7) > I don't understand about what you are talking. When I boot a genkernel > system with "quiet" kernel command-line parameter set, I have zero output > until genkernel transfers control to real system and init will be started. Yes, this should be the normal behavior: zero output. However, it is not my case. See the attached screen recording from VirtualBox. The kernel version I am using is 4.2.1-r1.
I meant the genkernel version is 4.2.1-r1.
No, what you are seeing in video is systemd (i.e. the real system which takes control). This is *after* genkernel initramfs.
(In reply to Thomas Deutschmann from comment #10) > No, what you are seeing in video is systemd (i.e. the real system which > takes control). This is *after* genkernel initramfs. It is *after* genkernel initramfs but it is *because of* the linuxrc script which is "restoring" the kernel loglevel (see the /usr/share/genkernel/defaults/linuxrc code snippet below): --- if [[ "${CONSOLE_LOGLEVEL}" != "${GK_CONSOLE_LOGLEVEL}" ]] then good_msg "Restoring console log level (${CONSOLE_LOGLEVEL}) ..." echo ${CONSOLE_LOGLEVEL} > /proc/sys/kernel/printk \ && log_msg "COMMAND: 'echo \"${CONSOLE_LOGLEVEL}\" > /proc/sys/kernel/printk'" fi --- If I generate the ramdisk either with dracut or a custom linuxrc script genkernel, the "quite" kernel boot parameter works as it should (completely blank console). Furthermore, downgrading the genkernel to 4.1.2-r3 also works (i.e. suppressing the console kernel messages when passing "quiet" to the kernel command line).
Needs investigation, but I can confirm with something like > diff --git a/defaults/linuxrc b/defaults/linuxrc > index 932df46..6ede740 100644 > --- a/defaults/linuxrc > +++ b/defaults/linuxrc > @@ -452,8 +452,11 @@ do > esac > done > > -# Prevent superfluous printks from being printed to the console > -echo ${GK_CONSOLE_LOGLEVEL} > /proc/sys/kernel/printk > +if ! is_quiet > +then > + # Prevent superfluous printks from being printed to the console > + echo ${GK_CONSOLE_LOGLEVEL} > /proc/sys/kernel/printk > +fi > > good_msg "${GK_META_VERSION} (${GK_META_BUILD_DATE}). Linux kernel ${KV}" > > @@ -1370,7 +1373,7 @@ do > fi > done > > -if [[ "${CONSOLE_LOGLEVEL}" != "${GK_CONSOLE_LOGLEVEL}" ]] > +if ! is_quiet && [[ "${CONSOLE_LOGLEVEL}" != "${GK_CONSOLE_LOGLEVEL}" ]] > then > good_msg "Restoring console log level (${CONSOLE_LOGLEVEL}) ..." > echo ${CONSOLE_LOGLEVEL} > /proc/sys/kernel/printk \ > Thank you for the report.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=f80b81da305f1f782043d31751f81264be6f2ecd commit f80b81da305f1f782043d31751f81264be6f2ecd Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2021-06-23 22:42:13 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2021-07-05 22:44:45 +0000 linuxrc: Don't mess with console log level in quiet mode Fixes: d5f7d79b ("linuxrc: Refactor handling of console log level") Bug: https://bugs.gentoo.org/788970 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> defaults/linuxrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Fixed in >=sys-kernel/genkernel-4.2.2!