From 4a33487477ff4cdd474d2e64e7eaaa496f4af71d Mon Sep 17 00:00:00 2001 From: pvizeli Date: Mon, 20 Mar 2017 17:15:55 +0100 Subject: [PATCH] cleanup --- .../docker-resin-supervisor-disk.bbappend | 13 +++---------- .../docker-resin-supervisor-disk/hassio.conf | 1 - .../start-resin-supervisor | 1 - .../docker-resin-supervisor-disk/supervisor.conf | 5 +++++ .../recipes-support/resinhub/resinhub.bbappend | 15 --------------- .../resinhub/resinhub/resinhub.conf | 1 - .../recipes-support/resinhup/resinhup.bbappend | 2 ++ .../resinhup}/run-resinhup.sh | 5 ++--- supervisor/Dockerfile | 8 ++++---- 9 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/hassio.conf create mode 100644 meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/supervisor.conf delete mode 100644 meta-hassio/recipes-support/resinhub/resinhub.bbappend delete mode 100644 meta-hassio/recipes-support/resinhub/resinhub/resinhub.conf create mode 100644 meta-hassio/recipes-support/resinhup/resinhup.bbappend rename meta-hassio/recipes-support/{resinhub/resinhub => resinhup/resinhup}/run-resinhup.sh (98%) diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend index fcf876335..26306dd5e 100644 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend +++ b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend @@ -13,15 +13,8 @@ SUPERVISOR_TAG = "${HASSIO_SUPERVISOR_TAG}" TARGET_REPOSITORY = "${SUPERVISOR_REPOSITORY}" TARGET_TAG = "${SUPERVISOR_TAG}" -SRC_URI += " \ - file://hassio.conf \ - " - -FILES_${PN} += " \ - ${sysconfdir} \ - " - do_install_append () { - install -m 0755 ${WORKDIR}/hassio.conf ${D}${sysconfdir}/ - sed -i -e 's:@HOMEASSISTANT_REPOSITORY@:${HOMEASSISTANT_REPOSITORY}:g' ${D}${sysconfdir}/hassio.conf + install -d ${D}${sysconfdir}/resin-supervisor + sed -i -e 's:@HOMEASSISTANT_REPOSITORY@:${HOMEASSISTANT_REPOSITORY}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf + sed -i -e 's:@MACHINE@:${MACHINE}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf } diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/hassio.conf b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/hassio.conf deleted file mode 100644 index 8b121bbe9..000000000 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/hassio.conf +++ /dev/null @@ -1 +0,0 @@ -HOMEASSISTANT_REPOSITORY=@HOMEASSISTANT_REPOSITORY@ diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor index 0fb2269a1..124105672 100644 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor +++ b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor @@ -1,7 +1,6 @@ #!/bin/sh -e source /usr/sbin/resin-vars -source /etc/hassio.conf SUPERVISOR_IMAGE_ID=$(docker inspect --format='{{.Id}}' $SUPERVISOR_IMAGE) SUPERVISOR_CONTAINER_IMAGE_ID=$(docker inspect --format='{{.Image}}' resin_supervisor || echo "") diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/supervisor.conf b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/supervisor.conf new file mode 100644 index 000000000..5e555dda0 --- /dev/null +++ b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/supervisor.conf @@ -0,0 +1,5 @@ +SUPERVISOR_IMAGE=@SUPERVISOR_REPOSITORY@ +SUPERVISOR_TAG=@SUPERVISOR_TAG@ +LED_FILE=@LED_FILE@ +MACHINE=@MACHINE@ +HOMEASSISTANT_REPOSITORY=@HOMEASSISTANT_REPOSITORY@ diff --git a/meta-hassio/recipes-support/resinhub/resinhub.bbappend b/meta-hassio/recipes-support/resinhub/resinhub.bbappend deleted file mode 100644 index eb41a983b..000000000 --- a/meta-hassio/recipes-support/resinhub/resinhub.bbappend +++ /dev/null @@ -1,15 +0,0 @@ - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += " \ - file://resinhub.conf \ - " - -FILES_${PN} += " \ - ${sysconfdir} \ - " - -do_install_append () { - install -m 0755 ${WORKDIR}/resinhub.conf ${D}${sysconfdir}/ - sed -i -e 's:@RESINHUB_MACHINE@:${MACHINE}:g' ${D}${sysconfdir}/resinhub.conf -} diff --git a/meta-hassio/recipes-support/resinhub/resinhub/resinhub.conf b/meta-hassio/recipes-support/resinhub/resinhub/resinhub.conf deleted file mode 100644 index 5fac88b88..000000000 --- a/meta-hassio/recipes-support/resinhub/resinhub/resinhub.conf +++ /dev/null @@ -1 +0,0 @@ -RESINHUB_MACHINE=@RESINHUB_MACHINE@ diff --git a/meta-hassio/recipes-support/resinhup/resinhup.bbappend b/meta-hassio/recipes-support/resinhup/resinhup.bbappend new file mode 100644 index 000000000..6b2ba6fc5 --- /dev/null +++ b/meta-hassio/recipes-support/resinhup/resinhup.bbappend @@ -0,0 +1,2 @@ + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-hassio/recipes-support/resinhub/resinhub/run-resinhup.sh b/meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh similarity index 98% rename from meta-hassio/recipes-support/resinhub/resinhub/run-resinhup.sh rename to meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh index e260eefb5..407ec55f9 100644 --- a/meta-hassio/recipes-support/resinhub/resinhub/run-resinhup.sh +++ b/meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh @@ -235,10 +235,9 @@ else fi # Detect slug -source /etc/resinhub.conf -slug=$RESINHUB_MACHINE +slug=$MACHINE if [ -z $slug ]; then - log ERROR "Can't detect slug from /etc/resinhub.conf" + log ERROR "Can't detect slug from /etc/resin-supervisor/supervisor.conf ." else log "Detected slug: $slug ." fi diff --git a/supervisor/Dockerfile b/supervisor/Dockerfile index 459143ac0..78d3c399f 100644 --- a/supervisor/Dockerfile +++ b/supervisor/Dockerfile @@ -14,7 +14,7 @@ ENV LANG C.UTF-8 RUN apk add --no-cache python3 git # install aiohttp -RUN pip3 install pip --no-cache --upgrade \ - && pip3 install --no-cache aiohttp \ - && pip3 install --no-cache docker \ - && pip3 install --no-cache colorlog +RUN pip3 install pip --no-cache-dir --upgrade \ + && pip3 install --no-cache-dir aiohttp \ + && pip3 install --no-cache-dir docker \ + && pip3 install --no-cache-dir colorlog