1

Is it possible to import settings from another file into config.txt?

As I imagine

config.txt example content:

...

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on

...

include="/home/pi/mysettings.txt"

Why I want to do that

I mount the boot partion readonly. Sometimes I need to change some settings.


So I have to:

  1. modify fstab (make boot partionen writeable)
  2. restart
  3. change config.txt
  4. restart, test settings, maybe back to 3.
  5. modify fstab (make readonly)
  6. restart
  7. done

What I want to do:

  1. change mysettings.txt
  2. restart, test settings, maybe back to 1.
  3. done
0

This is not possible. Dokumentation of config.txt says:

This (rem.: config.txt) is read by the GPU before the ARM CPU and Linux are initialised. It must therefore be located on the first (boot) partition of your SD card, alongside bootcode.bin and start.elf.

edit: But on Raspbian you can simply remount the partition read/write:

pi ~$ sudo mount -o remount,rw /boot

Do your work, then remount the partition back to read only:

pi ~$ sudo mount -o remount,ro /boot
  • Can you please accept this answer by clicking the check on the left side of it? It would help me a little bit ;-) – Ingo Feb 1 '18 at 8:55
  • I was about to click the check mark, but I still have hope that someone has a good idea. Or maybe another solution that works in a similar way – maddin1502 Feb 1 '18 at 10:37
  • @maddin1502 had another look at your problem because I have overseen the very simple solution. Have updated the answer. – Ingo Feb 4 '18 at 9:58

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.