How to rotate the console?

Hi all,

This is my first time working on a native (tty?) rather than virtual CLI (vty?). The machine is connected to a portrait monitor and I’m unable to work out how to rotate the CLI output to match.

Reading around on other Linux distros suggest the answer lies in setting fbcon’s rotate_all value to 3. I tried to do this via sysctl -w, but was unable to find the value. I also tried a bit of a brute force approach using:
sudo bash -c 'echo 3 > /sys/class/graphics/fbcon/rotate_all’
This appears to work without error, but has no effect.

I’m guessing this fbcon variable needs to be assigned in a kernel boot parameter, but I’m unsure how to achieve that in Clear, can anyone help?

Thanks

man clr-boot-manager describes the process. I don’t know what parameter you would need to add, though!

An easy way to test is to hit the letter “e” after the BIOS post and before Clear Linux starts booting. You can then edit the kernel boot parameters temporarily until you find the one that works. Once you figure it out you can man clr-boot-manager as described above to make the change permanent. Once you figure it out let us know what you did. I’m sure someone else will have the same problem in the future.

Thanks will give it a go.

Is there a list of these ‘on boot’ shortcut keys somewhere? I’ve seen others suggest holding spacebar to get the systemd boot manager, but either that’s the stock standard kernel listing that Clear already presents by default, or I’m doing something wrong, as I saw no change.

Yes, that’s the menu you need to be in. If you’re already there, just highlight the kernel you want to boot and hit ‘e’ to edit the default command line.

Thanks all. I’ve tried implementing the suggestions that I have seen elsewhere (largely Debian/Ubuntu solutions) for rotating the console, which is by adding either of the following to boot parameters:
fbcon=rotate:3
That didn’t seem to have any effect.
fbcon=rotate_all:3
That didn’t seem to have any effect.

I then tried adding the same to /etc/kernel/cmdline.d/test.conf and running sudo clr-boot-manager update.
That didn’t seem to have any effect either, though I can see that the parameters were passed, so that answers that bit.

cat /proc/cmdline
Shows that the parameters were passed using either method.

sudo sysctl -a | grep fbcon
…is drawing a blank though. Perhaps fbcon isn’t used/loaded?

At this stage I’m guessing that either I have the fbcon syntax wrong, or that somehow Clear has nothing to do with fbcon.

The only other thing I have discovered is that whilst everything suggests using:
/sys/class/graphics/fbcon/
That seems to be linked to the following instead in Clear:
/sys/devices/virtual/graphics/fbcon/*

Plot thinks a little as the following returns nothing:
lsmod | grep fbcon

A bit of sleuthing with this though:
lsmod | grep fb
Returns the following:
nvidiafb
vgastate (nvidiafb)
fb_ddc (nvidiafb)

No idea what that is, but it sounds suspiciously like an Nvidia equivalent of fbcon (and this system has a cheapo Nvidia graphics card in it). I might have been barking up the wrong tree with fbcon in the first place…

hmmm, modprobe fbcon falls on it’s face as well, module isn’t even in the lib/modules/xxxxx directory. So no wonders as to why that approach has failed.

I tried blacklisting nvidiafb (which worked, stops that running), but I have no idea which function has taken over managing and displaying the console framebuffer as that’s still working. Maybe it’s native to nouveau?

Right, so about six hours later, I’ve discovered a bunch of random stuff I didn’t know before, but more importantly, I think the answer to this problem lies in:

grep -i framebuffer /usr/lib/kernel/config*

For the particular version I’m running at the moment, part of what this returns is:
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set.

Based on that, I’m presuming this defaults to being disabled. According to other posts:


https://ubuntuforums.org/showthread.php?t=1216868

For fbcon commands to work, the kernel needs to be compiled with:

CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y

It’s currently a tad beyond me to understand how to recompile my own version of the Clear Linux 5.3.5-847.native kernel, so unless someone can help with that, I think this now stalls as being dependent on the dev team to enable this parameter by default.

Cheers

I submitted https://github.com/clearlinux/distribution/issues/1342 for you.

1 Like

Excellent, thanks for that. I’m not sure if my notes above are the whole story to make this work, but they certainly seem like a key part of it.