2

I am using Yacto based linux distribution on embedded control board. When I access the terminal serially(via rs232 port), the default size is 80 chars. I have changed this by running following commands

>stty size
0 0 
>shopt -s checkwinsize
>stty rows 60 cols 160
>shopt -u checkwinsize
>stty size
60 160

Terminal has new setting, however following a reboot, they are back to default! I tried "stty --save" after making changes, but of no use. The user is root, as its dev board.

I believe it is possible to preserve the settings between sessions/after reboots.

Can anyone point me where are the stty settings gets saved on rootfs? I can so edit that file with new row/column info without any other changes.

Thanks in advance.

  • 1
    You may look into setserial and its /etc/serial.conf, though an initscript would work just as well. What is your init system? – Fox Mar 30 '17 at 16:26
  • "/etc/serial.conf" file does not exists! >> though an initscript would work just as well. Do you mean adding my commands/ 'setserial' to init.d scripts? – Smarty Apr 3 '17 at 10:20
  • I notice 'etc/terminfo' directory which seems to have some binaries, but not use what they are used for ? Could these be any useful for what I wanted to do? – Smarty Apr 3 '17 at 10:41
  • setserial isn't necessarily installed by default. Adding a script in init.d is sufficient if that's how your system controls the startup. I don't know what you might find in /etc/terminfo – Fox Apr 3 '17 at 14:24
  • I finally achieved this by adding the instructions to /etc/rc.local file, so it gets executed on every boot. Thanks – Smarty Apr 11 '17 at 11:50
1

I finally achieved this get the settings on every boot by adding the instructions to /etc/rc.local file, so it gets executed on every time. I hoped that there was a better solution with terminal configuration files on Linux rather than adding commands to rc.local. But it does the job on my development board :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.