Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grr. Framebuffer scrollback is gone
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 498
Location: Gainesville, FL, USA

PostPosted: Wed Apr 14, 2021 2:20 am    Post subject: Grr. Framebuffer scrollback is gone Reply with quote

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.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3963
Location: Rasi, Finland

PostPosted: Wed Apr 14, 2021 7:03 am    Post subject: Reply with quote

I do hope someone competent enough continues to maintain it.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2212

PostPosted: Wed Apr 14, 2021 8:50 am    Post subject: Reply with quote

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.
_________________
Greybeard
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54957
Location: 56N 3W

PostPosted: Wed Apr 14, 2021 9:22 am    Post subject: Reply with quote

miket,

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

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 914

PostPosted: Wed Apr 14, 2021 10:04 am    Post subject: Re: Grr. Framebuffer scrollback is gone Reply with quote

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
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
wjb
l33t
l33t


Joined: 10 Jul 2005
Posts: 646
Location: Fife, Scotland

PostPosted: Wed Apr 14, 2021 10:06 am    Post subject: Reply with quote

Setting rc_logger in /etc/rc.conf gets you a little bit more than dmesg, but not the earliest stuff.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5469
Location: Bavaria

PostPosted: Wed Apr 14, 2021 10:44 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23148

PostPosted: Wed Apr 14, 2021 3:46 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 498
Location: Gainesville, FL, USA

PostPosted: Wed Apr 14, 2021 8:19 pm    Post subject: Reply with quote

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".
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9917
Location: almost Mile High in the USA

PostPosted: Wed Apr 21, 2021 1:10 am    Post subject: Reply with quote

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? :D (Yeah I'm a gnu-screen abuser, so many useful features, so many arcane key sequences to access them ...)
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Leonardo.b
Guru
Guru


Joined: 10 Oct 2020
Posts: 308

PostPosted: Wed Apr 21, 2021 1:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
M95D
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2020
Posts: 96

PostPosted: Sat Jul 10, 2021 4:52 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 914

PostPosted: Sat Jul 10, 2021 5:34 pm    Post subject: Reply with quote

Good to see someone is working on that.

Somehow attachments don't make it into the official archives :( 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
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3998

PostPosted: Sat Jul 10, 2021 8:59 pm    Post subject: Reply with quote

+1
Planning 2 test it this W.E.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
JustAnother
Apprentice
Apprentice


Joined: 23 Sep 2016
Posts: 197

PostPosted: Sun Jul 11, 2021 5:38 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
M95D
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2020
Posts: 96

PostPosted: Mon Jul 12, 2021 1:45 pm    Post subject: Reply with quote

Patch works!
Thank you and thanks to the original patch author!
Back to top
View user's profile Send private message
M95D
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2020
Posts: 96

PostPosted: Wed Apr 13, 2022 5:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3008
Location: Edge of marsh USA

PostPosted: Thu Apr 14, 2022 4:03 am    Post subject: Reply with quote

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.

Code:
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
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3963
Location: Rasi, Finland

PostPosted: Thu Apr 14, 2022 6:05 pm    Post subject: openrc-init Reply with quote

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

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3008
Location: Edge of marsh USA

PostPosted: Thu Apr 14, 2022 7:09 pm    Post subject: Re: openrc-init Reply with quote

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?
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3963
Location: Rasi, Finland

PostPosted: Fri Apr 15, 2022 8:16 am    Post subject: Re: openrc-init Reply with quote

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.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
M95D
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2020
Posts: 96

PostPosted: Fri Apr 15, 2022 7:55 pm    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 501

PostPosted: Sat Aug 13, 2022 12:06 am    Post subject: Reply with quote

I'm glad I found the recommendation for abusing screen.
Back to top
View user's profile Send private message
irets
Apprentice
Apprentice


Joined: 17 Dec 2019
Posts: 233

PostPosted: Mon Feb 12, 2024 5:59 pm    Post subject: Reply with quote

The patch does not apply anymore.
Does anyone have an updated patch? :(
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5469
Location: Bavaria

PostPosted: Mon Feb 12, 2024 7:53 pm    Post subject: Reply with quote

Alan Mackenzie postet a patch for 6.6.13 on our Gentoo User MailingList at 2024-01-24
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum