# Grr.  Framebuffer scrollback is gone

## miket

There's a feature I don't use much--but when I do, I do depend on it.

I was setting up a new machine and had some problems at boot time (gentoo-sources-5.10.27).  It seemed that an interesting message scrolled off the screen, so I hit Shift-Page Up to see it.  Hmm.  Didn't scroll up.

A search led to a Phoronix article quoting Linus saying that no one uses FBCON any more so the scroll functionality was coming out as of 5.9.rc5.

Ouch!  How do I find that message?  Dmesg doesn't record messages from either early boot or init.  As far as that goes,  /var/log/messages doesn't either (and the machine is borked enough that this isn't being written anyway).

 *Linus Torvalds wrote:*   

> So rather than try to maintain a likely unused set of code, I'll just aggressively remove it, and see if anybody even notices.

 

I sure as hell did.

----------

## Zucca

I do hope someone competent enough continues to maintain it.

----------

## Goverp

Yup, scrollback's been gone for some time.  The usual answer is to use "app-misc/screen" or IIUC tmux; I use screen, though I don't like it much (too many other features and a weird magic keys to get it to scroll back - "Ctl-[" "a" "PgUp" ?).  Of course, you need to remember to start it before you type any other commands, or include it in a shell profile.

<edit> Sorry, of course you can't start screen that early.

I think there are some early printk and pstore kernel configuration options that can send compressed output to pstore, though I couldn't get it to work when I tried some time ago.  I read somewhere (perhaps a note from Neddie Seagoon) that you need to spuriously enable serial port console stuff to get early printk to work.

IIUC you really don't want to run with this pstore stuff enabled all the time, as pstore (assuming you use efivars for storage - maybe there are better alternatives) is strictly limited, and overfilling it can brick you machine; hence specify xz compression or similar.

----------

## NeddySeagoon

miket,

Install over ssh. Every live media has that, don't they?

----------

## pa4wdh

Removing framebuffer scrollback seems like a bad idea to me ...

 *miket wrote:*   

> 
> 
> Ouch!  How do I find that message?  Dmesg doesn't record messages from either early boot or init.  As far as that goes,  /var/log/messages doesn't either (and the machine is borked enough that this isn't being written anyway).
> 
> 

 

If you can't scroll back and the message is too early for dmesg to record it, i think netconsole is the only way?

Some documentation on netconsole can be found here: https://www.kernel.org/doc/html/latest/networking/netconsole.html

----------

## wjb

Setting rc_logger in /etc/rc.conf gets you a little bit more than dmesg, but not the earliest stuff.

----------

## pietinger

 *wjb wrote:*   

> Setting rc_logger in /etc/rc.conf gets you a little bit more than dmesg, but not the earliest stuff.

 

You also can set rc_interactive="YES" in /etc/rc.conf

----------

## Hu

Scrollback was removed for having known bugs, some of which had (somewhat obscure, iirc) security implications.  Linus hoped that someone competent to maintain it would object and resurrect it.  So far, despite having inconvenienced some users, nobody has stepped up to take over that subsystem, as far as I know.

Although a bit of a hack, in some cases, configuring a framebuffer driver might be helpful because it will give the kernel more total lines on screen.  Depending on timing, OP might be able to use flow control to suspend output before the interesting message scrolls out.  I've dealt with systems that produce output too fast to rely on a human to suspend output at the right time, though.

OP's problem is not that it is too early for dmesg, but that it is not a kernel-generated message, so it was never in dmesg and never will be.  He needs to capture some user-program generated message(s).

----------

## miket

From what I found on lwn.net, I'm not alone.  There are a couple of kernel devs who are working on it (or at least started).  Linus' original beef was about odd bugs in a system that has accumulated a lot of cruft over the years; the security issue was reported later.  He wants a clean refactoring of the system.

I like pietinger's rc_interactive="YES" suggestion.  I also found it helpful to start the Busybox recovery shell in my initramfs:  at least I can see the messages.

That brings up an issue that others have noted:  the Busybox recovery shell also loses its scrollback.

Good luck trying to capture output into a file if init can't mount the HD r/w.  At least I got that solved--but somehow nothing's being written to /var/log/messages.

I'll have to limp along with rc_interactive="YES".

----------

## eccerr0r

For people with bus connected serial ports or (ugh) management engine, serial console if you have another machine.

Yeah I noticed the scrollback disappearing.  It's too bad, though the only reason why I use it is because it was in Linux since forever.

The NetBSD FB console on the pmax didn't have scrollback and only wished it because Linux supported it.

Looks like I will have to use gnu/screen more, even on console.

BTW gnu-screen scrollback is not actually scrollback, it's actually abusing the cut/paste feature... WAIT... you can cut and paste in gnu-screen?  Without a mouse?  :Very Happy:  (Yeah I'm a gnu-screen abuser, so many useful features, so many arcane key sequences to access them ...)

----------

## Leonardo.b

 *miket wrote:*   

> Good luck trying to capture output into a file if init can't mount the HD r/w

 

There is a tool called "bootlogd", distributed with sysVinit. A manual is avaiable too.

Not sure how to use it, I didn't tried it, yet.

----------

## M95D

I saw this conversation:

https://linux.gentoo.user.narkive.com/waFrRU83/gentoo-user-console-scrollback-is-back-again

There seems to be a patch available that restores console scrollback with a separate buffer for each console!

Unfortunately I can't see the patch file. Either the site doesn't store attachments or there's a problem with my browser.

Does anyone have that file? Please post it here. Thank you!

----------

## pa4wdh

Good to see someone is working on that.

Somehow attachments don't make it into the official archives  :Sad:  But here's one that has it:

https://marc.info/?l=gentoo-user&m=161764274023755

Direct link to the patch itself: https://marc.info/?l=gentoo-user&m=161764274023755&q=p3

----------

## CaptainBlood

+1

Planning 2 test it this W.E.

Thks 4 ur attention, interest & support.

----------

## JustAnother

 *Quote:*   

> Dmesg doesn't record messages from either early boot or init. As far as that goes, /var/log/messages doesn't either (and the machine is borked enough that this isn't being written anyway).

 

The kernel has switches for early boot messages via a serial port (uses polling), and netconsole, which will throw the boot messages through the ethernet port even before the network card driver is loaded. So you have to specify the NIC card settings in the kernel command line. 

I tried to set up netconsole but ran out of time to get it to work. But if early boot messages are your thing, this is the one to try out.

----------

## M95D

Patch works!

Thank you and thanks to the original patch author!

----------

## M95D

The patch fails with kernel 5.13, but there is a new patch for 5.14 here:

https://marc.info/?l=gentoo-user&m=163250452914253&w=2

I didn't test it yet.

----------

## figueroa

 *Leonardo.b wrote:*   

>  ...
> 
> There is a tool called "bootlogd", distributed with sysVinit. A manual is avaiable too.
> 
> Not sure how to use it, I didn't tried it, yet.

 

```
rc-update add bootlogd sysinit
```

The one should/will find the log in /var/log.

ADDED: I just updated an old forum post that discusses bootlog. It may be helpful so here it is:

https://forums.gentoo.org/viewtopic-t-1142299.html

----------

## Zucca

I use openrc-init instead of sysvinit.

Any guesses if it'll will be impossible to have bootlogd operating correctly with openrc-init?

----------

## figueroa

 *Zucca wrote:*   

> I use openrc-init instead of sysvinit.
> 
> Any guesses if it'll will be impossible to have bootlogd operating correctly with openrc-init?

 

Why do you use openrc-init? There doesn't seem to be any advocacy for it. In any case, you won't know till you try. What's the worst that could happen?

----------

## Zucca

 *figueroa wrote:*   

> Why do you use openrc-init?

 I saw it as an option so I tried it. I stuck with it since it works. And I like to hand off all the possible service handlings to openrc... Practically it only means getting rid of /etc/inittab and getting several more files in /etc/init.d... Not really sure if it's all that beneficial really. :D But Like I said, I stuck with it. I works as good as sysvinit. *figueroa wrote:*   

> There doesn't seem to be any advocacy for it.

 Maybe just one thing at the moment...

 *figueroa wrote:*   

> In any case, you won't know till you try. What's the worst that could happen?

 Yeah. I'll give it a go.

----------

## M95D

 *M95D wrote:*   

> The patch fails with kernel 5.13, but there is a new patch for 5.14 here:
> 
> https://marc.info/?l=gentoo-user&m=163250452914253&w=2
> 
> I didn't test it yet.

 

Patch works with gentoo-sources-5.15.32-r1   :Smile: 

----------

## flysideways

I'm glad I found the recommendation for abusing screen.

----------

