The NEW Build Your Own Arcade Controls

Main => Raspberry Pi & Dev Board => Topic started by: aldub516 on November 04, 2015, 05:25:20 pm

Title: how to change a config setting in a read-only image?
Post by: aldub516 on November 04, 2015, 05:25:20 pm
Hey guys, so im super close to my goal of running my pi to boot to a single rom. My only problem is this. Im using portablemame v2.0 image which is great, BUT, for the monitor im using, i need to access /boot/config.txt to change some screen settings to fit my lcd properly. I cannot change anything as the image is a read only setup, to avoid corruption on shut downs.  Is there anyway to change my config.txt on the read only image? This is my only issue
Title: Re: how to change a config setting in a read-only image?
Post by: JDFan on November 04, 2015, 05:32:45 pm
Is it made read only by using the lock on the sd card or a setting in the OS ?

If just in the OS then you need to go to the file and change it to allow writing - make your changes and save them then reset to read only.

According to an article here ( http://hallard.me/raspberry-pi-read-only/ (http://hallard.me/raspberry-pi-read-only/) ) this is the command for changing to/from read only mode
Quote
To set system to Read-Write use mount -o remount,rw / and to set it back to Read-Only mount -o remount,ro /

If using the lock slider then there should be a slide on the side of the SD card to unlock or lock the card (should be locked currently since you want it read only) - slide it to unlock and that will change it to read/write - change the file and then slide it back to lock ( makes it again read only)

(http://core0.staticworld.net/images/article/2014/09/512gbsandisk-100429437-orig.jpg)
Title: Re: how to change a config setting in a read-only image?
Post by: aldub516 on November 04, 2015, 08:06:22 pm
Normally I'd say "I'm not an idiot".. But hey, sometimes the obvious kills ya ;) it isn't the tab. The image is made to be read only as to never go corrupt with a sudden shut down, which happens when a shutdown happens with the pi writing something. I will try that Command to mount and unmount it as I read a little something about that in my researching. Hope that does the trick
Title: Re: how to change a config setting in a read-only image?
Post by: aldub516 on November 04, 2015, 08:42:39 pm
Edit. So I tried it out, and those commands seem to have no response. It doesn't even tell me it's a bad command. It just goes down a line and waits for a new command. Portablepi has built in rwenable and roenable shortcuts but those do nothing as well.
Title: Re: how to change a config setting in a read-only image?
Post by: JDFan on November 04, 2015, 08:56:24 pm
Edit. So I tried it out, and those commands seem to have no response. It doesn't even tell me it's a bad command. It just goes down a line and waits for a new command. Portablepi has built in rwenable and roenable shortcuts but those do nothing as well.

Did you try rebooting after using the rwenable shortcut (might need to reboot for the change to take effect )  :dunno
Title: Re: how to change a config setting in a read-only image?
Post by: aldub516 on November 05, 2015, 03:10:15 am
so it seems rwenable works, but im only able to write to a rc.local folder which holds boot options for the frontend. As i said im new to the pi, so I dont even really know how to navigate around well. Im wondering that since this is a custom distro, if maybe the normal /boot/config.txt file isnt even used? I need to change "disable overscan" and the overscan right, left etc values so my screen fits properly on the lcd
Title: Re: how to change a config setting in a read-only image?
Post by: JDFan on November 05, 2015, 09:04:28 am
Not real familiar with the pi either - hopefully someone with more knowledge will chime in soon ! -- But since it is a text file - you could probably load it up on the windows PC - change the properties to allow writes - change the setting in notepad and save and move the SD card back to the pi and the change should remain.
Title: Re: how to change a config setting in a read-only image?
Post by: aldub516 on November 05, 2015, 11:31:15 am
 So last night at 3:30 in the morning I couldn't sleep for anything so I woke up and started working on this. And I figured out just what you said. I mounted the card on my PC made the changes then went back in and everything was good. For someone trying to make a dedicated machine/game,
I could not sing the praise of portable pimame any more. Minus the screen problem which is a pi issue, the front end loaded up right away with roms, and even a newbie like me was able to program a single game boot in seconds.
Title: Re: how to change a config setting in a read-only image?
Post by: aldub516 on November 05, 2015, 01:58:26 pm
it turns out that i figured out how to change the files, but now realize that the mame4all runs off its own config, so it still boots up to a giant screen.. Im now trying to learn how to better navigate around the pi directories to change different values
Title: Re: how to change a config setting in a read-only image?
Post by: obcd on November 05, 2015, 05:48:26 pm
If you insert the SD in a windows pc, the boot folder containing the config.txt will become available as drive letter as that's a fat32 partition. (But you already figured that out)
The sd card also has a second partition with all the linux stuff. That's an ext4 partition that can't be seen by windows.
If you mount the sd card in a linux pc, the ext4 partition becomes available. This linux machine can be a virtual pc running in virtualbox.
Some fiiles are only accessible if you have administrator rights. Usually placing sudo in front of your editor is all it takes.
This might be the reason why you can't change the files on the pi itself, even after you mounted the partition back as read/write
The write protect switch of the sd card connector isn't used on the raspberry pi. So, the wp slider on the sd card is ignored.
Basically, only files in your home folder can be changed without administrator (sudo) rights. It depends upon the right flags of the file.