Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve /usr/local in Home Assistant - binding to /data #1094

Merged
merged 5 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildroot-external/board/oci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ if docker container inspect "${CCU_CONTAINER_NAME}" >/dev/null 2>&1; then
docker rm "${CCU_CONTAINER_NAME}" >/dev/null || true
fi

DOCKER_IMAGE="${CCU_OCI_REPO}:${CCU_OCI_TAG}"
if [[ "${CCU_DOCKER_PULL_REFRESH}" == "true" ]]; then
DOCKER_IMAGE="${CCU_OCI_REPO}:${CCU_OCI_TAG}"
echo "Pull/Update OCI image ${DOCKER_IMAGE}"
docker pull ${CCU_DOCKER_PULL_OPTIONS} ${DOCKER_IMAGE}
fi
Expand Down
25 changes: 18 additions & 7 deletions buildroot-external/overlay/base/etc/init.d/S06InitSystem
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,24 @@ init_system() {
mkdir -p /var/empty
chmod 0700 /var/empty

DEV_HOST="/dev_host"
if [ -d "${DEV_HOST}" ]; then
# To avoid sharing the whole host /dev with container it is mounted in a /dev_host
# This means we have to manually symlink the dynamic devices
for device in mmd_bidcos mmd_hmip usb; do
ln -s "${DEV_HOST}/${device}" "/dev/${device}"
done
if [[ "${HM_HOST}" == "oci" ]]; then

DEV_HOST="/dev_host"
if [ -d "${DEV_HOST}" ]; then
# To avoid sharing the whole host /dev with container it is mounted in a /dev_host
# This means we have to manually symlink the dynamic devices
for device in mmd_bidcos mmd_hmip usb; do
ln -s "${DEV_HOST}/${device}" "/dev/${device}"
done
fi

HOME_ASSISTANT_ADDON_DATA="/data"
if [ -n "${RUNNING_IN_HA}" ] && [ -f "${HOME_ASSISTANT_ADDON_DATA}/options.json" ]; then
# Home Assistant expects persinstent data to be stored in /data
echo "Storing user data in ${HOME_ASSISTANT_ADDON_DATA} (Home Assistant Add-On)"
mount -o bind ${HOME_ASSISTANT_ADDON_DATA} /usr/local
fi

fi

# create /media/usbX directories for automounting USB devices
Expand Down
4 changes: 4 additions & 0 deletions home-assistant-addon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

- [releases](https://github.com/jens-maus/RaspberryMatic/releases)
- [Development commits](https://github.com/jens-maus/RaspberryMatic/commits/master)
5 changes: 4 additions & 1 deletion home-assistant-addon/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
"environment": {
"RUNNING_IN_HA": "1"
},
"full_access": true
"full_access": true,
"privileged": [
"SYS_ADMIN"
]
}