Skip to content

Commit

Permalink
rework data path to /usr/local mapping by using a somewhat newer
Browse files Browse the repository at this point in the history
possibility by HA to define the target path directly in config.yaml.
This allows to remove the S00DataMount init script to bind mount /data
to /usr/local as a workaround. This refs #2800.
  • Loading branch information
jens-maus committed Jul 9, 2024
1 parent 94b6368 commit 3c028af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 64 deletions.

This file was deleted.

31 changes: 19 additions & 12 deletions buildroot-external/overlay/base/etc/init.d/S01InitHost
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,25 @@ identify_host() {
}

init_host() {
# setup /dev_host for OCI/Docker and LXC environments (excluding HA)
if [[ "${HM_HOST}" =~ oci\|lxc ]] &&
[[ -z "${HM_RUNNING_IN_HA}" ]]; then
# To avoid sharing the whole host /dev with the container we
# mount devtmps in /dev_host and symlink the required devices
mount -o noatime -t devtmpfs devtmpfs /dev_host
if [[ -d "/dev_host" ]]; then
for device in raw-uart raw-uart1 eq3loop mmd_bidcos mmd_hmip usb rtc rtc0 rtc1; do
if [[ ! -e "/dev/${device}" ]]; then
ln -s "/dev_host/${device}" "/dev/${device}"
fi
done
# setup /dev_host for OCI/Docker and LXC environments
if [[ "${HM_HOST}" =~ oci\|lxc ]]; then
# when running in HA we just remount /dev to rw
if [[ -n "${HM_RUNNING_IN_HA}" ]]; then
# remount /dev as rw to allow multimacd to create
# mmd_bidcos/mmd_hmip later on
mount -o rw,remount /dev
else
# To avoid sharing the whole host /dev with the container we
# mount devtmps in /dev_host and symlink the required devices
# but not when running in HA
mount -o noatime -t devtmpfs devtmpfs /dev_host
if [[ -d "/dev_host" ]]; then
for device in raw-uart raw-uart1 eq3loop mmd_bidcos mmd_hmip usb rtc rtc0 rtc1; do
if [[ ! -e "/dev/${device}" ]]; then
ln -s "/dev_host/${device}" "/dev/${device}"
fi
done
fi
fi
fi
}
Expand Down
6 changes: 5 additions & 1 deletion home-assistant-addon-dev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ panel_title: RaspberryMatic (snapshot)
panel_icon: mdi:router-wireless
startup: services
map:
- backup:rw
- type: data
read_only: False

Check warning on line 20 in home-assistant-addon-dev/config.yaml

View workflow job for this annotation

GitHub Actions / Linter Checks

truthy value should be one of [false, true]
path: /usr/local
- type: backup
read_only: False

Check warning on line 23 in home-assistant-addon-dev/config.yaml

View workflow job for this annotation

GitHub Actions / Linter Checks

truthy value should be one of [false, true]
init: false
backup_pre: /bin/sh -c "/bin/echo 'load tclrega.so; rega system.Save()' | /bin/tclsh && /bin/sync"
backup_exclude:
Expand Down

0 comments on commit 3c028af

Please sign in to comment.