From patchwork Tue Feb 5 10:49:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1036615 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Jqlyx82X"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43v1dc4YX1z9sMx for ; Tue, 5 Feb 2019 21:53:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D356330CA1; Tue, 5 Feb 2019 10:53:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZDP36qCEf6WW; Tue, 5 Feb 2019 10:53:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C3C54226AF; Tue, 5 Feb 2019 10:53:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7F8111BF95C for ; Tue, 5 Feb 2019 10:50:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7A2968739D for ; Tue, 5 Feb 2019 10:50:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5kIL4OnqmHWI for ; Tue, 5 Feb 2019 10:50:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 125D1879EE for ; Tue, 5 Feb 2019 10:50:09 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id z15so1021344wrn.1 for ; Tue, 05 Feb 2019 02:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nr1nHQB7TxAsZZKrD6mRO/I5Qw4koKu0NGN2Q3k46Og=; b=Jqlyx82Xnmqb+yl0bpfiPGB/aHinCVNMhlOmLLbMuOQ0pZIMMCoJoepbMlVRWDyQ/0 xsit6Zd8Gdmc9EGb9F6s8k7Gccmagfgxk+iMq9dRu0FpMNFZCgP7NLCSuYOdZ1/7OESl eHxTVYdqSeNx+nvtwqBmIP1Rb8V59d7ipH+DQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nr1nHQB7TxAsZZKrD6mRO/I5Qw4koKu0NGN2Q3k46Og=; b=QezHHJYRezEJgn/6WQgrU9yWOBkNf6d0U77E/5NCjeinzFswQtavdySFKW8v4z860D IuUBi4a77Lc8XOf7u+XA0Q2GODLrIIk3kFiVt/ZOdUx4VMl9SF8zwXmZpqyJSW5U+diB cm2BWhO7oNPoAR1Jel1ueasqv548Qfxs6xF9Sw4GbMGUzYMocBt9nMLJUXzzTgycktLI hsr+zrS6vcBxCU3zBDc2mYVwLPBeibuKh52SJrk5riJ8y9EA/sYgbUKEGwzuCsDO19mK XsX6pkQ2oJy7IjC0+xWhnDqv7XDJQwzjNUclSDV0ZfTwAv8QmpyniVFQXk/KwmW0oLRc zxBQ== X-Gm-Message-State: AHQUAubRzvOBJdmKNvE9dxM3cGtiSZgiLlH8jwTx7CJFbssYXmkPTHWm oDC0WYRuytZ4hB3P9kVKUhCneSBhYrBHFw== X-Google-Smtp-Source: AHgI3IbFNDF6AabrBb/BydQxDxSSFjNTimI9JhVvpSOpsRYGcovv9Y7AjsGZCM+MxdakDDUl+f2Yuw== X-Received: by 2002:a5d:4fcb:: with SMTP id h11mr3165220wrw.139.1549363807165; Tue, 05 Feb 2019 02:50:07 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:3c25:d51f:f59f:7d82]) by smtp.gmail.com with ESMTPSA id y138sm20114681wmc.16.2019.02.05.02.50.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Feb 2019 02:50:06 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Feb 2019 11:49:55 +0100 Message-Id: <1549363799-30840-2-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> References: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 1/5] package/mender: adding a writable location X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Mender needs /var/lib/mender to be writable at the service start, the path is hardcoded and thus we cannot change it. This patch solves the problem using the same approach we have for dropbear. Signed-off-by: Angelo Compagnucci Reviewed-by: "Yann E. MORIN" Acked-by: --- package/mender/mender.mk | 2 ++ package/mender/mender.service | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package/mender/mender.mk b/package/mender/mender.mk index a5cece7..3203df8 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -49,6 +49,8 @@ define MENDER_INSTALL_CONFIG_FILES $(INSTALL) -D -m 0755 $(@D)/support/mender-inventory-$(f) \ $(TARGET_DIR)/usr/share/mender/inventory/mender-inventory-$(f) ) + + ln -snf /var/run/mender $(TARGET_DIR)/var/lib/mender endef MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES diff --git a/package/mender/mender.service b/package/mender/mender.service index 9ede55a..8b60a4f 100644 --- a/package/mender/mender.service +++ b/package/mender/mender.service @@ -6,7 +6,17 @@ After=systemd-resolved.service Type=idle User=root Group=root -ExecStartPre=/bin/mkdir -p -m 0700 /data/mender +ExecStartPre=/bin/sh -c '\ +if [ -L /var/lib/mender \ + -a "$(readlink /var/lib/mender)" = "/var/run/mender" ]; then \ + if rm -f /var/lib/mender >/dev/null 2>&1; then \ + mkdir -p /var/lib/mender; \ + else \ + echo "No persistent location to store mender data. Data will be lost\ + echo "at reboot. Are you sure this is what you want to do?"; \ + mkdir -p "$(readlink /var/lib/mender)"; \ + fi; \ +fi' ExecStart=/usr/bin/mender -daemon Restart=on-abort From patchwork Tue Feb 5 10:49:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1036617 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="fkHSSOEJ"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43v1dj2lRKz9sMl for ; Tue, 5 Feb 2019 21:53:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E9CA530C94; Tue, 5 Feb 2019 10:53:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HnnEKPby8WLv; Tue, 5 Feb 2019 10:53:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DE0D130CC6; Tue, 5 Feb 2019 10:53:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6BA871BF283 for ; Tue, 5 Feb 2019 10:52:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AF17F81FB1 for ; Tue, 5 Feb 2019 10:52:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zIMpZSO1GoWu for ; Tue, 5 Feb 2019 10:52:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 808A5884E6 for ; Tue, 5 Feb 2019 10:50:10 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id f188so3058489wmf.5 for ; Tue, 05 Feb 2019 02:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AyVTzy3J0ap+IPEBdPyRE0ZM4IfzSvOp7WrVQHZe5C4=; b=fkHSSOEJJFYgJR0VJrlX9mDLe/D26GWZUZJOySw2GV3qPLYmFQQU9BnMXMGdHW1dmW nrfdaTS/P+/YNyyckg6EWhNuK1+xMeEjt5lP+0TlXk+cpcgIYFNWDMUUcGEJHfFV/C7F 8LSqW6j0zeag89b8hcoyJIbzCRob9FwYjbHEo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AyVTzy3J0ap+IPEBdPyRE0ZM4IfzSvOp7WrVQHZe5C4=; b=cDM1GJEZ2gSEoW+mbP0M+fyTQCLDXh4+VrH+ajk6dUppO+2YW/HGKTRmW+V18Sc3ul tnK6GaMj0eoXV0ek+DWX+KRqgp2ymKS3BbEzRN6NeL49AD1H3siGA7xGI6vaAKe09/h6 MwYdQHr8cWlreUVw9VnI9tYj5wfFGcZAPWeNccKfuafWBQNzg3XH6zbJaMvf6/w2rKiH dVKi/MA6HVJymVszfpB3r9iBBc+2Vq5QKUnvB5VeO4ZNus0zJdOPzZF+5OvNwoQcExiC EE8x6MA+lHYc+SYJDu9PuySAxfJeWTikrHGEiYiQi9EFlvxno3qrHw1SUacLdWf7s8Zr mF2g== X-Gm-Message-State: AHQUAuYoemH5klBeskbreaT8qd89ozV3MGOFaHYnpyvGH86YV10f3kgu oxAeLjy5YE3Lmju8uchMVlb22GFLKOyxXg== X-Google-Smtp-Source: AHgI3IbNcdaVMUjJQerVKtcOtZqkOekFRcDgDgAT91q5L3wj9sU1t88cqdVDpntAsNOXyvsMuiykOQ== X-Received: by 2002:a7b:c191:: with SMTP id y17mr3201243wmi.60.1549363808604; Tue, 05 Feb 2019 02:50:08 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:3c25:d51f:f59f:7d82]) by smtp.gmail.com with ESMTPSA id y138sm20114681wmc.16.2019.02.05.02.50.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Feb 2019 02:50:07 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Feb 2019 11:49:56 +0100 Message-Id: <1549363799-30840-3-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> References: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 2/5] package/mender: adding systemv init file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch adds a service file for the init system v. Signed-off-by: Angelo Compagnucci Acked-by: Reviewed-by: Titouan Christophe --- [v2 -> v3]: * Moved the service to s42 to have the network ready before running Mender as pointed out by Titouan package/mender/S42mender | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ package/mender/mender.mk | 5 +++++ 2 files changed, 61 insertions(+) create mode 100644 package/mender/S42mender diff --git a/package/mender/S42mender b/package/mender/S42mender new file mode 100644 index 0000000..d5266aa --- /dev/null +++ b/package/mender/S42mender @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Starts mender service. +# + +start() { + # If /var/lib/mender is a symlink to /var/run/mender, and + # - the filesystem is RO (i.e. we can not rm the symlink), + # create the directory pointed to by the symlink. + # - the filesystem is RW (i.e. we can rm the symlink), + # replace the symlink with an actual directory + if [ -L /var/lib/mender \ + -a "$(readlink /var/lib/mender)" = "/var/run/mender" ] + then + if rm -f /var/lib/mender >/dev/null 2>&1; then + mkdir -p /var/lib/mender + else + echo "No persistent location to store mender data. Data will be lost" + echo "at reboot. Are you sure this is what you want to do?" + mkdir -p "$(readlink /var/lib/mender)" + fi + fi + + printf "Starting mender service: " + umask 077 + + start-stop-daemon -S -q -p /var/run/mender.pid \ + --exec /usr/bin/mender -- -daemon + [ $? = 0 ] && echo "OK" || echo "FAIL" +} +stop() { + printf "Stopping mender mender: " + start-stop-daemon -K -q -p /var/run/mender.pid + [ $? = 0 ] && echo "OK" || echo "FAIL" +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/mender/mender.mk b/package/mender/mender.mk index 3203df8..dc4a73b 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -63,4 +63,9 @@ define MENDER_INSTALL_INIT_SYSTEMD $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mender.service endef +define MENDER_INSTALL_INIT_SYSV + $(INSTALL) -D -m 755 package/mender/S04mender \ + $(TARGET_DIR)/etc/init.d/S04mender +endef + $(eval $(golang-package)) From patchwork Tue Feb 5 10:49:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1036618 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Fva1lAem"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43v1dj6BLtz9sMp for ; Tue, 5 Feb 2019 21:53:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AF8A687B6B; Tue, 5 Feb 2019 10:53:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9v2pmQGosf4J; Tue, 5 Feb 2019 10:53:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A876C87AA1; Tue, 5 Feb 2019 10:53:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id DC5B61BF283 for ; Tue, 5 Feb 2019 10:52:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CA34C81EB5 for ; Tue, 5 Feb 2019 10:52:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0wRQuVy2EJSe for ; Tue, 5 Feb 2019 10:52:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by hemlock.osuosl.org (Postfix) with ESMTPS id 22E59884E8 for ; Tue, 5 Feb 2019 10:50:12 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id a16so3109591wrv.0 for ; Tue, 05 Feb 2019 02:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rguSAYhfefx6F1N/SJVY+XMiyRhRJz6NA32Z1bDck1c=; b=Fva1lAemTVx2zuWiZbXhA3UUjLK2T24bUTWbMa0SwE+WlRxXrIZDn1dhpQlzuC3Q07 wzeFBZ90yjkk8fFFAt8HMyf7ygW+VL6kprZrHC8bXK4txniKiXlPZ87mURu4JJjlWceZ dQHvXoxhZ5+yfTgwGWPToJayP0KuB3/aZ8y+o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rguSAYhfefx6F1N/SJVY+XMiyRhRJz6NA32Z1bDck1c=; b=CkKpKZjxFHDTPc2tUtG2tWSzYPleptDMKiFBZWdNyINfZ2AIFJ+PGirAsde1ELoimT /KctmlU5iMtrF9onVcyt0u6HCSN1+0xJKDCK2LQl99VE2qcTRAjRWbC3nm4Hqbwpn1R4 c/qTUTDnrE/01CajOGRdIj3di2ZZGH5jyQTciEnwvNLAPjZ/ySjSUv2rDbwcEwmnkGRI fsX/bxvqf21JbX3KJ/lPkXxeUWQoW1um+Pnf8ANRzR/uvyKad5t4FWU/reGqDNhXWKwF iS/OiB4X4dsKN2dwarLl9l7OcYzJlDJw5I9vnds23Rj21mYtAN3C3K5e8KtlWAG5mXp+ hR7w== X-Gm-Message-State: AHQUAub7zk80Nrh2hfGjCfMjT9eK5CsbP79TpcuTtapCid5lg7iLw2Gk Sa7ieF4MssuUs/UQD+2bjv00o6YhAN3bWg== X-Google-Smtp-Source: AHgI3IbhznMwQaIL1lSNsQ9OVvPsSAgpQR8qw7vRp8hjMbf7Hka3cBNnTVzgADb8dOBqDByyZQ/q2Q== X-Received: by 2002:adf:9226:: with SMTP id 35mr3122760wrj.61.1549363810210; Tue, 05 Feb 2019 02:50:10 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:3c25:d51f:f59f:7d82]) by smtp.gmail.com with ESMTPSA id y138sm20114681wmc.16.2019.02.05.02.50.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Feb 2019 02:50:09 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Feb 2019 11:49:57 +0100 Message-Id: <1549363799-30840-4-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> References: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 3/5] package/mender: adding artifact_info file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to have the mender package working out of the box, the /etc/mender/artifact_info should be present and should contain a valid artifact_name value. This patch provides a default file that can be overridden easily from an overlay. Signed-off-by: Angelo Compagnucci Acked-by: --- package/mender/artifact_info | 1 + package/mender/mender.mk | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 package/mender/artifact_info diff --git a/package/mender/artifact_info b/package/mender/artifact_info new file mode 100644 index 0000000..1c84b08 --- /dev/null +++ b/package/mender/artifact_info @@ -0,0 +1 @@ +artifact_name=BUILDROOT_ARTIFACT diff --git a/package/mender/mender.mk b/package/mender/mender.mk index dc4a73b..0377270 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -50,6 +50,9 @@ define MENDER_INSTALL_CONFIG_FILES $(TARGET_DIR)/usr/share/mender/inventory/mender-inventory-$(f) ) + $(INSTALL) -D -m 0755 package/mender/artifact_info \ + $(TARGET_DIR)/etc/mender/artifact_info + ln -snf /var/run/mender $(TARGET_DIR)/var/lib/mender endef From patchwork Tue Feb 5 10:49:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1036620 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="ojv78Z/+"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43v1fF5008z9sMl for ; Tue, 5 Feb 2019 21:53:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0952587E43; Tue, 5 Feb 2019 10:53:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JHpR4kuFjIEU; Tue, 5 Feb 2019 10:53:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E42978777C; Tue, 5 Feb 2019 10:53:45 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DC8FD1BF968 for ; Tue, 5 Feb 2019 10:53:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3000A851AD for ; Tue, 5 Feb 2019 10:53:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z32Cr6BvqsRZ for ; Tue, 5 Feb 2019 10:53:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6F8D0862DB for ; Tue, 5 Feb 2019 10:50:13 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id d15so3067716wmb.3 for ; Tue, 05 Feb 2019 02:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tGRKNBGZmFcUC2bCNlvnRZ/9uzFlJ/oaIz/NfXLYwcM=; b=ojv78Z/+KXdQbj2Jd3coMBanfZM7iJXp0Mg0PtPUOdMvBm4sGkstsQ1rK5tYCbIU2p K0B/1nhnQMdvuIb7ngxgvx4u3B3FjTpUHMdIixqJHG2vzow25edwhMkoFgUUnTBAjYSk qmI50V3cwaREE81n8/V80mxBFALME2nM5/6xU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tGRKNBGZmFcUC2bCNlvnRZ/9uzFlJ/oaIz/NfXLYwcM=; b=FVLL6/Z99dgNfmDuZFZW1yKBId5zsu0WhgrlJEYOrOE9D0l11xm9hbNnSm3mh0Tn1b FbX4jAtQeQNZrKmYThwsgjge+zBYTERa6/K428h31GT/6xbBHHiWyY55zRqIblZ3zx7t Hl0pvWLgdpIHUJdc7hDRbd0A+w77FGWXyZscWmKH/jRgcikhzSuxBf5x3fTnJo391gTn wdKd5CgIj/g10g6gaxA3T9hoFPVlHciGcd7Wti4BW5jcrxo7pJdzqZAVUyAzUm16px9g 3SRhAH1t0IJujfE9BMEA694yTiBytXz2lOpeub/dQRuh+8ka1wAjt0qay1QXGe6G51Vi Ozdw== X-Gm-Message-State: AHQUAubiNIVb8eLq4vGFUmL7jKEcYvMymSinp4JoDKDwoDeZcM211Ru0 JZqrthwYuLMuTFWFzQWXwW3td0RCuTKUyA== X-Google-Smtp-Source: AHgI3Ib0nBL6ZG9nARmi5lHBgho2YxR6z6wAaI8fb+oeDKriVXzIQX2pAYC6BvMIwZw9mJvGE8CE9g== X-Received: by 2002:a1c:ac85:: with SMTP id v127mr2911258wme.62.1549363811494; Tue, 05 Feb 2019 02:50:11 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:3c25:d51f:f59f:7d82]) by smtp.gmail.com with ESMTPSA id y138sm20114681wmc.16.2019.02.05.02.50.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Feb 2019 02:50:10 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Feb 2019 11:49:58 +0100 Message-Id: <1549363799-30840-5-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> References: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 4/5] package/mender: adding device_type file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to have the mender package working out of the box, the /etc/mender/device_type should be present and should contain a valid device_type value. This patch provides a default file that can be overridden easily from an overlay. Signed-off-by: Angelo Compagnucci Acked-by: --- package/mender/device_type | 1 + package/mender/mender.mk | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 package/mender/device_type diff --git a/package/mender/device_type b/package/mender/device_type new file mode 100644 index 0000000..a097ef2 --- /dev/null +++ b/package/mender/device_type @@ -0,0 +1 @@ +device_type=BUILDROOT_DEVICE diff --git a/package/mender/mender.mk b/package/mender/mender.mk index 0377270..0d71938 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -53,6 +53,9 @@ define MENDER_INSTALL_CONFIG_FILES $(INSTALL) -D -m 0755 package/mender/artifact_info \ $(TARGET_DIR)/etc/mender/artifact_info + $(INSTALL) -D -m 0755 package/mender/device_type \ + $(TARGET_DIR)/etc/mender/device_type + ln -snf /var/run/mender $(TARGET_DIR)/var/lib/mender endef From patchwork Tue Feb 5 10:49:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1036619 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Loel/LsI"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43v1f061Xhz9sMl for ; Tue, 5 Feb 2019 21:53:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0B50E884E6; Tue, 5 Feb 2019 10:53:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xIy-FcvPJdFw; Tue, 5 Feb 2019 10:53:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 753AF8778F; Tue, 5 Feb 2019 10:53:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6BAD81BF95C for ; Tue, 5 Feb 2019 10:52:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id BEDB484173 for ; Tue, 5 Feb 2019 10:52:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zsSsL6SYriIv for ; Tue, 5 Feb 2019 10:52:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 601E3884EA for ; Tue, 5 Feb 2019 10:50:15 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id m22so3100348wml.3 for ; Tue, 05 Feb 2019 02:50:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VrFoyO3aN++w3h/0V9ZcYXDjj1d/8SZlrZPc/QdSiSk=; b=Loel/LsITQkMiCoZiwHMDAWeP2vDXuxYsVyPsPTbf0yqX+cHnKEVOA59/AxrFCFhu/ zZnHIfWVRIPrw27a/lakD6D1wDvT4gqBEElr89LgjCVGLh7RF4vdREse3GYlB5k/kbrN 0FSiBK0m4C45R9rJnBBnE8F/eNezMOG18f/jo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VrFoyO3aN++w3h/0V9ZcYXDjj1d/8SZlrZPc/QdSiSk=; b=SEfUyW1OBn4cmbTdACm2bqWvjbKpim6GK4IXx93v/PXJ1ZdjtjdfdFoJg4d49gQF47 EVU5XnX1P76DuXoebX63wcI4nsrmLgcra2slZgJnJzQdyWwxfAm0CRX5EzwAlzDVM65J jZoBVvLqODz9quYuBQpTjz8RWRLpziF3TAbuMw32TGHrxCYtwxQh3PfCQRdqkf+Gfszc ao+6TIjhY0rZ+BrPsKZJew1Lz3dSJCjsaXyOHJ+X/Q6Lemg7Bx+NArx3LEJ0mCSvt6+x g2nYZc43XBvrDSrW6+wuuGFTVrDDoyydVaCNcJumStGcl60+PPP9U6saS3B+9uLz3lqO fAWw== X-Gm-Message-State: AHQUAuaB0AyU5GofZRVsceAqjcQwlk0LPi2KTtOVsF2W8sz3sXIHDSRl yafOVeYbkdECN2meI4bzUlZ6Cw2nhkXOZQ== X-Google-Smtp-Source: AHgI3Ia4gM/LS69rSBWSW2Eed79B9omebe1SnfxFMLCqx1N64Ujmdi0O1VhkOzurH84DgvK/4+YewQ== X-Received: by 2002:a1c:2c6:: with SMTP id 189mr3118262wmc.21.1549363813221; Tue, 05 Feb 2019 02:50:13 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:3c25:d51f:f59f:7d82]) by smtp.gmail.com with ESMTPSA id y138sm20114681wmc.16.2019.02.05.02.50.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Feb 2019 02:50:11 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Feb 2019 11:49:59 +0100 Message-Id: <1549363799-30840-6-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> References: <1549363799-30840-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 5/5] package/mender: adding a readme file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch adds a readme file with basic instructions to get mender up and running on a production system. Signed-off-by: Angelo Compagnucci Acked-by: --- package/mender/readme.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package/mender/readme.txt diff --git a/package/mender/readme.txt b/package/mender/readme.txt new file mode 100644 index 0000000..329b2a4 --- /dev/null +++ b/package/mender/readme.txt @@ -0,0 +1,18 @@ +=== Notes on using Mender on Buildroot +====================================== +Default configurations files +---------------------------- + +Buildroot comes with a default artifact_info and device_type configuration files +in /etc/mender. They contain default values, and thus they should be overridden +on a production system. + +The simplest way to do it is to change these files in an overlay or in a post +build script. + +Configuring mender with certificates +------------------------------------ + +Mender uses TLS to communicate with the management server, and if you use a +CA-signed certificate on the server, you should select the ca-certificates +package otherwise it doesn't work.