From patchwork Tue Mar 17 05:53:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 1256066 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::a39; helo=mail-vk1-xa39.google.com; envelope-from=swupdate+bncbctyrthe4edrbuolyhzqkgqeld5oosy@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=VCK1TCQF; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NL/3yewf; dkim-atps=neutral Received: from mail-vk1-xa39.google.com (mail-vk1-xa39.google.com [IPv6:2607:f8b0:4864:20::a39]) (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 48hMm64BcGz9sPR for ; Tue, 17 Mar 2020 16:53:24 +1100 (AEDT) Received: by mail-vk1-xa39.google.com with SMTP id e186sf8867810vkh.23 for ; Mon, 16 Mar 2020 22:53:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1584424401; cv=pass; d=google.com; s=arc-20160816; b=A4fF5/FFWvBHq7BXt57h9KISwgpkKaZI/g/FNbOyk1p6jw6SsMKb4FR3rEhoGu49nz 8yLmFvZYZdsJy4sLv19y4cXSEnR/V13PhFLi7G9xASd6pVFW0Sea3Ml3vFJfJytVLq7f L4RfZJhseZ8IyXciLvKJI98kDheEYD6rliPeWx452iWBxCVIdSxkVjTEML3xAk4L3JKb yJsz59qHeR7wiYGYpzGLru3HMEU7CKquHAQ6uDVWHB6QGsoF4RpGNIpvDyeHF1FXmog2 AosSP851kipMzDvax/ALG0pMVc9nn3cyAehxrIYp8M47rvdfWi79AYtqX827AWSJ+ggl X8ww== 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=MLekFwlGNt+9N47bCcdMv1xHcxnH/XTJN6k4aEBRqsY=; b=YD7uLixY5OjKuaOXpAdTCgUPtHiN2r8FHJVAW47Qp90hDIIX3zqUu1IQkA4iOEqACZ 6loJK1MC1QTZm9djVY9z2pWJxugtIQXsmZmNa+Acw21I4x33ecGr34z0Bx7Yk5JSOK9u e6QO2pcE1eDPO6LplN+8HOW8wxb3VLsCSlh1ytl9917M0v3EwV7Vna1eSe72DrfMiNlX 6FrGMhfSU+/iKxqI+DZdPd4EOvwn1Te8W6NG2hTcrIwokZLI3CYexH2+vZtci6qZ3CLy keey7C/42akt5V4A9fhwzXWfNEFo9seBp8+KgOUmFZH6Lswo+6KFg4zgJmPXsiEl78WT 5VOw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="nLn9B/n7"; spf=pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::1034 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=MLekFwlGNt+9N47bCcdMv1xHcxnH/XTJN6k4aEBRqsY=; b=VCK1TCQFAYn3T0mqFutL/q/8JIy/NlLWmTK7E4ysX9hT4JsariBv3K6EaWyt0HwJEW jEJ4ImxMW3yyD5fwH/3jlcCSdzcjj6zGjNH6beR/w2YisbGKayNPrFAxOnn/OUc5FknI cwGDieJubIVnttOKqIBPrEB0pNb18V7K4PacBqn3Ga5pe+yLSUTMfHaycrfUXqD3W3T9 CR6VrSXp9tH+dfGP8NZhhSyLisTiIdpingIf9FMQY1AqDfqM1JlQ3Bc9Ph2PQqaGtY6E B80xatkrCp2+U1Hycu18U1/8ehoVkA+VAO5cH14FZs6TE1IbG9Xp0fNLojNav6Z5n2it /lpg== 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=MLekFwlGNt+9N47bCcdMv1xHcxnH/XTJN6k4aEBRqsY=; b=NL/3yewfetmTs3Ub1aG6NAq0UJzyYYBbUfTOzzbg50G8Jt+kibInBlsce4ya68FOJr VBSWNxofGaM1h7vQWe4xhVaVjHcQ+tTgTxuUTQODixCgvrA5aogJJ29HSECw2K4WORfk w0N7L8iX83ZWg8bW1H3YStXG3eVkVnDoiHuw+yTj4wFA88NKCBTaxznWPPH8Sq9n+RVr 5TNSLWgiJy5XUlSEMOE1p7O0xvE8nn0WfBVuHvTDOF5FJAfmZI1MZ735erPd+JtPjPpZ 0iXNQT5bQVfIhFui5dy9fklRMsvU6KYBg6fNfwMxMEk4A0CIRCrT3aW2YV2FraKM56iU DOWA== 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=MLekFwlGNt+9N47bCcdMv1xHcxnH/XTJN6k4aEBRqsY=; b=FZsM9q6RxfOUhc2+EEfjSHGjaFPU3Q4wIiIWu0kJnwAfgkW/jVnmKbPw1ZQOItrdQK cxStUYG2p611AsFYom3ZNUB1lPRPa4EsSWo6S7d4Uv/xLKt7geNHbCD1aEtreWHAil+O xCngCQCps/vqA1ES/9ao/BXmJ8R6deGjAqLVwL2F8Oh5aj0E/8NKpWTcDoMyhqxV/fLD cj7h3CbQ8H2WbV1wMqKWastMgAs7OETu6vOxKiRd6Bug5j0wuCdXyhRJselzBzTZ0VO2 AbwWqU+I6lIOSr3L6aup/0rWpdApudYn0y0UAOoKmwQ80BYTRiOhNBqEM5HBdvXTXVtt Ucag== Sender: swupdate@googlegroups.com X-Gm-Message-State: ANhLgQ3xzFVc6xZ4BOwtwU2XeLaTvnPQKPM1qDtcVQltCmqHnQD5BKYi 6s5M7TjZum50PYJEk1BSKsE= X-Google-Smtp-Source: ADFU+vvHwpV3GD8eN8PBU4KWAeFjn755XyNqWjXh7Q2yjXUVYr8Oz4Nrto3uwrMCodEF5Kf8xU7kYg== X-Received: by 2002:a05:6102:2d8:: with SMTP id h24mr2513667vsh.39.1584424401384; Mon, 16 Mar 2020 22:53:21 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a67:ca1c:: with SMTP id z28ls903086vsk.4.gmail; Mon, 16 Mar 2020 22:53:20 -0700 (PDT) X-Received: by 2002:a67:7d03:: with SMTP id y3mr2274443vsc.129.1584424400718; Mon, 16 Mar 2020 22:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584424400; cv=none; d=google.com; s=arc-20160816; b=J4O9RZfJNfY8uu+MuOg0zdETMehJt879WPUvCeJ84qqRJU/TtSjv6p6RChTIzNdpSe N5KybOXyDivMFykJsq5GDWi4lXreq5zNO9pUm8CsalnhztgGgEtAZTo7Flh2gcwvRmox E9Ry/m15YoLwWZRZpq39jP50MTHvEyZuc6SG4JoBapnDHgYbeddKXQIbyVWugaXyw+iL bMHy4sapU3ymJpO2zVCDGCEdG9mpXcVqNLNVqnWQ9RIQ8deyRYMzhT028O2PVCJGvp4f 08mQDQbbT2/KqU8xind7G4g6kSvHRGe4ZBpuznqhaCIVg3P8VAaAqcd3bpYhLLDTeLQd 72ug== 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=xJLdZru+suuDzwPHgVKXzxDpK6JeRNJJTyejoPvMNN0=; b=RC2gkIRa05KuBdKWyX7H4USxi5orSVya6gYKA0wrtjcWeDMEIeei1tgxmJx3tYW7x1 uu/Glgn78pY65isgwPE6B0gOWgfuwQUxJCWCQe0kzmTHc8GIloPpEpmqc0OepMLMMovw ipoYStMD1vSE1qKuJ9Pm8msaQdhC9/wLPgsb0YTzCnYAXTX+J/NL/wYvmUOiKVJDY47a YH7QHkeYJpm58egJprKm76TklQ0bPgXsCVZiNEUg78GJ0y+aE/6ziFEBB5kMqRz83kpt y7cDJjMlrY+4LV+4f+Y7ReQ3jVtP3yXLN+mASMX5q5lorUxuiFOJEUOxtm+KeGVFfJtM M+xw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="nLn9B/n7"; spf=pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::1034 as permitted sender) smtp.mailfrom=raj.khem@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com. [2607:f8b0:4864:20::1034]) by gmr-mx.google.com with ESMTPS id s124si91330vka.1.2020.03.16.22.53.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Mar 2020 22:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::1034 as permitted sender) client-ip=2607:f8b0:4864:20::1034; Received: by mail-pj1-x1034.google.com with SMTP id v13so412743pjb.0 for ; Mon, 16 Mar 2020 22:53:20 -0700 (PDT) X-Received: by 2002:a17:902:eb49:: with SMTP id i9mr2732160pli.91.1584424399239; Mon, 16 Mar 2020 22:53:19 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::593]) by smtp.gmail.com with ESMTPSA id y143sm1641465pfb.22.2020.03.16.22.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 22:53:18 -0700 (PDT) From: Khem Raj To: swupdate@googlegroups.com Cc: Khem Raj Subject: [swupdate] [meta-swupdate][PATCH v2] swupdate: Fix build with mulilib builds Date: Mon, 16 Mar 2020 22:53:32 -0700 Message-Id: <20200317055332.2934768-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.25.1 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="nLn9B/n7"; spf=pass (google.com: domain of raj.khem@gmail.com designates 2607:f8b0:4864:20::1034 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 --- v2: Fix typo swupdate -> swupdate.sh in sed 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 2e20b88..2d45c52 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 \ @@ -210,15 +211,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