LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-18-2023, 08:56 PM   #1
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Rep: Reputation: 45
After updates Today ... /bin/stty: /dev/tty2: Invalid argument


This worked quite well under 6.1.45 and updates until today . I also updated the kernel to 6.1.53 . Btw , I'm using current .

I WAS using this tty as a place to print out disk thermal differances from one run to the next (~= 30 seconds between) .

Now my script is failing with the below . Why has this changed ?


Code:
# /bin/stty --file=/dev/tty2 cols 200 rows 75
/bin/stty: /dev/tty2: Invalid argument
 
Old 09-19-2023, 02:20 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
If you strace, you'll see it's the TIOCSWINSZ ioctl call that returns an error, so it looks like a kernel change.

I see that error when I try and set more cols than the virtual console+font supports. Maybe in the past doing so didn't generate an error and they've tightened this up.
 
1 members found this post helpful.
Old 09-20-2023, 08:43 PM   #3
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Original Poster
Rep: Reputation: 45
@GazL , Thank you , I did find that doing a (See below) , Doesn't fail . It Shows that the rows have changed drastically . Tho the columns stat has not changed .

I'd really like to return to the previous resolution settings so that I've greater room for my scripts output . Which will grow as time goes on .

Code:
# stty -F /dev/tty2 -a
speed 38400 baud; rows 67; columns 200; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
 
Old 09-21-2023, 04:00 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Playing with stty settings only changes how many rows/cols the kernel thinks the tty has and not how many the console actually is capable of displaying. It's useful for pretending the tty is smaller than it is, but little else.

If you want more rows or cols, you need to use a smaller console font. Go look into setfont, setconsolefont and rc.font.

P.S. under some circumstances I've noticed that setting a font in rc.font might only change the font for the first virtual console, so you might also need to run setfont with -C /dev/tty2 to apply it to your second console if you find it isn't being set. (I believe this happens when a virtual console is already opened before setfont is run)
 
2 members found this post helpful.
Old 09-22-2023, 07:08 PM   #5
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Original Poster
Rep: Reputation: 45
@GazL , Thank You .

The screen I am playing with is 4K ie: 3840x2160 , Depending on the char height 2160 s/b tall enough , Heck at 24Bits of height there s/b enough room for 90 Rows . Not counting spacing .

Now I get to (Thanks to your leg work) find out what the font is & its size . (Edit: Which I never got to find out)

Then figure out to what values I can set them to .

Will report back soon'sh .

JimL

30 Minutes later ... Sucess !-)

My difficulty still is What has changed in the linux kernel that over wrote the previous defaults ?

The rc.font file has NEVER been set executable .
Verified this thru my previous full system backups looking for this file .

Code:
# dir /etc/rc.d/rc.font
4 -rw-r--r-- 1 root root 121 Feb 13  2021 /etc/rc.d/rc.font

# echo; cat /etc/rc.d/rc.font ; echo

#!/bin/bash
#
# This selects your default screen font from among the ones in
# /usr/share/kbd/consolefonts.
#
setfont -v

#
Executing the below , Fixed the height problem .

Code:
# setfont -v
Loading 256-char 8x16 font from file /usr/share/kbd/consolefonts/default8x16.psfu.gz
Loading Unicode mapping table...
Before I set it executable stat showed ...

Code:
# stat /etc/rc.d/rc.font     
  File: /etc/rc.d/rc.font
  Size: 121             Blocks: 8          IO Block: 4096   regular file
Device: 8,83    Inode: 6554041     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-09-22 16:08:08.063025319 -0800
Modify: 2021-02-13 02:08:19.000000000 -0900
Change: 2022-10-09 16:05:57.318219367 -0800    <<< Note: >>>
 Birth: 2022-10-09 16:05:57.200219374 -0800
Tho the height problem has not been an issue since 2022-10-09 but only very recently , Like as when I reported it here .
After I set it executable stat showed ...

Code:
# stat /etc/rc.d/rc.font 
  File: /etc/rc.d/rc.font
  Size: 121             Blocks: 8          IO Block: 4096   regular file
Device: 8,83    Inode: 6554041     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-09-22 16:08:08.063025319 -0800
Modify: 2021-02-13 02:08:19.000000000 -0900
Change: 2023-09-22 16:48:35.198063042 -0800    <<< Note: >>>
 Birth: 2022-10-09 16:05:57.200219374 -0800

Last edited by babydr; 09-22-2023 at 08:01 PM. Reason: Update ...
 
Old 09-23-2023, 05:32 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Checking the git logs, there was a bunch of fbcon related patches in 6.2; perhaps they were backported to 6.1. I think it's fair to assume it was a kernel change if you haven't changed anything your end.
 
1 members found this post helpful.
Old 09-23-2023, 07:45 PM   #7
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Original Poster
Rep: Reputation: 45
@GazL , Nope only changes were the kernel & regular updates . Then boom .
 
Old 11-03-2023, 10:20 PM   #8
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Original Poster
Rep: Reputation: 45
This issue has returned to plague me , When using a serial console .

Hello All , This issue has returned to plague me .

I just moved to using a serial console
And this issue resumed again .

Now the apparent resolution of the output of tty2 is at 80x24 .
which exactly matches the resolution used for the serial console .

even tho tty2 is attached to the same 4K monitor .
Which was working flawlessly before .
When it was Console .

Why is the consoles resolution used ? The reason is eluding me .

Even tho I ...

Code:
# cat /root/bin/monitor-on-tty2.sh
/bin/stty -F /dev/tty2 cols 470 rows 130 && \
/usr/bin/watch -c -d -n 30 /root/bin/watch-storcli+temp-v3.sh > /dev/tty2 &
The bash script is just a formatter of data to fit in the resolution described in the stty command above .

AND

Code:
# grep -B1 monitor /etc/inittab
#c2:12345:respawn:/sbin/agetty 38400 tty2 linux
c2:12345:ONCE:/root/bin/monitor-on-tty2.sh
 
Old 11-08-2023, 10:26 PM   #9
babydr
Member
 
Registered: Aug 2015
Location: Fairbanks , Alaska
Distribution: Slackware-14.2 & 15.0
Posts: 229

Original Poster
Rep: Reputation: 45
Hello All , This is another self inflicted wound .

The observed difficulty was caused by NOT including the "console=tty1" in the append line as seen below . After adding this with all the items mentioned , above or below as the case may be , All is well again .

Code:
append="root=PARTUUID=asdf-asdf-asdf-asdf-asdf-asdf vga=normal ipv6.disable=1 pcie_aspm=force pci=earlydump serial=0,115200n8 console=tty1 console=ttyS0,115200"
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
/dev/tty2 looks garbled after executing script Cyberman Programming 1 03-31-2009 07:19 AM
got stty: standard input: Invalid argument amit_pansuria Programming 8 09-19-2008 03:20 AM
message sending failed : Error[22 ] invalid argument .....but each and every argument rakeshranjanjha Linux - Software 2 01-07-2008 11:22 PM
Redirect /dev/ttyS0 input/output to tty2 Kymbo Linux - General 1 09-07-2006 10:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration