10000 Protecting config.txt on RaspberryPi? · Issue #561 · osmc/osmc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Protecting config.txt on RaspberryPi? #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
harryberlin opened this issue Jun 6, 2020 · 7 comments
Open

Protecting config.txt on RaspberryPi? #561

harryberlin opened this issue Jun 6, 2020 · 7 comments

Comments

@harryberlin
Copy link

Is there a way to protect the config.txt on Raspberry Pi?
In some cases by turning power off (pi is not shut down), the config.txt gets empty 0KB file.
So, on next power on, the Raspberry don't boot up.
Could it be to set the file(s) as "read only" like LibreElec to solve the issue?

@samnazarko
Copy link
Contributor

The best way would be to make a backup. The card shouldn't be getting corrupted regularly, so I would verify the card.

LibreELEC doesn't use a read-only FAT32 partition, or updates would be impossible. I believe that they use squashfs for their root filesystem, but the boot files themselves are indeed writable. It's possible they mount the boot partition as RO unless there is an update action occurring.

@harryberlin
Copy link
Author

yes, at the moment i have placed a config.txt.bak in the same path. but this needs some steps (removing card, boot up an other pc, put card into adapter, restore the file, put card back in pi).

in LE it's mounted as ro.
for changes you can remount as rw. after this, remount as ro.

@samnazarko
Copy link
Contributor

You could mount it ro in /etc/fstab and change this on each update, but it seems a bit cumbersome. Unfortunately the current My OSMC implementation wouldn't make it trivial for us to make it RO by default.

@harryberlin
Copy link
Author

tried to figure out, where is the sub process to place before and after these commands in:
my.osmc/script.module.osmcsetting.updates/resources/lib/update_service.py
or
my.osmc/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py
mount -o remount,rw /boot
#do update
mount -o remount,ro /boot

is there a hidden background process to run the update?

my.osmc/script.module.osmcsetting.pi
my.osmc/script.module.osmcsetting.pioverclock
are more easy to find the step.

@samnazarko
Copy link
Contributor
samnazarko commented Jun 15, 2020 via email

@harryberlin
Copy link
Author
harryberlin commented Jun 15, 2020

yes, i understood.
is there a process before and after updating, to place the commands for rw and ro?

@samnazarko
Copy link
Contributor
samnazarko commented Jun 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0