diff --git a/Documentation/configuration.md b/Documentation/configuration.md index bf20966c7..84880db69 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -8,18 +8,20 @@ Format a USB stick with FAT32/EXT4/NTFS and name it `CONFIG`. Alternative you ca ```text network/ modules/ +modprobe/ udev/ authorized_keys timesyncd.conf hassos-xy.raucb ``` -- The `network` folder can contain any kind of NetworkManager connection files. For more information see [Network][network.md]. +- The `network` folder can contain any kind of NetworkManager connection files. For more information see [Network][network.md]. - The `modules` folder is for modules-load configuration files. +- The `modprobe` folder is for modules configuration files (/etc/modprobe.d) - The `udev` folder is for udev rules files. - The `authorized_keys` file activates debug SSH access on port `22222`. See [Debugging Hassio][debug-hassio]. - The `timesyncd.conf` file allow you to set different NTP servers. HassOS won't boot without correct working time servers! -- The `hassos-*.raucb` file is a firmware OTA update which will be installed. These can be found on on the [release][hassos-release] page. +- The `hassos-*.raucb` file is a firmware OTA update which will be installed. These can be found on on the [release][hassos-release] page. You can put this USB stick into the device and it will be read on startup. You can also trigger this process later over the API/UI or by calling `systemctl restart hassos-config` on the host. @@ -32,7 +34,7 @@ You can edit or create a `cmdline.txt` in your boot partition. That will be read ### Kernel-Module -The kernel module folder `/etc/modules-load.d` is persistent and you can add your configuration files there. See [Systemd modules load][systemd-modules]. +The kernel module folder `/etc/modules-load.d` is persistent and you can add your configuration files there. See [Systemd modules load][systemd-modules]. You can add the modules configuration files in `/etc/modprobe.d` that is also persistent. ### Udev rules diff --git a/buildroot-external/rootfs-overlay/etc/modprobe.d/.empty b/buildroot-external/rootfs-overlay/etc/modprobe.d/.empty new file mode 100644 index 000000000..e69de29bb diff --git a/buildroot-external/rootfs-overlay/etc/modules-load.d/.empty b/buildroot-external/rootfs-overlay/etc/modules-load.d/.empty new file mode 100644 index 000000000..e69de29bb diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/systemd-modules-load.service.d/hassos.conf b/buildroot-external/rootfs-overlay/etc/systemd/system/systemd-modules-load.service.d/hassos.conf index 3e1ee64cc..c490b62b8 100644 --- a/buildroot-external/rootfs-overlay/etc/systemd/system/systemd-modules-load.service.d/hassos.conf +++ b/buildroot-external/rootfs-overlay/etc/systemd/system/systemd-modules-load.service.d/hassos.conf @@ -1,2 +1,2 @@ [Unit] -RequiresMountsFor=/etc/modules-load.d +RequiresMountsFor=/etc/modules-load.d /etc/modprobe.d diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-modprobe.d.mount b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-modprobe.d.mount new file mode 100644 index 000000000..2854476d5 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/etc-modprobe.d.mount @@ -0,0 +1,14 @@ +[Unit] +Description=Kernel persistent modprobe.d +Requires=mnt-overlay.mount +After=mnt-overlay.mount +Before=systemd-modules-load.service hassos-config.service + +[Mount] +What=/mnt/overlay/etc/modprobe.d +Where=/etc/modprobe.d +Type=None +Options=bind + +[Install] +WantedBy=hassos-bind.target diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config index 5ae969a0a..08504c53b 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-config +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-config @@ -44,12 +44,21 @@ fi ## # Modules if [ -d "${CONFIG_DIR}/modules" ]; then - echo "[Info] Update Modules configuration!" + echo "[Info] Update Modules autoload!" rm -rf /etc/modules-load.d/* cp -f ${CONFIG_DIR}/modules/* /etc/modules-load.d/ fi +## +# Modules configuration +if [ -d "${CONFIG_DIR}/modprobe" ]; then + echo "[Info] Update Modules configuration!" + + rm -rf /etc/modprobe.d/* + cp -f ${CONFIG_DIR}/modprobe/* /etc/modprobe.d/ +fi + ## # Udev if [ -d "${CONFIG_DIR}/udev" ]; then