diff --git a/buildroot-external/overlay/base/etc/init.d/S01InitHost b/buildroot-external/overlay/base/etc/init.d/S01InitHost index 6d140a7f54..539872ba1a 100755 --- a/buildroot-external/overlay/base/etc/init.d/S01InitHost +++ b/buildroot-external/overlay/base/etc/init.d/S01InitHost @@ -206,6 +206,23 @@ identify_host() { fi } +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 + fi + fi +} + start() { echo -n "Identifying host system: " @@ -219,6 +236,9 @@ start() { # run identify routine identify_host + # run init host routine + init_host + # save all HM_ env variables set | grep '^HM_' >/var/hm_mode diff --git a/buildroot-external/overlay/base/etc/init.d/S06InitSystem b/buildroot-external/overlay/base/etc/init.d/S06InitSystem index c3d281b77b..e742290d69 100755 --- a/buildroot-external/overlay/base/etc/init.d/S06InitSystem +++ b/buildroot-external/overlay/base/etc/init.d/S06InitSystem @@ -33,21 +33,6 @@ init_system() { mkdir -p /var/empty chmod 0700 /var/empty - # 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; do - if [[ ! -e "/dev/${device}" ]]; then - ln -s "/dev_host/${device}" "/dev/${device}" - fi - done - fi - fi - # create /media/usbX directories for automounting USB devices for i in $(seq 1 8); do mkdir -p "/media/usb${i}"