LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2022, 06:18 AM   #1
andyparker
LQ Newbie
 
Registered: Aug 2022
Location: Cumbria, England
Distribution: Debian for Raspberry Pi
Posts: 6

Rep: Reputation: 0
can't chmod /boot/config.txt to add lcd_rotate


New install of Debian 32 bit default distro on Pi 3b and need to rotate screen to suit 7"display. I can't make chmod take whatever su/sudo I use, eg if I

sudo chmod o+w config.txt -v

it reports mode changed from 0755 0757 but ls -l shows it has not changed and I can't save changes.

I realise I am probably setting myself to look a proper plonker but I have run out of ideas.
 
Old 08-16-2022, 06:35 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
What kind of a partition is it on? If it is on a legacy format like FAT or a derivative, permissions don't apply in the normal way.

Best then to access it through sudoedit or similar.

Code:
sudoedit /boot/config.txt
 
1 members found this post helpful.
Old 08-16-2022, 06:56 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Yes, the Pi's /boot partition is FAT32.
 
1 members found this post helpful.
Old 08-16-2022, 07:17 AM   #4
andyparker
LQ Newbie
 
Registered: Aug 2022
Location: Cumbria, England
Distribution: Debian for Raspberry Pi
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks chaps
sudoedit /boot/config.txt can't write file - permission denied

All the guides tell me to edit config.txt so it must be possible - I don't like how sudo chmod -v reported success incorrectly
 
Old 08-16-2022, 07:19 AM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,136
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Was the partition that config.txt is on mounted as root? Can't you write to that file as root? Can root create/delete files on that partition? Copy config.txt to somewhere, edit it, then rewrite the new config.txt.

On a FAT32 file system example:
Code:
sudo mount -t vfat /dev/sdb1 ~/mount/point

sudo touch ~/mount/point/config.txt
Root can write to config.txt. FAT32 doesn't support file permissions though.
 
Old 08-16-2022, 11:14 AM   #6
andyparker
LQ Newbie
 
Registered: Aug 2022
Location: Cumbria, England
Distribution: Debian for Raspberry Pi
Posts: 6

Original Poster
Rep: Reputation: 0
Sorry I don't know about partitions and mounts, it is just the default on a new Debian install on a raspberry pi3B.

After su -l I was able to copy a previously edited copy of config.txt back into /boot it doesn't however have the desired effect ie the screen is still upside down, I guess this a specifically pi issue.

I still don't like it telling me lies!
 
Old 08-16-2022, 11:31 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
If you can use su then you should be able to edit the file using either nano or vi. nano might be a little easier then vi.

su -
nano /boot/config.txt
 
Old 08-16-2022, 03:25 PM   #8
andyparker
LQ Newbie
 
Registered: Aug 2022
Location: Cumbria, England
Distribution: Debian for Raspberry Pi
Posts: 6

Original Poster
Rep: Reputation: 0
Unhappy SOLVED

I can indeed edit config.txt as suggested but it still didn't change the screen orientation. There must be hundreds of posts giving this as the solution.
SOLVED - there is a utility in the gui under Preferences, Screen Configuration, Configure, Screens, DSI-1, Orientation where Inverted is an option.
Doesn't help if you don't want the gui mind.
 
Old 08-16-2022, 03:42 PM   #9
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,597

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545
Quote:
Originally Posted by andyparker View Post
there is a utility in the gui under Preferences, Screen Configuration, Configure, Screens, DSI-1, Orientation where Inverted is an option.
Doesn't help if you don't want the gui mind.
If it survives a reboot then it needs to be saving that setting somewhere.

You can verify whether somewhere is config.txt by duplicating the file, toggling the setting, maybe rebooting, then checking if/how the file has changed.

Its failure to work may be because you're (possibly?) running stock Debian, and /boot/config.txt is a Raspbian-specific setting?
Please clarify exactly what version of Debian (and desktop) you're running. (inxi is a convenient tool for that.)

In any case, searching the relevant source repository for "orientation" or "inverted", and following what it does, may reveal where it's actually saved.

 
1 members found this post helpful.
Old 08-17-2022, 06:15 AM   #10
andyparker
LQ Newbie
 
Registered: Aug 2022
Location: Cumbria, England
Distribution: Debian for Raspberry Pi
Posts: 6

Original Poster
Rep: Reputation: 0
The utility does not alter /boot/config.txt

inxi reports my distro as Raspbian GNU/Linux 11 (bullseye) and the Kernel 5.15.56-v7- armv7l
Desktop: LXDE 0.10.1

Searching the repository for those strings did not show anything useful to me at least.
 
Old 08-17-2022, 07:25 AM   #11
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,597

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545

LXDE has lxrandr, which is a GUI for xrandr.

Since it's a wrapper, that explains why it might not contain orientation/inverted itself, but its code does have a save_configuration function, the relevant part of which is:
Code:
    file = g_build_filename(  g_get_user_config_dir(), 
                              "autostart", 
                              "lxrandr-autostart.desktop", 
                              NULL );
g_get_user_config_dir is a GTK function that returns the value of XDG_CONFIG_HOME which defaults to "~/.config"

In other words, lxrandr probably saves to "/home/$USER/.config/autostart/lxrandr-autostart.desktop"

If so, that change will only come into effect after login - it you have a login screen which is correctly oriented then it would need to be something not user-specific, possibly in "/etc/xdg"

 
Old 08-17-2022, 09:24 AM   #12
andyparker
LQ Newbie
 
Registered: Aug 2022
Location: Cumbria, England
Distribution: Debian for Raspberry Pi
Posts: 6

Original Poster
Rep: Reputation: 0
Thank you boughtonp, my autostart directory only contains a file LXinput-setup.desktop which I think was written when I used LXinput and a Coordinate Transformation Matrix to get the touchscreen in sync with the display - always handy!
I am content that what I have works correctly now even if the method is probably not the best or most efficient.

If continuing this discussion might prove useful to others I am happy and interested to proceed, my problem being that a lot has changed since my SVr4 course in 198?

The login screen is correctly oriented but everything prior to that is inverted.

No recent files in /etc/xdg apart from some in lxpanel from intallation 2 days ago.
 
Old 08-17-2022, 09:38 AM   #13
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,597

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545

If the login screen is the first point it's correct then my understanding is that the display manager is where it would be handled - for LXDE that would be LXDM, and man lxdm lists relevant files as being in "/etc/lxdm/"

 
  


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
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 04:23 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 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