From patchwork Wed Apr 1 02:52:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 1264995 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::43d; helo=mail-pf1-x43d.google.com; envelope-from=swupdate+bncbctyrthe4edrb3mdsd2akgqex5lndfi@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=DdxWmb+m; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XFwHJSNj; dkim-atps=neutral Received: from mail-pf1-x43d.google.com (mail-pf1-x43d.google.com [IPv6:2607:f8b0:4864:20::43d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48sW2T321bz9sPF for ; Wed, 1 Apr 2020 13:52:32 +1100 (AEDT) Received: by mail-pf1-x43d.google.com with SMTP id 71sf20274424pfu.1 for ; Tue, 31 Mar 2020 19:52:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1585709550; cv=pass; d=google.com; s=arc-20160816; b=p8+huzcZTuFGepUqFIYQcynCbYuyniAmQDu+3Z7cc317VIgHzP/2zxSQMDId7cJpXV o0Y0TCAuQv5kBXEMLdH+1TI+mVOnoWbCJOFIWuu1yQ7jZCra5uXuWzfZkakBaJyXYess worK+CxBzJ7aXkAnbn0pY9f/oCzjmWk9uabXGDXqZ/aihl/ApTesqUJJYA90Y+WTBhE0 y8AC2IUaoGMDuOZsFJJvI+Gr1K9ar0kBqMcTadXB+kryCTH5rcVDR+Dr9pyqzMV9GvNF KGKKi6U+YHesK0SQRmZrU32mgHDvaheTnuc0GdmnXj1PAsoLGy/UbpOy9VNtQigHN9Gv SHIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature:dkim-signature; bh=2GA6gfAbXgQJB5jD9kYY72EtxD6FVlZnrxRn6VwSMcQ=; b=kXYyJNBtQOERAC2cJtBQTIirk0jrlbLVToKLNJLM3ZlsN4FNi5ebtgoAkAGA6pcVGt 4vlK8vBxL7MgJlQV/PskZWR5+yHx6Q1EbNZuaaKQDkwilbI397a3vsjR5xzlkMg3oWgZ QrILw0ejyHbtWYhIKKGZSlNjT5nWmSZctsfSzoqvKeMqkGv2x+lJHX7lrJVKd0i++jVW ZTeeHsUGXGOMy9Snsci9WQTaOjEKuulXdzoiu3jJy0Utc+jUP/u4jK5bsRgkpMMLTfYD 6LWYzS9KLUYGbEgHewg5JDg7HeVS0uM6/Xdw12I27mjDZaB62rOJPb22v6sR8rOs2Mui 1giQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a0cNPYKc; spf=pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=raj.khem@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=2GA6gfAbXgQJB5jD9kYY72EtxD6FVlZnrxRn6VwSMcQ=; b=DdxWmb+mGs7QvfTuk2ncpqh7hpjlpB2jq34P8sHXabqXRP1iT0VriIGY+QtC+INw/0 mziD1yzD8SGPSgPp+XaeYAt6lLRPt2aeP0xFa1iKJnh28X9kGQ31bvQ6QB9Ax8mWbAYp 29ZplcJq8ovccYnT8aLaRo8gNg2nMqaXsMqTyua9zeekq2PuDu5/WtGnU2yMiCmpHYpC s2ppQKYzHV1LQF8PgSKVX5dU0HIWy0oiylAHdKshSCgpePVakO5X3wL3VP+kWsHkSY2u 32G/45dCaaFSf4x3QN4rnaxmFD1aQAQQbhRciyt9YdsdOVQ8GBko0UK7frIoMNcEH55w g+6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=2GA6gfAbXgQJB5jD9kYY72EtxD6FVlZnrxRn6VwSMcQ=; b=XFwHJSNjI9Dp48H4wTQ8m76lrMaIuwt4VR+uQmRpZpFXAGjZkEusbvqkTcm+P7EG6m dO2ap7Ut3cf7j6Fm+ssoZ0AWZLThPY6qcli2bfyXzyMhIviKpEEPNhE4fVuGRLriCXHv OY+G5kEKW1H6BOm1IHotupiJjRlr0yIxo9yJynAJjf43dXrjMarqeUytkhbtYx79UWsJ g7U6WxuGNPsMR/ie0/u53h3OMxAYxby5jb/8xfFfwdhj4pV4YgmI2jjvsn7JYIx7ZPXE QCQZS6OIOTYaqfWbUlwoh8+8P2f6YLisXYMy/kNuGNvku6EW6FJXM6XGSlCZtV+ZbQt+ bADA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=2GA6gfAbXgQJB5jD9kYY72EtxD6FVlZnrxRn6VwSMcQ=; b=rkQs6skbhSF2xi+UF/ypCbOCDSkDuFiemNIGraghnU611lF+yuF/RuN4Wb3NOMxIew v8omjj9pWYkbwZWgpdOc84t0TmmE/NNlW53Uk69JS+uFgZ8wAWWfafkvjT9a6Vb991j5 jGtKghbBlnoU122Kt+x2H0PT5BUOoI2LcpkDE5iL1sl9tE304nD/fnPsi8mELbrjAI3E g+WTUo7DxoJsLGqzh6DgV0o4jzIBWfYEVBCWEEBz83HLWjKLvoMz5bl6b3ZmR3rd9iXe 5MGj2xjFAwJCyNRMtKSt9LFnF2yW73OXZPCvqKAxmYj46tL9yxO8y6YeCWwKxex6z/Fo qFpA== Sender: swupdate@googlegroups.com X-Gm-Message-State: ANhLgQ0nJ00cApijktUobbeBbekKDtv62kiR05cFZoBLf7SAbaAR9/sO K3IgwF8kevi6w4jtEL/kw9U= X-Google-Smtp-Source: ADFU+vsiDu6kRj1Yug9WcV5ISr6efhNWFK6oDTIB7G4x2/Xqr0GLzFdtqjyyFRdvjPYfPaiCQCA9HQ== X-Received: by 2002:a62:7cc9:: with SMTP id x192mr22408824pfc.176.1585709549902; Tue, 31 Mar 2020 19:52:29 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6a00:c9:: with SMTP id e9ls14951444pfj.10.gmail; Tue, 31 Mar 2020 19:52:29 -0700 (PDT) X-Received: by 2002:a63:30c4:: with SMTP id w187mr21338227pgw.239.1585709549095; Tue, 31 Mar 2020 19:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585709549; cv=none; d=google.com; s=arc-20160816; b=l1i5u4WiGr+dqAEEqO7u0jg2mrVBiqetOqzfNasxV96KfAt+KTyXzpr7IvrFyAy322 wG53MyPJ7PFgw0TJq3/HSReUc4z2PEbsjU+WY9Xoe+PzV5Vcfig2hYh7+xJPbjUBNOSU zg+QA3XtnAOf4/xnk00aE1j2aQN8JTYr7Gx0hBKQrX82YNlctzVLDFGkgGw/R+3s1VJc qW8OzIXLvYh35O+ZuLNTjPXnSivKGU2z6vfcEGpmxQIehnE1cY7T/HayNYMe5YP2SS+4 dWwkDhZJ5gFhdSVlLQsBkXwmYr15QGuF1OH1s8lPSBOSMisfeJxgZvOf55LsisU4qAuo 2AuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ZiDgxFvbO8hERQ6V5bKd8xFGYK5KBoxKXmmRS0wxgcY=; b=04nID2HnhfB0Q5AgB5g7a6pr/1pW04pSuJCugNvdRr32DCFQ5Ujtb9NaBRurO8uBgC vAEAX3Tt288cua/fOW63V15kzQO1+GV3aeMphh7ECPggeRez4/o03p4dT1p7mIu0tThu BOBKZvKc91Q5bVCEnYP5P8glwPKlK+HMbkSZfcTA2ZjulQPrOi6AmVHttSeTwPvBZpw7 hE+K8yY5IygximNA/aYsxt2+mwAZ16USmLlPLausL8ZJCXMmSldjGAk1bhQ0N9Eu++35 JkFHRFaZFEDNEBC49LKlYRlSzZUmr7GP9tvxS3CkF8nvTWk7uWfd6A1J6XWmtAEz8HkK MurQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a0cNPYKc; spf=pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=raj.khem@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com. [2607:f8b0:4864:20::433]) by gmr-mx.google.com with ESMTPS id j14si43528pgg.1.2020.03.31.19.52.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2020 19:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::433 as permitted sender) client-ip=2607:f8b0:4864:20::433; Received: by mail-pf1-x433.google.com with SMTP id 23so11400076pfj.1 for ; Tue, 31 Mar 2020 19:52:29 -0700 (PDT) X-Received: by 2002:aa7:9f12:: with SMTP id g18mr20003630pfr.262.1585709548202; Tue, 31 Mar 2020 19:52:28 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::3e84]) by smtp.gmail.com with ESMTPSA id nh14sm381232pjb.17.2020.03.31.19.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 19:52:27 -0700 (PDT) From: Khem Raj To: swupdate@googlegroups.com Cc: Khem Raj Subject: [swupdate] [meta-swupdate][PATCH] swupdate: Fix build with mulilib builds Date: Tue, 31 Mar 2020 19:52:42 -0700 Message-Id: <20200401025242.2273841-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Original-Sender: raj.khem@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a0cNPYKc; spf=pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=raj.khem@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Khem Raj --- recipes-support/swupdate/swupdate.inc | 4 ++ ...LIBDIR-instead-of-hardcoding-usr-lib.patch | 50 +++++++++++++++++++ recipes-support/swupdate/swupdate/swupdate | 2 +- .../swupdate/swupdate/swupdate.service | 2 +- recipes-support/swupdate/swupdate/swupdate.sh | 4 +- 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 recipes-support/swupdate/swupdate/0001-build-Define-LIBDIR-instead-of-hardcoding-usr-lib.patch diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 1dfc035..50d8dc6 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" inherit cml1 update-rc.d systemd pkgconfig SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=https \ + file://0001-build-Define-LIBDIR-instead-of-hardcoding-usr-lib.patch \ file://defconfig \ file://swupdate \ file://swupdate.sh \ @@ -207,15 +208,18 @@ do_install () { install -d ${D}${sysconfdir}/init.d install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d + sed -i s:@libdir@:${libdir}:g ${D}${sysconfdir}/init.d/swupdate # shell based configuration loader allows to place code snippets into this folder install -d ${D}${libdir}/swupdate/conf.d install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate + sed -i s:@libdir@:${libdir}:g ${D}${libdir}/swupdate/swupdate.sh if ${SWUPDATE_MONGOOSE}; then install -m 644 ${WORKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/ fi install -d ${D}${systemd_unitdir}/system install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir} + sed -i s:@libdir@:${libdir}:g ${D}${systemd_system_unitdir}/swupdate.service install -m 644 ${WORKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \ -e "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \ diff --git a/recipes-support/swupdate/swupdate/0001-build-Define-LIBDIR-instead-of-hardcoding-usr-lib.patch b/recipes-support/swupdate/swupdate/0001-build-Define-LIBDIR-instead-of-hardcoding-usr-lib.patch new file mode 100644 index 0000000..3003fb1 --- /dev/null +++ b/recipes-support/swupdate/swupdate/0001-build-Define-LIBDIR-instead-of-hardcoding-usr-lib.patch @@ -0,0 +1,50 @@ +From 739eae75c4f82c654c5dc78a2c2fb17cf8448752 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 16 Mar 2020 19:41:45 -0700 +Subject: [PATCH] build: Define LIBDIR instead of hardcoding /usr/lib + +This helps swupdate build in multilib setup in yocto + +Signed-off-by: Khem Raj +--- + Makefile | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 943e013..37cfced 100644 +--- a/Makefile ++++ b/Makefile +@@ -38,6 +38,7 @@ ifndef KBUILD_VERBOSE + KBUILD_VERBOSE = 0 + endif + ++LIBDIR ?= "/usr/lib" + # kbuild supports saving output files in a separate directory. + # To locate output files in a separate directory two syntaxes are supported. + # In both cases the working directory must be the root of the kernel src. +@@ -448,7 +449,7 @@ ${tools-bins}: ${tools-objs} ${swupdate-libs} FORCE + install: all + install -d ${DESTDIR}/usr/bin + install -d ${DESTDIR}/usr/include +- install -d ${DESTDIR}/usr/lib ++ install -d ${DESTDIR}/${LIBDIR} + install -m 755 swupdate ${DESTDIR}/usr/bin + for i in ${tools-bins};do \ + install -m 755 $$i ${DESTDIR}/usr/bin; \ +@@ -456,10 +457,10 @@ install: all + install -m 0644 include/network_ipc.h ${DESTDIR}/usr/include + install -m 0644 include/swupdate_status.h ${DESTDIR}/usr/include + install -m 0644 include/progress_ipc.h ${DESTDIR}/usr/include +- install -m 0755 ipc/lib.a ${DESTDIR}/usr/lib/libswupdate.a ++ install -m 0755 ipc/lib.a ${DESTDIR}${LIBDIR}/libswupdate.a + if [ $(HAVE_LUA) = y ]; then \ +- install -d ${DESTDIR}/usr/lib/lua/$(LUAVER); \ +- install -m 0755 ${lua_swupdate} $(DESTDIR)/usr/lib/lua/$(LUAVER); \ ++ install -d ${DESTDIR}${LIBDIR}/lua/$(LUAVER); \ ++ install -m 0755 ${lua_swupdate} ${DESTDIR}${LIBDIR}/lua/$(LUAVER); \ + fi + + PHONY += run-tests +-- +2.25.1 + diff --git a/recipes-support/swupdate/swupdate/swupdate b/recipes-support/swupdate/swupdate/swupdate index 5ef894f..6b4097c 100644 --- a/recipes-support/swupdate/swupdate/swupdate +++ b/recipes-support/swupdate/swupdate/swupdate @@ -30,7 +30,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="swupdate" NAME="swupdate" -DAEMON=/usr/lib/swupdate/swupdate.sh +DAEMON=@libdir@/swupdate/swupdate.sh PIDFILE=/var/run/$NAME.pid . /etc/init.d/functions || exit 1 diff --git a/recipes-support/swupdate/swupdate/swupdate.service b/recipes-support/swupdate/swupdate/swupdate.service index a3d8d19..95bcee0 100644 --- a/recipes-support/swupdate/swupdate/swupdate.service +++ b/recipes-support/swupdate/swupdate/swupdate.service @@ -4,7 +4,7 @@ Documentation=https://github.com/sbabic/swupdate Documentation=https://sbabic.github.io/swupdate [Service] -ExecStart=/usr/lib/swupdate/swupdate.sh +ExecStart=@libdir@/swupdate/swupdate.sh KillMode=mixed [Install] diff --git a/recipes-support/swupdate/swupdate/swupdate.sh b/recipes-support/swupdate/swupdate/swupdate.sh index 8798e2d..86ba913 100644 --- a/recipes-support/swupdate/swupdate/swupdate.sh +++ b/recipes-support/swupdate/swupdate/swupdate.sh @@ -8,11 +8,11 @@ SWUPDATE_SURICATTA_ARGS="" # source all files from /etc/swupdate/conf.d and /usr/lib/swupdate/conf.d/ # A file found in /etc replaces the same file in /usr -for f in `(test -d /usr/lib/swupdate/conf.d/ && ls -1 /usr/lib/swupdate/conf.d/; test -d /etc/swupdate/conf.d && ls -1 /etc/swupdate/conf.d) | sort -u`; do +for f in `(test -d @libdir@/swupdate/conf.d/ && ls -1 @libdir@/swupdate/conf.d/; test -d /etc/swupdate/conf.d && ls -1 /etc/swupdate/conf.d) | sort -u`; do if [ -f /etc/swupdate/conf.d/$f ]; then . /etc/swupdate/conf.d/$f else - . /usr/lib/swupdate/conf.d/$f + . @libdir@/swupdate/conf.d/$f fi done