From df53f7d000b7660fd5e35b481b0bdf1ccc891e77 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Sun, 23 Oct 2016 17:47:40 -0200 Subject: [PATCH] dev-app:avahi: Do not hardcode network link Let the developer choose which interface to use in the soletta dev-app recipe. Signed-off-by: Flavio Ceolin --- recipes-soletta/dev-app/soletta-dev-app/soletta-dev-app-mac.sh | 3 +-- recipes-soletta/dev-app/soletta-dev-app_git.bb | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes-soletta/dev-app/soletta-dev-app/soletta-dev-app-mac.sh b/recipes-soletta/dev-app/soletta-dev-app/soletta-dev-app-mac.sh index ef111ae..cfde879 100644 --- a/recipes-soletta/dev-app/soletta-dev-app/soletta-dev-app-mac.sh +++ b/recipes-soletta/dev-app/soletta-dev-app/soletta-dev-app-mac.sh @@ -1,4 +1,3 @@ #! /bin/bash -INTERFACE="enp2s0" -MAC_ADDRESS=`ifconfig $INTERFACE | grep "HWaddr" | awk '{print $NF}'` +MAC_ADDRESS=`ifconfig INTERFACE | grep "HWaddr" | awk '{print $NF}'` sed -i "s@MACADDR@$MAC_ADDRESS@" /etc/avahi/services/soletta-dev-app.service diff --git a/recipes-soletta/dev-app/soletta-dev-app_git.bb b/recipes-soletta/dev-app/soletta-dev-app_git.bb index b23fae6..be44916 100644 --- a/recipes-soletta/dev-app/soletta-dev-app_git.bb +++ b/recipes-soletta/dev-app/soletta-dev-app_git.bb @@ -37,6 +37,8 @@ FILES_${PN} += " \ SYSTEMD_SERVICE_${PN} = "soletta-dev-app-server.service soletta-dev-app-avahi-discover.service" +SOLETTA_DEVAPP_INTERFACE ?= "enp2s0" + do_install() { install -d ${D}{INSTALLATION_PATH} install -d ${D}${INSTALLATION_PATH}soletta-dev-app @@ -58,4 +60,5 @@ do_install() { #Install set MAC address script install -m 0755 ${WORKDIR}/soletta-dev-app-mac.sh ${D}${INSTALLATION_PATH}soletta-dev-app/scripts/ + sed -i -e 's/INTERFACE/${SOLETTA_DEVAPP_INTERFACE}/g' ${D}${INSTALLATION_PATH}soletta-dev-app/scripts/soletta-dev-app-mac.sh }