title: How do I turn off the console on an embedded system built with Yocto?
body: <p>I am running Linux kernel 4.14.149 built by Yocto Zeus, and I am running 2019.07 U-boot.  At the recommendation of our security team, I am trying to get rid of the Linux console.  I am not worried about debugging (once I get this to work anyways); we have other ways of getting the system logs out of the machine, and this will not be done on software development boards.  That mechanism is already in place and is tested working.  We have an i.MX6 as our core (this is an embedded system), and we have dedicated UART5 to our console on dev boards.</p>
  <p>I have tried a few different methods to do this.  The first was to disable the framebuffer console kernel config (<code>CONFIG_FRAMEBUFFER_CONSOLE</code>).  The primary issue with this approach is that it disabled the splash screen.  We have a splash screen that is put up in U-boot (and it is displayed again by Linux), but Linux appears to reset the framebuffer or something when it is booting, resulting in the display flickering and being blank for a bit before our applications start, which was unacceptable (and is the reason we put the splash screen up in both U-boot and Linux).</p>
  <p>I also tried just setting &quot;console=&quot; on our command line.  This is close to what we want to achieve in that the console doesn't come out the UART anymore, but we see it start to appear on the display on top of the splash screen.  I haven't found any way to fix that (I can upload a screenshot if desired).</p>
  <p>Just eliminating the console parameter entirely didn't appear to work, it still came out the UART.  This is to be expected based on <a href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/admin-guide/serial-console.rst?h=v4.14.228" rel="nofollow noreferrer">the serial console documentation</a> which says it just uses the first available device.</p>
  <p>I have tried commenting out the console initialization in main.c in the Linux source, which exploded rather quickly.</p>
  <p>I tried setting to be a netconsole (see <a href="https://stackoverflow.com/questions/151687/where-do-you-send-the-kernel-console-on-an-embedded-system">Where do you send the kernel console on an embedded system?</a>) but the splash screen still got overwritten, same as the setting it nothing case.</p>
  <p>The last thing I have tried was just setting it to a bogus device (&quot;console=ttymxc9&quot; on the Linux command line).  While this appears to work (there is no data on the display or the UART) it appears to stall (crash?) partway through bootup and without being able to get the logs (it stalls before our application service runs).  I say stall because we have Linux configured for a heartbeat and we do still get proper LED heartbeat behavior.  None of the systemd services I added to our build however appear to run (I added one to save the journalctl log file after boot to a file on an external SD card for debugging purposes until I get this working)</p>
  <p>At this point, I have run out of ideas on how to get rid of the console while keeping the splash screen intact.  What is the proper way to disable the Linux console?</p>