Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide boot messages when plymouth is enabled #32556

Open
davidak opened this issue Dec 11, 2017 · 24 comments
Open

hide boot messages when plymouth is enabled #32556

davidak opened this issue Dec 11, 2017 · 24 comments

Comments

@davidak
Copy link
Member

davidak commented Dec 11, 2017

Issue description

Plymouth is used to prevent boot messages from being displayed. That does not work completely.

/cc @abbradar @michaelpj

Steps to reproduce

NixOS system with Grub 2 and Xfce.

  1. boot.plymouth.enable = true;
  2. nixos-rebuild switch
  3. reboot
  4. you still get these messages

virtualbox_nixos_11_12_2017_06_02_11

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.9.66, NixOS, 17.09.2281.b4a0c011e81 (Hummingbird)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 1.11.15
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@ghost
Copy link

ghost commented Dec 11, 2017

Yep, not great. With latest nixos-unstable
On boot: grub -> few stage 1 messages -> Plymouth splash -> few stage 1 messages for a moment -> tty login prompt for a moment -> display manager
[ on some hardware only - On reboot: blinking cursor for some time -> Plymouth splash for a moment ]

@michaelpj
Copy link
Contributor

Yeah, currently we install Plymouth into the stage 2 of the initrd. So you don't get it until then, and if if stage 2 is very fast, you won't see much of it at all! I don't know why it goes into stage 2, @abbradar set it up initially, so might know.

@ghost
Copy link

ghost commented Dec 16, 2017

And to fix

tty login prompt for a moment -> display manager

We need to provide systemd units for each display manager. See https://wiki.archlinux.org/index.php/plymouth#Smooth_transition

@stale
Copy link

stale bot commented Jun 5, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2020
@rileyinman
Copy link
Contributor

This is still important, it just has not been worked on.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 6, 2020
@stale
Copy link

stale bot commented Dec 3, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 3, 2020
@davidak
Copy link
Member Author

davidak commented Dec 7, 2020

This is still needed for good UX.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 7, 2020
@peterhoeg
Copy link
Member

I have patches here, but cleaned up yet and ready for submission. With the latest plymouth we can show the UEFI vendor logo during boot which is quite nifty. Also just sitting in my local patch queue.......

@bobvanderlinden
Copy link
Member

@peterhoeg that sounds great! Did you submit your patches somewhere already?

@peterhoeg
Copy link
Member

Crucially I had left out a "not" in my earlier comment that should have been "but not cleaned up yet and ready for submisssion"... So there's that.

I'll allocate some time for this Soonish(tm). I'll ping you guys here when it's ready for testing. I have it working on one laptop here but not another although I'm not sure if this is related to what I did or the laptop in question.

@stale
Copy link

stale bot commented Jul 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 26, 2021
@maydayv7
Copy link

maydayv7 commented Sep 7, 2021

(just bumping the issue)

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 7, 2021
@daanhenke
Copy link

Does anyone know a fix for this issue on 22.11? Or is it impossible to install the package into the stage1 initramfs?

@maydayv7
Copy link

maydayv7 commented Mar 7, 2022

I'm using systemd-boot with GDM and plymouth with the following configuration on 21.11:

{
  console = {
    font = "ter-132n";
    packages = [pkgs.terminus_font];
    useXkbConfig = true;
    earlySetup = false;
  };

  boot = {
    consoleLogLevel = 0;
    initrd.verbose = false;
    plymouth.enable = true;
    kernelParams = [
      "quiet"
      "splash"
      "boot.shell_on_fail"
      "i915.fastboot=1"
      "loglevel=3"
      "rd.systemd.show_status=false"
      "rd.udev.log_level=3"
      "udev.log_priority=3"
    ];

    loader = {
      timeout = lib.mkDefault 0;
      efi.canTouchEfiVariables = true;
      systemd-boot = {
        enable = true;
        editor = false;
        configurationLimit = 100;
      };
    };
  };
}

It works flawlessly, displays the logo, without any text on boot/shutdown

@TLATER
Copy link
Contributor

TLATER commented Jul 25, 2022

It works flawlessly, displays the logo, without any text on boot/shutdown

That "flawlessly" is somewhat arguable, the point of plymouth in my mind has always been that you can get logs by pressing escape, in case you need them, so disabling all logging seems a bit counter that :)

Using boot.initrd.systemd.enable is probably the way forward, but from my experimentation this still shows the stage1 logs (and a line stating something along the lines of "starting plymouth"), followed by some console flickering when switching to lightdm.

@pmarreck
Copy link

pmarreck commented Sep 6, 2022

Stuck on grub2 for now due to zfs-on-root (although if someone wants to provide a guide to get zfs-on-root working with systemd-boot, that'd be great!), and would also like the option to see a nicer boot and making console text optional. When you work on your nixos config for hours to get things just right, this kind of thing is the icing on the cake.

I don't use LUKS, so I'm fine with an option that doesn't yet work with LUKS (some protection in place for those who do but try to enable plymouth, might be warranted)

@pmarreck
Copy link

pmarreck commented Sep 8, 2022

EDIT: I got it to work. Plymouth is now uninterrupted. My (current) config is on my profile, I'm not sure exactly which combination of bits makes it work but one of the configs suggested in the recent comments helped. Note that a previous incarnation/attempt at this actually hid a real error/problem (regarding mounting my bpool in time), and the only symptom of that was that it kept dumping me into a root login at boot which I could just control-D out of, so be aware that you might want to turn it off sometimes.

@mainrs
Copy link

mainrs commented Sep 9, 2022

[...] so be aware that you might want to turn it off sometimes.

So pressing escape to see the boot logs is not possible?

@pmarreck
Copy link

pmarreck commented Sep 9, 2022

@mainrs
I don't think that worked for me unfortunately. I too would like that feature or something like it (like holding down Shift, etc.)

@pmarreck
Copy link

@mainrs
Nevermind, escape DID work! It does show the full boot text after hitting it. So everything is sweet now :)

@heywoodlh
Copy link

Just FYI, this is my config to suppress boot messages on my machines:

  boot = {
    kernelParams = [ "quiet" "splash" ];
    plymouth.enable = true;
    consoleLogLevel = 0;
    initrd.verbose = false;
  };

@davidak
Copy link
Member Author

davidak commented Jan 16, 2023

@heywoodlh that has no effect on my system using grub2. Do you use systemd-boot?

https://www.youtube.com/watch?v=4_C8l3YhGwM

@heywoodlh
Copy link

@davidak Ah yes, sorry, should have clarified: I am using systemd-boot.

@TLATER
Copy link
Contributor

TLATER commented Jan 16, 2023

https://www.youtube.com/watch?v=4_C8l3YhGwM

Most of that appears to be grub showing stuff, which happens before even the Linux kernel takes over, and won't be affected by any of the systemd/plymouth configuration. That's up to configuring grub.

After grub finishes "booting the kernel" you get a blank screen for a while, which I assume is most of stage 1. It's blank because you've disabled all logging for that portion of the boot - ideally plymouth would start much earlier here, so you don't need to disable stage 1 logging (and can make it visible through escape).

Finally just before stage 1 hands over to stage 2 plymouth finally starts (so that it can ask for decryption stuff), but as lightdm takes over you get tty1 flickering again. I'm pretty sure it's possible to resolve that as well, I've seen fedora systems boot without that flicker.

I think the current state is:

  • You can make the system boot without showing the boot manager
    • To achieve this use systemd-boot
    • OR configure grub to be hidden by default:
      {
        boot.loader = {
          timeout = 5; # The default, I recommend making this shorter
          grub = {
            extraConfig = ''
              set timeout_style=hidden
            '';
            # Because it still draws that image otherwise
            splashImage = null;
          };
        };
      }
  • You can, with caveats, make the system fully boot with plymouth from (late) stage1
    • Completely feasible without full disk encryption, just set boot.plymouth.enable = true;
    • With full disk encryption, currently requires the experimental boot.initrd.systemd
  • You can kind of hack the boot such that it shows no boot logs during stage1 to get a console-log free boot
    • See above
    • This is definitely not optimal
  • You cannot make the system boot without flickering the tty for a bit before your display manager starts

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

No branches or pull requests