How to modify files in /etc?

  • Hello,

    /etc is located on a squashfs and can therefore not be modified.

    How is one supposed to change/override settings in files withhin /etc?

    For some packages, directories exist in /storage/.config, but those directories exist not for all packages.

    I would need to set FastConnectable=true in /etc/bluetooth/main.conf to fix issues with reconnect issues when libreelec is rebooted. But

    Code
    find /storage -name '*blue*'

    won't find me anything for a starting point.

    Maybe there's some generic way for such setting changes/overrides?

    I see, there is the dtoverrides mechanism. But from the README, it looks like this is only for hardware deviations.

  • How is one supposed to change/override settings in files withhin /etc?

    If .. you really need to change stuff in the system partition, please note that such changes can be wiped away with the next update/downgrade. Most settings, if not all, should be done from the storage partition.

    You can open up the system partition by mounting it r/w: mount -o remount,rw /

  • As I wrote above, this won't work because / is squashfs:

    Code
    kodi-rpi4:~/.config # mount -oremount,rw /
    kodi-rpi4:~/.config # echo "# huhu" >>/etc/bluetooth/main.conf
    -sh: can't create /etc/bluetooth/main.conf: Read-only file system
    kodi-rpi4:~/.config # grep " / " /proc/mounts
    /dev/loop0 / squashfs ro,relatime 0 0
    kodi-rpi4:~/.config #
  • here, on nightly it also doesn't work:

    mount|grep loop0

    => /dev/loop0 on / type squashfs (ro,relatime,errors=continue)

    mount -o remount,rw /

    mount|grep loop0

    /dev/loop0 on / type squashfs (ro,relatime,errors=continue)

    Klojum do you mixed it with:

    mount -o remount,rw /dev/sda1 /flash


    doejohn

    a shoot in the dark:

    maybe ~/.config/bluetooth takes precedence over /etc/bluetooth ???

    so what happens if you copy the folder /etc/bluetooth to ~/.config/

    and

    adjust your settings

    and

    reboot

    and

    "soundcheck"

  • squashfs can't be remounted rw.

    This works:

    Code
    cp /etc/bluetooth/main.conf /storage/.cache/bluetooth/main.conf
    # edit file /storage/.cache/bluetooth/main.conf
    
    # edit file /storage/.cache/services/bluez.conf and add
    BLUEZ_ARGS="--configfile /storage/.cache/bluetooth/main.conf"
    
    # reboot or
    systemctl restart bluetooth
  • It's possible to replace /etc/connman/main.conf at boot time using /storage/.config/connman_main.conf but the same is not implemented for the Bluez main.conf file. You should attempt the bind mount mglae suggested. If that doesn't work you need to self-compile an image with the changes made at build time (or implementing a similar override method to ConnMan.

  • In the spirit of experimentation I copied /flash/SYSTEM (which is the squashfs container for the LE root fs) to my Linux box, installed the squashfs-tools package, ran unsquashfs SYSTEM which creates squashfs-root/ in which you'll find the entire contents of the root file system.

    Edit, modify, pillage and burn to your heart's content. :)

    Then use mksquashfs to recreate the SYSTEM container. This I shall cowardly leave as an exercise to the reader, because I have no idea what parameters have been used to create SYSTEM originally and what parameters should be used to recreated the modified SYSTEM squashfs container. If the LE devs can tell you, great; if not, there's trial and error in your future. If it breaks, you get to keep the pieces. :P


    Putting the SYSTEM container back is probably best done by bringing LE down, transferring the flash card from your RPI to the Linux box and copying SYSTEM to it. You could try to remount /flash rw and replace SYSTEM that way using sftp, I suppose, but I expect that would be much like trying to change the wheels on a speeding car, I suspect, and end in a similar manner.


    Personally I'm not going this route, because every LE update will overwrite the changes thus made. In general it shouldn't be necessary, either: for normal LE / Kodi use no write access to / is or should ever be required. If you do need write access, that means you're trying to do something that LE wasn't intended or designed for, and you might be better off using Raspbian instead and simply live without the LE niceties (such as using your TV remote to connect to a WiFi network, having a lot of plug-and-play options, and generally not needing a keyboard/mouse connected to your RPi ever, and all the other goodies).