Skip to content

Commit

Permalink
only use /dev_host in pure docker/OCI environments and not in the
Browse files Browse the repository at this point in the history
HA add-on.
  • Loading branch information
jens-maus committed Feb 19, 2021
1 parent 895d0b6 commit 8bb7371
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions buildroot-external/overlay/base/etc/init.d/S06InitSystem
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,21 @@ init_system() {
echo -n "storing user data in ${HOME_ASSISTANT_ADDON_DATA} (Home Assistant Add-On), "
mount -o bind "${HOME_ASSISTANT_ADDON_DATA}" /usr/local
fi
fi

# To avoid sharing the whole host /dev with the container we
# mount devtmps in /dev_host and symlink the necessary 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; do
ln -s "/dev_host/${device}" "/dev/${device}"
done
# remount /dev as rw to allow multimacd to create mmd_bidcos/mmd_hmip
# later on and unmount /dev_host on HA because not required.
mount -o rw,remount /dev
else
# docker/OCI environments
#
# To avoid sharing the whole host /dev with the container we
# mount devtmps in /dev_host and symlink the necessary 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; do
ln -s "/dev_host/${device}" "/dev/${device}"
done
fi
fi

fi
Expand Down

0 comments on commit 8bb7371

Please sign in to comment.