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

1 Answer 1

3

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
3
  • Can you please accept this answer by clicking the check on the left side of it? It would help me a little bit ;-)
    – Ingo
    Commented Feb 1, 2018 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
    Commented Feb 1, 2018 at 10:37
  • @maddin1502 had another look at your problem because I have overseen the very simple solution. Have updated the answer.
    – Ingo
    Commented Feb 4, 2018 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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