From patchwork Mon Oct 14 10:21:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1996780 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XRtYv3tZcz1xvm for ; Mon, 14 Oct 2024 21:21:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 997D360789; Mon, 14 Oct 2024 10:21:35 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id L_wRyIdF0V9G; Mon, 14 Oct 2024 10:21:34 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 937496078D Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 937496078D; Mon, 14 Oct 2024 10:21:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 161131BF2F0 for ; Mon, 14 Oct 2024 10:21:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0444340296 for ; Mon, 14 Oct 2024 10:21:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IeAZG7WWWN1g for ; Mon, 14 Oct 2024 10:21:31 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::32d; helo=mail-wm1-x32d.google.com; envelope-from=adam.duskett@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org E801A40373 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E801A40373 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by smtp2.osuosl.org (Postfix) with ESMTPS id E801A40373 for ; Mon, 14 Oct 2024 10:21:30 +0000 (UTC) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-431198c63cfso4001915e9.1 for ; Mon, 14 Oct 2024 03:21:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728901288; x=1729506088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U2uQAp7wvUVaTCAYFp/24MvDbY6QTZR4LOdCLJT88VY=; b=i4+W+oRmfOokOxZgPvNAhOvP3AV3e1hPOuA5xx9JnA0eN8YFrgLnjb8BQaNRw+bCpc kkK739ngJFWVpDStyqfijgnCKiQAUFceI6Ny32iYBRMWzVbImaRRQHrBy5SSQ0tgK9gC b/8U8lY/CtFG+MlkBoy974192ntFk6JTT6Qe7tzgYOrlFIv6Kf9RYYVuFWqmJMSDM115 iq+TUjr91DSgVOyCgfpPpwzCAimoSu5YyxdoM7SPC9kbHUZyagENhSU79CGrt78JrVaY fjTitVzkcis9I5bLr2r+pkk/hYk8dSb082xDTnS84VcO+e84S3EHPHoWI5nrdFBVaJF4 zRDg== X-Gm-Message-State: AOJu0YxrsWsQ91IrpXcKw1DO43COmDg0Fe1sR8uiohTqPcxXOu4SL4ph 5BsGxFhyJbC0Me9ol3So+LIuWZOspYx75+PU5dtGAMeA0yfryJUo0VOLOE5fol21ICDkT2HL9i+ C7n4= X-Google-Smtp-Source: AGHT+IGSK2zSBVxZSUI/5Sv5Upf7JI0j28pxapAb6nvox1HiL3f8ZPRH5YmZ0hsxNKCdMIh2sG3aYw== X-Received: by 2002:a05:600c:4e8e:b0:42c:b172:8c53 with SMTP id 5b1f17b1804b1-4311df39dbemr42270225e9.5.1728901288350; Mon, 14 Oct 2024 03:21:28 -0700 (PDT) Received: from adam-laptop.amarulasolutions.com ([2001:b07:6467:4426:e642:fe3c:c003:b424]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182d7ca3sm116402605e9.2.2024.10.14.03.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 03:21:28 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 14 Oct 2024 12:21:18 +0200 Message-ID: <20241014102123.3727883-2-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> References: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728901288; x=1729506088; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U2uQAp7wvUVaTCAYFp/24MvDbY6QTZR4LOdCLJT88VY=; b=hH0avwzZ7nMrH3xYxcnjx3Ge4ZrLuYius3govn5jrsVpry2N7MckyGqzUfrfRdtaNb qQVXuvcmY4WooLj5GQTNhCt6uO0nQg3i/BRGzV+9Nnw9PL+eb1QIwDrgZJDWFeQo/SfG SCll/87S6m0GZP+PF8ok37TuuQCDH8O5wffOw= X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=hH0avwzZ Subject: [Buildroot] [PATCH 1/6] board/mender/x86_64/post-image-efi.sh: re-arrange write rootfs-image args X-BeenThere: buildroot@buildroot.org 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 , Adam Duskett Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Put the write rootfs-image argument before the compression argument. This change makes the logic easier to follow. Signed-off-by: Adam Duskett --- board/mender/x86_64/post-image-efi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/mender/x86_64/post-image-efi.sh b/board/mender/x86_64/post-image-efi.sh index 073b18c972..c2706a8df6 100755 --- a/board/mender/x86_64/post-image-efi.sh +++ b/board/mender/x86_64/post-image-efi.sh @@ -45,8 +45,8 @@ make_data_partition() { generate_mender_image() { echo "Creating ${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender" "${HOST_DIR}/bin/mender-artifact" \ - --compression lzma \ write rootfs-image \ + --compression lzma \ -t "${DEVICE_TYPE}" \ -n "${BR2_VERSION}" \ -f "${BINARIES_DIR}/rootfs.ext2" \ From patchwork Mon Oct 14 10:21:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1996781 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XRtYy4mkjz1xvm for ; Mon, 14 Oct 2024 21:21:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1A5D4607A9; Mon, 14 Oct 2024 10:21:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hY3Sl0r0t-nN; Mon, 14 Oct 2024 10:21:38 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9C53B607D3 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 9C53B607D3; Mon, 14 Oct 2024 10:21:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 95A421BF2F0 for ; Mon, 14 Oct 2024 10:21:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8345040373 for ; Mon, 14 Oct 2024 10:21:33 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id D5S5aHn5SM5q for ; Mon, 14 Oct 2024 10:21:32 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::32d; helo=mail-wm1-x32d.google.com; envelope-from=adam.duskett@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 431E840296 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 431E840296 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by smtp2.osuosl.org (Postfix) with ESMTPS id 431E840296 for ; Mon, 14 Oct 2024 10:21:32 +0000 (UTC) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-431157a490eso6711645e9.0 for ; Mon, 14 Oct 2024 03:21:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728901290; x=1729506090; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NpnMWrNJidwcsOUYYRT66xklu921q50xoH8O9H8Vrqs=; b=xVeEXbMZHgxhGyG7xFfj5GnVjgwEKoByki57e0czSgq4xyMC2Pu7YxXNlKNQ5mwv30 za87lugtHYkZpSWEJ6IT8u37GjORiQcEtN2sXBHtozZqamvapvZrJpwt47hZNKt7LJrx uaMv0ers+6W80cTI96OyjvW7jMxI3WY0UEb3QKjNEr+kf37Z96tnoSAy/0+Ox4eUe6va jt4aOv+qJn+DU71HMRvrfxe2zGHoIa1b4V+fMb7LIE8elgZq17izEUe08yy0t0cNcIZk /mUjTZ5cm2qrQncR22a38WwCgmBhdrOKEvYJn8vPQ9Zp9We3v/99fAdYV0ygXebRaEwM hr3g== X-Gm-Message-State: AOJu0YyQFbnqi9diqShkqM/u+FXD3d5dgUrm1a22ThQFHXausZy2RD51 v0zHYMHm089SnMjQ4ikMoktM1Q/Zmt6rA64SezITtmwaWR4qFbTNggyjfVE0oPvQGInt6PF88gx g+Cc= X-Google-Smtp-Source: AGHT+IF2GTUuTueF37u7mSTclcFPbCuXvBX7L6cXejEX0Ss4AX2DWok51iUmRxB7Az5leWCxx60TVA== X-Received: by 2002:a05:600c:350f:b0:42c:bb35:b6d0 with SMTP id 5b1f17b1804b1-4311dea4351mr39943205e9.1.1728901289614; Mon, 14 Oct 2024 03:21:29 -0700 (PDT) Received: from adam-laptop.amarulasolutions.com ([2001:b07:6467:4426:e642:fe3c:c003:b424]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182d7ca3sm116402605e9.2.2024.10.14.03.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 03:21:29 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 14 Oct 2024 12:21:19 +0200 Message-ID: <20241014102123.3727883-3-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> References: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728901290; x=1729506090; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NpnMWrNJidwcsOUYYRT66xklu921q50xoH8O9H8Vrqs=; b=BLOV8L2b1Rf7h+PJ2EBOYSWntdELS5Cfuq7G7Gw4UsmNmxH3fUEcNKlWhiiElR85Ch JCD4+nnw8fm0GdiT95Nc6tYDVyZl5J83SHnEGKdyIeZ0q63WxDWjOtlw6ddPEhgh/MCB sGlFXoXW9MFs2tQHvRC6nXWWdKdDE5QIt9RJ8= X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=BLOV8L2b Subject: [Buildroot] [PATCH 2/6] package/mender: remove /var/lib/mender symlinking X-BeenThere: buildroot@buildroot.org 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 , Adam Duskett Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The logic behind making /var/lib/mender a symlink to itself is to detect if a filesystem is read-only. However, this creates a few problems: 1) The logic confusing. 2) The official mender documentation suggests four partitions minimum: - boot - rootfs A - rootfs B - data If a user is to follow the official documentation, which they should, then there is no need for any additional logic for a system setup with a read-only filesystem, as the data partition is always read-write. 3) The post-build.sh script in the board/mender/x86_64 directory removes the symlink. - Remove symlinking /var/lib/mender to itself - Remove the difficult to understand logic dealing with the symlinks in S42mender, mender-client.service. - Remove the logic dealing with the symlink in board/mender/x86_64/post-build.sh Signed-off-by: Adam Duskett --- board/mender/x86_64/post-build.sh | 5 ----- package/mender/S42mender | 16 ---------------- package/mender/mender-client.service | 11 ----------- package/mender/mender.mk | 3 +-- 4 files changed, 1 insertion(+), 34 deletions(-) diff --git a/board/mender/x86_64/post-build.sh b/board/mender/x86_64/post-build.sh index bc4f4b8f11..0c52eb7be5 100755 --- a/board/mender/x86_64/post-build.sh +++ b/board/mender/x86_64/post-build.sh @@ -31,11 +31,6 @@ parse_args() { # Create a persistent directory to mount the data partition at. mender_fixup() { pushd "${TARGET_DIR}" - if [[ -L var/lib/mender ]]; then - rm var/lib/mender - mkdir -p var/lib/mender - fi - # The common paradigm is to have the persistent data volume at /data for mender. if [[ ! -L data ]]; then ln -s var/lib/mender data diff --git a/package/mender/S42mender b/package/mender/S42mender index 0f2077d089..70116ed4eb 100644 --- a/package/mender/S42mender +++ b/package/mender/S42mender @@ -8,22 +8,6 @@ PIDFILE="/var/run/${DAEMON}.pid" DAEMON_ARGS="daemon" 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 ] && [ "$(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 -bmSqp "$PIDFILE" -x ${DAEMON_PATH} -- ${DAEMON_ARGS} diff --git a/package/mender/mender-client.service b/package/mender/mender-client.service index 5539a56fd6..47e439993c 100644 --- a/package/mender/mender-client.service +++ b/package/mender/mender-client.service @@ -6,17 +6,6 @@ After=systemd-resolved.service Type=idle User=root Group=root -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 diff --git a/package/mender/mender.mk b/package/mender/mender.mk index ee1398244b..e6a2740e80 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -72,8 +72,7 @@ define MENDER_INSTALL_CONFIG_FILES $(INSTALL) -D -m 0755 $(MENDER_PKGDIR)/device_type \ $(TARGET_DIR)/etc/mender/device_type - mkdir -p $(TARGET_DIR)/var/lib - ln -snf /var/run/mender $(TARGET_DIR)/var/lib/mender + mkdir -p $(TARGET_DIR)/var/lib/mender $(foreach f,$(MENDER_UPDATE_MODULES_FILES), \ $(INSTALL) -D -m 0755 $(@D)/support/modules/$(notdir $(f)) \ $(TARGET_DIR)/usr/share/mender/modules/v3/$(notdir $(f)) From patchwork Mon Oct 14 10:21:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1996782 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XRtZ13Yltz1xvm for ; Mon, 14 Oct 2024 21:21:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9087C60619; Mon, 14 Oct 2024 10:21:42 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4Ighg2Hwqb7n; Mon, 14 Oct 2024 10:21:41 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 63BEA607E0 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 63BEA607E0; Mon, 14 Oct 2024 10:21:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id BA29F1BF2F0 for ; Mon, 14 Oct 2024 10:21:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A8FFF4029F for ; Mon, 14 Oct 2024 10:21:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id V18FeKyh7dUf for ; Mon, 14 Oct 2024 10:21:33 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::334; helo=mail-wm1-x334.google.com; envelope-from=adam.duskett@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 8B32240286 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8B32240286 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8B32240286 for ; Mon, 14 Oct 2024 10:21:33 +0000 (UTC) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4312484334eso2927345e9.0 for ; Mon, 14 Oct 2024 03:21:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728901291; x=1729506091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s+CbtcNEG4VYAApvV+Hryk4GFfztQCPtPSlrqKl54/g=; b=Wc639+2Q77epwB8YJLoh3ntTrcaKIHUs5eZ8k0MxWi2g5AEy8o8Px0tx4NJxRKfkJy s5vow0uRA1sWecWQa+6yub53idqYHOFibwmb7kZGrL9zOKGhsFA2WLbpOhoEUByODN2w aU6S/3IkA8IcQoY1Z1Km4/aWvly5/77cHYmrD/DMkKGhms/P0HhZFxxwAKz+A+aOHqPL cQc2NKXMPSHhb+jrWmaTHnyYIUffjiFnlFvw+BPRT0OKXFxq87h3hMADw5l9il/CvLpo 3X8uMinYPRyeqPZwrLNcpAp7ogpbFli4YFF/D59DnnX/C3xRRooMVxt+kFsQUI1+hcTE QQHQ== X-Gm-Message-State: AOJu0YztvCsZD8ANG9UXMnim/NSHaxx9vreKdnEfYz/oiQFoZPT9PYt5 06dslAerF8W4vUySegKRcGuAgoy/AB8hyn35wMnGsZkf25SC2hCkGtwgMH4VjkndGf1P1CCBTuY hlfs= X-Google-Smtp-Source: AGHT+IFHKkGOe+uS43opTfrsyHpQsWcgeUkE4Iho7jlg2BbCoG4poTWZVeo3C3sUK5L5Pj20XV0Fbg== X-Received: by 2002:a05:600c:470e:b0:42c:b55f:f4f with SMTP id 5b1f17b1804b1-4311df6050dmr41514785e9.6.1728901290884; Mon, 14 Oct 2024 03:21:30 -0700 (PDT) Received: from adam-laptop.amarulasolutions.com ([2001:b07:6467:4426:e642:fe3c:c003:b424]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182d7ca3sm116402605e9.2.2024.10.14.03.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 03:21:30 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 14 Oct 2024 12:21:20 +0200 Message-ID: <20241014102123.3727883-4-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> References: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728901291; x=1729506091; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s+CbtcNEG4VYAApvV+Hryk4GFfztQCPtPSlrqKl54/g=; b=H4JgCDXdbNFmSFiC3h4qgWP4flNHaCVTP93b5O5ZPRhlDDS4+GpP42hTgDRqgB3oil +fWZZ0/wkuQ0yxbH3KFsayAdNJlOAwrUNeb7VuQ2dFMngJhFkxoth+PfQbPqfR6Vq7+s Q2W7M/2kyBZnA/v56TMxupzcXtLfh3RZevWLc= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=H4JgCDXd Subject: [Buildroot] [PATCH 3/6] support/testing/tests/package/test_mender.py: Add RO fs test X-BeenThere: buildroot@buildroot.org 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 , Adam Duskett Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add a test for read-only file systems. Signed-off-by: Adam Duskett --- support/testing/tests/package/test_mender.py | 40 ++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/support/testing/tests/package/test_mender.py b/support/testing/tests/package/test_mender.py index fdf55ed616..0938cb77e1 100644 --- a/support/testing/tests/package/test_mender.py +++ b/support/testing/tests/package/test_mender.py @@ -3,23 +3,23 @@ import os import infra.basetest -class TestMender(infra.basetest.BRTest): +class TestMenderInfra(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ - """ - BR2_PACKAGE_MENDER=y - BR2_TARGET_ROOTFS_CPIO=y - BR2_ROOTFS_OVERLAY="{}" - """.format( - # overlay to add a fake 'fw_printenv', used by Mender - infra.filepath("tests/package/test_mender/rootfs-overlay")) + """ + BR2_PACKAGE_MENDER=y + BR2_TARGET_ROOTFS_CPIO=y + BR2_ROOTFS_OVERLAY="{}" + """.format( + # overlay to add a fake 'fw_printenv', used by Mender + infra.filepath("tests/package/test_mender/rootfs-overlay")) - def test_run(self): + def base_test_run(self): cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") - self.emulator.boot(arch="armv5", - kernel="builtin", + self.emulator.boot(arch="armv5", kernel="builtin", options=["-initrd", cpio_file]) self.emulator.login() + def run_mender_test(self): # Check if the Daemon is running self.assertRunOk("ls /var/run/mender.pid") self.assertRunOk("ps aux | egrep [m]ender") @@ -30,3 +30,21 @@ class TestMender(infra.basetest.BRTest): cmd = "mender show-artifact 2>&1 | grep -i 'err'" # Check if no 'error' among the traces _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 1) + + +class TestMenderRW(TestMenderInfra): + def test_run(self): + TestMenderInfra.base_test_run(self) + self.run_mender_test() + + +class TestMenderRO(TestMenderInfra): + config = \ + """ + {} + # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set + """.format(TestMenderInfra.config) + + def test_run(self): + TestMenderInfra.base_test_run(self) + self.run_mender_test() From patchwork Mon Oct 14 10:21:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1996783 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XRtZ33hFRz1xvm for ; Mon, 14 Oct 2024 21:21:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 66002607E3; Mon, 14 Oct 2024 10:21:45 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id drRgdKCIpP2X; Mon, 14 Oct 2024 10:21:44 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org CA9D2607FF Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id CA9D2607FF; Mon, 14 Oct 2024 10:21:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1E20B1BF2F0 for ; Mon, 14 Oct 2024 10:21:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0C3CE6078D for ; Mon, 14 Oct 2024 10:21:36 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GMcXNuLt06Em for ; Mon, 14 Oct 2024 10:21:35 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::333; helo=mail-wm1-x333.google.com; envelope-from=adam.duskett@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 0A57460619 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0A57460619 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0A57460619 for ; Mon, 14 Oct 2024 10:21:34 +0000 (UTC) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-430549e65a4so4756645e9.0 for ; Mon, 14 Oct 2024 03:21:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728901292; x=1729506092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z1mavsrIjvfLoG+tApnNzLr59J36j13o2wctDfMrxVo=; b=MqFFRN/nQPy6r3yjgxOdjw6COehHUlAWcixAR4Ww1M6q/d02EBlGqtrcOF52B4T1Pg 8q2Lf40jMAI+L1dGn7fKqCjJh6zWjQijyBt+vNPhXTBlljvT4wjEHbMKirV3o/amIxCV gnbnK5zR2exSF2d6BoUYnebUL2kpmMqUmYrpOHqtoCQ4n3yUejr7zrynVt7J9WTfXnpg mjRp4ULPj3kwWbt+38eXO34GNfdRififBisQ6nEqMyPLEAQVkNxiZHyjS9eEJUkkb7u+ xfitt7zu7tboEVXBkOAeExKytFWI87rJx/Upz4RWS3LqJK57kjSirGEczsG+Ox5CXU6t gzkw== X-Gm-Message-State: AOJu0YwEynINlgFECOWwJO5USwUVLpaKWhEVpxN6LJ8xCAcw2tQEvhgH GanSYJ3mAz4ERiZBnF740ITr77rn1mUIgKkU9RbOKgtS3RSkwtCZ8D0QaByj6Eet2/BdOJqPWBj YBSc= X-Google-Smtp-Source: AGHT+IG0F39qQhRZGbdbFOjLyZNWEKBYr77xpz26PmeIBOoGRV77Kdahgv8LO/7gmOutHP7kFbCyKQ== X-Received: by 2002:a05:600c:1c29:b0:42c:bab1:b8cc with SMTP id 5b1f17b1804b1-4311df39d6dmr43622985e9.4.1728901292054; Mon, 14 Oct 2024 03:21:32 -0700 (PDT) Received: from adam-laptop.amarulasolutions.com ([2001:b07:6467:4426:e642:fe3c:c003:b424]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182d7ca3sm116402605e9.2.2024.10.14.03.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 03:21:31 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 14 Oct 2024 12:21:21 +0200 Message-ID: <20241014102123.3727883-5-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> References: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728901292; x=1729506092; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z1mavsrIjvfLoG+tApnNzLr59J36j13o2wctDfMrxVo=; b=dmjYfeXuCqR4xjoL9wADQoY2JBuwgCS6/XMP/MPsTfQbW2Y6mb/jvxjEsQznRlGUaX C/Pu+M4vMgzdSDQKWow1OwMJoBD5es0Oepndf9O+RZQJS1TjI0KR785Gf8r1VvkLS1hD DY+BznfKuX8DS7yotylDlSUvROXFSzN2RV5RQ= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=dmjYfeXu Subject: [Buildroot] [PATCH 4/6] support/testing/tests/package/test_mender.py: Add a systemd test X-BeenThere: buildroot@buildroot.org 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 , Adam Duskett Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" - Move the check for /var/run/mender.pid to before self.run_mender_test() for the two tests using sysvinit. - Instead of checking for /var/run/mender.pid during the systemd test, check to ensure "systemctl is-active mender-client" returns "active" Signed-off-by: Adam Duskett --- support/testing/tests/package/test_mender.py | 21 ++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/support/testing/tests/package/test_mender.py b/support/testing/tests/package/test_mender.py index 0938cb77e1..7f606eb729 100644 --- a/support/testing/tests/package/test_mender.py +++ b/support/testing/tests/package/test_mender.py @@ -20,8 +20,6 @@ class TestMenderInfra(infra.basetest.BRTest): self.emulator.login() def run_mender_test(self): - # Check if the Daemon is running - self.assertRunOk("ls /var/run/mender.pid") self.assertRunOk("ps aux | egrep [m]ender") # Check if a simple Mender command is correctly executed @@ -35,6 +33,9 @@ class TestMenderInfra(infra.basetest.BRTest): class TestMenderRW(TestMenderInfra): def test_run(self): TestMenderInfra.base_test_run(self) + + # Check if the Daemon is running + self.assertRunOk("ls /var/run/mender.pid") self.run_mender_test() @@ -47,4 +48,20 @@ class TestMenderRO(TestMenderInfra): def test_run(self): TestMenderInfra.base_test_run(self) + + # Check if the Daemon is running + self.assertRunOk("ls /var/run/mender.pid") + self.run_mender_test() + +class TestMenderSystemd(TestMenderInfra): + config = \ + """ + {} + BR2_INIT_SYSTEMD=y + """.format(TestMenderInfra.config) + + def test_run(self): + TestMenderInfra.base_test_run(self) + output, _ = self.emulator.run("systemctl is-active mender-client") + self.assertEqual(output[0], "active") self.run_mender_test() From patchwork Mon Oct 14 10:21:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1996784 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XRtZ62JXwz1xvm for ; Mon, 14 Oct 2024 21:21:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C728D60759; Mon, 14 Oct 2024 10:21:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VcnWgr6zBTjQ; Mon, 14 Oct 2024 10:21:47 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7819E60818 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 7819E60818; Mon, 14 Oct 2024 10:21:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 18FBC1BF2F0 for ; Mon, 14 Oct 2024 10:21:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 02A2080EFA for ; Mon, 14 Oct 2024 10:21:38 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AVp2txOBJvuw for ; Mon, 14 Oct 2024 10:21:37 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::32a; helo=mail-wm1-x32a.google.com; envelope-from=adam.duskett@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org A3EAD80ECA DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A3EAD80ECA Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by smtp1.osuosl.org (Postfix) with ESMTPS id A3EAD80ECA for ; Mon, 14 Oct 2024 10:21:36 +0000 (UTC) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43111bdd54cso6692115e9.1 for ; Mon, 14 Oct 2024 03:21:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728901294; x=1729506094; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KSw8h5zolL2TbJWfRpBUJv4t6++13NTgC4v/EaTHO70=; b=xMxZG5dlcZWhTPh/s+XQNaP0LL83bu5ryocZT4Dt9eKbagRl1jcfZpsQz+hWSzoBOW aNLvfPd7lwf3+vD37K4pVoZpVpbZsBSWZcczszGT0EblBObAKnvhP9KEfPyWEPtPu4Cb kCY8xx6i6roVHAgTuft+AQ2IvsajtNZbazP6es5rZsMw40woqC/VhRXgLyD+ARLVRhQo isfzz28xOK2BbNdgtavDxcRq/6/iyqrsrbjgO+5AOPnUHXK8UZjh4kURul+A9KSbp+zg OmpQfOqDzZQps8BqeELyRt7FgYQVJjw0I58zeAjjGVgY9Wc313NqLzIsE7rRWjgQttlH OjGA== X-Gm-Message-State: AOJu0YyumhXALUQmnog8RpSJjpyofpuMsr/mbWgC8e7NiOl1Yl4UXZCT wPrGXIkUOCFu3bUmAplI/b3bx6FmGu23vI33D3MBHthcP2EtxmVt0Tscl/YvfTcLX6bA+thZFqk vKgY= X-Google-Smtp-Source: AGHT+IG62jJ04bx1y1gPxj2KcskAwQiirX6ISKhW/aQzIQSt1YC1jbVb05uDswe8UE2lY5Nyqx/qAw== X-Received: by 2002:a05:600c:4a27:b0:42c:ba6c:d9b1 with SMTP id 5b1f17b1804b1-4311df5641cmr40852685e9.4.1728901293844; Mon, 14 Oct 2024 03:21:33 -0700 (PDT) Received: from adam-laptop.amarulasolutions.com ([2001:b07:6467:4426:e642:fe3c:c003:b424]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182d7ca3sm116402605e9.2.2024.10.14.03.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 03:21:33 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 14 Oct 2024 12:21:22 +0200 Message-ID: <20241014102123.3727883-6-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> References: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728901294; x=1729506094; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KSw8h5zolL2TbJWfRpBUJv4t6++13NTgC4v/EaTHO70=; b=jFqL3ztsAuCzTrHrIdL6/aV5k12qidCBK4xX0xns9rRuA1Bw23ICEYM8RZ9CwZao7m kuW5f9mp8HHhKH9hZUxyOzlM/Tp52LMpevoGLKcjnLu228MxvJIB8KvvtiEIN8fHtITA R7tiDKPmeohI4fC65lCaW7FkHOTjr3ixbAoyI= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=jFqL3zts Subject: [Buildroot] [PATCH 5/6] package/mender/readme.txt: update readme X-BeenThere: buildroot@buildroot.org 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 , Adam Duskett Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" - Add missing packages to the mender package list. - Update broken URL links. - Remove the example mender artifact post-image script in favor of directing the user to the board/mender/x86_64/post-image-efi.sh script. Signed-off-by: Adam Duskett --- package/mender/readme.txt | 56 +++++++++++---------------------------- 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/package/mender/readme.txt b/package/mender/readme.txt index c884524a1b..d78623aec9 100644 --- a/package/mender/readme.txt +++ b/package/mender/readme.txt @@ -28,13 +28,23 @@ In Buildroot the following packages are provided: - This will install the client on target rootfs - BR2_PACKAGE_HOST_MENDER_ARTIFACT - This will install the 'mender-artifact' tool in host rootfs. +- BR2_PACKAGE_MENDER_CONNECT + - This installs a client that allows for remote terminal access + to mender clients registered on a mender server. +- BR2_PACKAGE_MENDER_GRUBENV + - This package provides boot scripts to integrate mender into grub. + Mender recommends every client to use this package, including boards + using uboot as the primary bootloader. To fully utilize atomic image-based deployments using the A/B update strategy, additional integration is required in the bootloader. This integration is board specific. -Currently supported bootloaders are GRUB and U-boot, and for reference -integrations please visit: +Currently supported bootloaders are GRUB and U-boot. Buildroot provides +a reference integration at board/mender/x86_64/ using the +mender_x86_64_efi_defconfig file. + +Additional support and integrations are found at: https://github.com/mendersoftware/buildroot-mender @@ -46,12 +56,7 @@ files that need your attention: - /etc/mender/mender.conf - main configuration file for the Mender client - - https://docs.mender.io/client-configuration/configuration-file/configuration-options - -- /etc/mender/artifact_info - - The name of the image or update that will be built. This is what the - device will report that it is running, and different updates must have - different names + - https://docs.mender.io/client-installation/configuration/configuration-options - /var/lib/mender/device_type - A string that defines the type of device @@ -110,40 +115,9 @@ Creating Mender Artifacts To create Mender Artifacts based on Buildroot build output you must include BR2_PACKAGE_HOST_MENDER_ARTIFACT in your configuration, and then you would typically create the Mender Artifact in a post image -script (BR2_ROOTFS_POST_IMAGE_SCRIPT). Below is an example of such a -script: - - #!/bin/sh - - set -e - set -x - - device_type=$(cat ${TARGET_DIR}/var/lib/mender/device_type | sed 's/[^=]*=//') - artifact_name=$(cat ${TARGET_DIR}/etc/mender/artifact_info | sed 's/[^=]*=//') - - if [ -z "${device_type}" ] || [ -z "${artifact_name}" ]; then - echo "missing files required by Mender" - exit 1 - fi - - ${HOST_DIR}/usr/bin/mender-artifact write rootfs-image \ - --update ${BINARIES_DIR}/rootfs.ext4 \ - --output-path ${BINARIES_DIR}/${artifact_name}.mender \ - --artifact-name ${artifact_name} \ - --device-type ${device_type} - -As you can see some properties are extracted from target rootfs, and -this is because these values are used for compatibility checks, -meaning that the information must be present in both rootfs and in -Mender Artifact meta data. - -- device_type - must be an exact match between rootfs and Mender - Artifact meta-data to apply update. You can set an - array of devices here as well, e.g if your image is - compatible with multiple hardware revisions +script (BR2_ROOTFS_POST_IMAGE_SCRIPT). See the generate_mender_image +method in board/mender/x86_64/post-image-efi.sh for a working example. -- artifact_name - must be an exact match between rootfs and Mender - Artifact meta-data to apply update. Configuring Mender with certificates ------------------------------------ From patchwork Mon Oct 14 10:21:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1996785 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XRtZC6tVYz1xvm for ; Mon, 14 Oct 2024 21:21:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0D15D60831; Mon, 14 Oct 2024 10:21:53 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id LN_fll7Z8WkB; Mon, 14 Oct 2024 10:21:50 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D85F460818 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id D85F460818; Mon, 14 Oct 2024 10:21:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 113671BF2F0 for ; Mon, 14 Oct 2024 10:21:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0045A4029F for ; Mon, 14 Oct 2024 10:21:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id afvwuiJSphE2 for ; Mon, 14 Oct 2024 10:21:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::432; helo=mail-wr1-x432.google.com; envelope-from=adam.duskett@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org D2FAE402E6 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D2FAE402E6 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by smtp4.osuosl.org (Postfix) with ESMTPS id D2FAE402E6 for ; Mon, 14 Oct 2024 10:21:37 +0000 (UTC) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-37d43a34a0cso165746f8f.1 for ; Mon, 14 Oct 2024 03:21:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728901296; x=1729506096; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NS4HU1+0gSkCxaiZeEH8GLGJidL0FG2uu8lKukcIzws=; b=LL9K4CcRAfvthSI7BeFTis5VGEeps9Ud6/c/cn+LfVJjrHS2rfNxD0KyhQq0IMXNVV RiMmpiTvGUqIxjBKAAruuGbrcj9o+nbKt5oyecWJslGFYrOfIxqlfhSdmysx3WrDpmA6 wercvWe2FvAEITBWefMwMH2n74n6LsIXa4MWN6x+J8W+2xfbD1AimWqZzdQBFu/Y1lqg Ia8LrV/PBKGhn7OEQ1gmsu9nd8mNFeV4eFRfanZZti5Lef7V66qmNw2CeaBNODTvS0zh HN5nw7NmlW5V+GBadJzfJjFV1yBX+yvaJUucMHESmRQF87RM+JevF/oEKOm91nt16FY3 xqqQ== X-Gm-Message-State: AOJu0Yx0FKTP5aj0/Of2GW7KlzyRt50OkQ7rhhUoGcjDMT+j4P1XKxtD zmmAq1eIi+2cbYBkgVsQref5Tsu/iSfXyr0NWSGsa/yRZc1I7vwpvxbCiE6V3LQ6HpdTjhuENe1 9UD4= X-Google-Smtp-Source: AGHT+IG/pmgmVYN8gLKR4lPLXKng9Eqx575eDADpFUrDtsYKkogdr3lJOwDDlgk1Bm3M+Y2tbKbBCw== X-Received: by 2002:a05:6000:1fa3:b0:37d:4864:39a2 with SMTP id ffacd0b85a97d-37d552c253dmr3448942f8f.7.1728901295509; Mon, 14 Oct 2024 03:21:35 -0700 (PDT) Received: from adam-laptop.amarulasolutions.com ([2001:b07:6467:4426:e642:fe3c:c003:b424]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182d7ca3sm116402605e9.2.2024.10.14.03.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 03:21:35 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Mon, 14 Oct 2024 12:21:23 +0200 Message-ID: <20241014102123.3727883-7-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> References: <20241014102123.3727883-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728901296; x=1729506096; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NS4HU1+0gSkCxaiZeEH8GLGJidL0FG2uu8lKukcIzws=; b=Bah71N8+TgohHOpB1YPcRBqYn4iOAYDl8yrOhpSN7GhDjUuDjSYCHbLeZ9GqHF4NGz 6+p904LBNVsYZ6rOMe/BDfFr8BIjnsMRJXJ4c5r3kzWUCQya2EsOZ+FT5H5pYMdCsd6H EdgYmg9Hd4caSOxfeFk2jkb1mEJHc/G6U9tRA= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=Bah71N8+ Subject: [Buildroot] [PATCH 6/6] package/mender: bump version to 3.5.3 X-BeenThere: buildroot@buildroot.org 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 , Adam Duskett Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Updating directly to 4.x is too difficult and complex, as mender 4.x is a complete rewrite in C++, with several new dependencies and changes. As such, update to the last version that was written in Go, which is 3.5.3. The following changes are necessary: The artifact_info file is no longer supported. Instead, mender now expects a bootstrap.mender artifact created by mender-artifact /var/lib/mender. See the following for more information: https://northerntech.atlassian.net/browse/MEN-2585 https://northerntech.atlassian.net/browse/MEN-2583 https://docs.mender.io/release-information/release-notes-changelog/mender-client#mender-3-5-0-1 - Remove all instances of creating or copying an artifact_info file from board examples and package/mender. - Add a generate_mender_bootstrap_artifact method to board/mender/x86_64/post-image-efi.sh which creates a proper bootstrap.mender file and places it in the data partition. - Add a post-build.sh script to support/testing/tests/package/test_mender with the same generate_mender_bootstrap_artifact method with one change: As the rootfs.ext4 file is not yet created; we omit the optional --provides "rootfs-image.checksum:${img_checksum}" argument when generating the bootstrap.mender file. Mender expects the device_type file to exist in /var/lib/mender/device_type. This is further supported by the following line in tests/Dockerfile.daemon: `echo device_type=docker-client > /var/lib/mender/device_type` Add a migration section in docs/manual/migrating.adoc Update the package/mender/readme.txt to include a quick mention of the bootstrap.mender artifact change. License changes: New: vendor/github.com/klauspost/compress/internal/snapref/LICENSE vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt Removed: vendor/github.com/klauspost/compress/internal/snapref/LICENSE vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt Modified: LICENSE: Update year from 2022 to 2024 LIC_FILES_CHKSUM.sha256: Sum of all Licenses changed vendor/github.com/mendersoftware/mender-artifact/LICENSE - Update year from 2022 to 2023 Signed-off-by: Adam Duskett --- board/mender/x86_64/post-build.sh | 7 +++--- board/mender/x86_64/post-image-efi.sh | 23 +++++++++++++++++ docs/manual/migrating.adoc | 15 +++++++++++ package/mender/artifact_info | 1 - package/mender/mender.conf | 1 + package/mender/mender.hash | 10 +++++--- package/mender/mender.mk | 7 +++--- package/mender/readme.txt | 4 +++ support/testing/tests/package/test_mender.py | 3 +++ .../tests/package/test_mender/post-build.sh | 25 +++++++++++++++++++ 10 files changed, 83 insertions(+), 13 deletions(-) delete mode 100644 package/mender/artifact_info create mode 100755 support/testing/tests/package/test_mender/post-build.sh diff --git a/board/mender/x86_64/post-build.sh b/board/mender/x86_64/post-build.sh index 0c52eb7be5..5e6967ebd1 100755 --- a/board/mender/x86_64/post-build.sh +++ b/board/mender/x86_64/post-build.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -e DEVICE_TYPE="buildroot-x86_64" -ARTIFACT_NAME="1.0" parse_args() { local o O opts @@ -19,7 +18,8 @@ parse_args() { DEVICE_TYPE="${2}"; shift 2 ;; (-a|--artifact-name) - ARTIFACT_NAME="${2}"; shift 2 + # Ignored to have same options as other scripts + shift 2 ;; (--) shift; break @@ -42,8 +42,7 @@ mender_fixup() { main() { parse_args "${@}" mender_fixup - echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/etc/mender/device_type" - echo "artifact_name=${ARTIFACT_NAME}" > "${TARGET_DIR}/etc/mender/artifact_info" + echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/var/lib/mender/device_type" } main "${@}" diff --git a/board/mender/x86_64/post-image-efi.sh b/board/mender/x86_64/post-image-efi.sh index c2706a8df6..2fc7d70fcb 100755 --- a/board/mender/x86_64/post-image-efi.sh +++ b/board/mender/x86_64/post-image-efi.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e BOARD_DIR="$(realpath "$(dirname "$0")")" +DATA_PART="${BINARIES_DIR}"/data-part DATA_PART_SIZE="32M" DEVICE_TYPE="buildroot-x86_64" ARTIFACT_NAME="1.0" @@ -33,6 +34,7 @@ parse_args() { # Create the data partition make_data_partition() { "${HOST_DIR}/sbin/mkfs.ext4" \ + -d "${DATA_PART}" \ -F \ -r 1 \ -N 0 \ @@ -41,6 +43,26 @@ make_data_partition() { "${BINARIES_DIR}/data-part.ext4" "${DATA_PART_SIZE}" } +# Generate a mender bootstrap artifact. +# See https://northerntech.atlassian.net/browse/MEN-2585 +generate_mender_bootstrap_artifact() { + + rm -rf "${DATA_PART}" + mkdir -p "${DATA_PART}" + img_checksum=$(sha256sum "${BINARIES_DIR}"/rootfs.ext4 |awk '{print $1}') + + "${HOST_DIR}"/bin/mender-artifact \ + write bootstrap-artifact \ + --compression lzma \ + --artifact-name "${ARTIFACT_NAME}" \ + --device-type "${DEVICE_TYPE}" \ + --provides "rootfs-image.version:${ARTIFACT_NAME}" \ + --provides "rootfs-image.checksum:${img_checksum}" \ + --clears-provides "rootfs-image.*" \ + --output-path "${DATA_PART}"/bootstrap.mender \ + --version 3 +} + # Create a mender image. generate_mender_image() { echo "Creating ${BINARIES_DIR}/${DEVICE_TYPE}-${ARTIFACT_NAME}.mender" @@ -60,6 +82,7 @@ generate_image() { # Main function. main() { parse_args "${@}" + generate_mender_bootstrap_artifact make_data_partition generate_image generate_mender_image diff --git a/docs/manual/migrating.adoc b/docs/manual/migrating.adoc index 69bf0dc221..05cfb10718 100644 --- a/docs/manual/migrating.adoc +++ b/docs/manual/migrating.adoc @@ -184,3 +184,18 @@ sed -r -i -e 's/(\.tar\.gz)$/-cargo2\1/' $( Note that the hash _will_ have changed, so that needs to be updated (manually) as well. + +[[migrating-mender]] +=== Migrating to 2024.11 + +Mender has changed in a few notable ways: + +* Now requires a special bootstrap artifact generated with the + host-mender-artifact packaged named bootstrap.mender, placed in + /var/lib/mender. See board/mender/x86_64/post-image-efi.sh for an + example of how to generate the bootstrap.mender file. + +* No longer supports the artifact_info file. + +* See https://docs.mender.io/release-information/release-notes-changelog/mender-client#mender-3-5-0-1 + under features for more information. diff --git a/package/mender/artifact_info b/package/mender/artifact_info deleted file mode 100644 index 1c84b088d0..0000000000 --- a/package/mender/artifact_info +++ /dev/null @@ -1 +0,0 @@ -artifact_name=BUILDROOT_ARTIFACT diff --git a/package/mender/mender.conf b/package/mender/mender.conf index f89118ac1b..2393948f8e 100644 --- a/package/mender/mender.conf +++ b/package/mender/mender.conf @@ -4,6 +4,7 @@ "RetryPollIntervalSeconds": 300, "RootfsPartA": "/dev/mmcblk0p2", "RootfsPartB": "/dev/mmcblk0p3", + "DeviceTypeFile": "/var/lib/mender/device_type", "ServerCertificate": "/etc/mender/server.crt", "ServerURL": "https://docker.mender.io", "TenantToken": "dummy" diff --git a/package/mender/mender.hash b/package/mender/mender.hash index 118cce9d02..70e667897f 100644 --- a/package/mender/mender.hash +++ b/package/mender/mender.hash @@ -1,12 +1,12 @@ # Locally computed: -sha256 8a149b11b990beb7620b372023eec28df63cee6a1aa4132e88ecef554f080f72 mender-3.4.0-go2.tar.gz +sha256 35e369759b8d4f012153e538b5daf1e0cebe842205811e708332c5a092270ac5 mender-3.5.3-go2.tar.gz # Vendor licenses # Generated with sed '/^[A-Za-z0-9_]/s/^/sha256 /' LIC_FILES_CHKSUM.sha256 # Apache-2.0 license. -sha256 1033348db7606a7e61b6484f293847cf8d7a35766efebb97e304d4bd5d7f3f6b LICENSE -sha256 1033348db7606a7e61b6484f293847cf8d7a35766efebb97e304d4bd5d7f3f6b vendor/github.com/mendersoftware/mender-artifact/LICENSE +sha256 d0f406b04e7901e6b4076bdf5fd20f9d7f04fc41681069fd8954413ac6295688 LICENSE +sha256 52b2497ce07650b825015e80ca7a5d40c360c04c530234ca6d950b0f98bca23a vendor/github.com/mendersoftware/mender-artifact/LICENSE sha256 73ba74dfaa520b49a401b5d21459a8523a146f3b7518a833eea5efa85130bf68 vendor/github.com/mendersoftware/openssl/LICENSE sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/github.com/minio/sha256-simd/LICENSE sha256 8f5d89b47d7a05a199b77b7e0f362dad391d451ebda4ef48ba11c50c071564c7 vendor/github.com/mendersoftware/progressbar/LICENSE @@ -29,6 +29,8 @@ sha256 1b93a317849ee09d3d7e4f1d20c2b78ddb230b4becb12d7c224c927b9d470251 vendor # # MIT license. sha256 6d2de1cde19c4d2bd8bcd9aaa1d581f4cfa3db9cf71896140330eaa2f2687685 vendor/github.com/klauspost/pgzip/LICENSE +sha256 f69f157b0be75da373605dbc8bbf142e8924ee82d8f44f11bcaf351335bf98cf vendor/github.com/klauspost/compress/internal/snapref/LICENSE +sha256 f566a9f97bacdaf00d9f21dd991e81dc11201c4e016c86b470799429a1c9a79c vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt sha256 5d966570d7a442d4e969892860a914e542c97f262c873baee8f0aa48e1f40212 vendor/github.com/klauspost/cpuid/v2/LICENSE sha256 51a0c9ec7f8b7634181b8d4c03e5b5d204ac21d6e72f46c313973424664b2e6b vendor/github.com/sirupsen/logrus/LICENSE sha256 f8e536c1c7b695810427095dc85f5f80d44ff7c10535e8a9486cf393e2599189 vendor/github.com/stretchr/testify/LICENSE @@ -42,4 +44,4 @@ sha256 08eab1118c80885fa1fa6a6dd7303f65a379fcb3733e063d20d1bbc2c76e6fa1 vendor sha256 310fe25c858a9515fc8c8d7d1f24a67c9496f84a91e0a0e41ea9975b1371e569 vendor/github.com/bmatsuo/lmdb-go/LICENSE.mdb.md # sha256 of all the vendor licenses combined -sha256 93d9db9b43097b174e362ac8f398aa9a37fcdde2974d0567b62bd6d1e0d22037 LIC_FILES_CHKSUM.sha256 +sha256 f6450978cef1c67078918fdebe21bbedf13a18a32537a071c755e2f2def3af16 LIC_FILES_CHKSUM.sha256 diff --git a/package/mender/mender.mk b/package/mender/mender.mk index e6a2740e80..146e6b2b73 100644 --- a/package/mender/mender.mk +++ b/package/mender/mender.mk @@ -4,7 +4,7 @@ # ################################################################################ -MENDER_VERSION = 3.4.0 +MENDER_VERSION = 3.5.3 MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION)) MENDER_LICENSE = Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, MIT, OLDAP-2.8 MENDER_CPE_ID_VENDOR = northern.tech @@ -29,6 +29,8 @@ MENDER_LICENSE_FILES = \ vendor/golang.org/x/term/LICENSE \ vendor/github.com/davecgh/go-spew/LICENSE \ vendor/github.com/klauspost/pgzip/LICENSE \ + vendor/github.com/klauspost/compress/internal/snapref/LICENSE \ + vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt \ vendor/github.com/klauspost/cpuid/v2/LICENSE \ vendor/github.com/sirupsen/logrus/LICENSE \ vendor/github.com/stretchr/testify/LICENSE \ @@ -66,9 +68,6 @@ define MENDER_INSTALL_CONFIG_FILES $(TARGET_DIR)/usr/share/mender/inventory/mender-inventory-$(f) ) - $(INSTALL) -D -m 0755 $(MENDER_PKGDIR)/artifact_info \ - $(TARGET_DIR)/etc/mender/artifact_info - $(INSTALL) -D -m 0755 $(MENDER_PKGDIR)/device_type \ $(TARGET_DIR)/etc/mender/device_type diff --git a/package/mender/readme.txt b/package/mender/readme.txt index d78623aec9..56d6204583 100644 --- a/package/mender/readme.txt +++ b/package/mender/readme.txt @@ -118,6 +118,10 @@ then you would typically create the Mender Artifact in a post image script (BR2_ROOTFS_POST_IMAGE_SCRIPT). See the generate_mender_image method in board/mender/x86_64/post-image-efi.sh for a working example. +Additionally, mender requires a bootstrap.mender file which is also +generated using the host-mender-artifact package. See the +generate_mender_bootstrap_artifact method in +board/mender/x86_64/post-image-efi.sh for an example Configuring Mender with certificates ------------------------------------ diff --git a/support/testing/tests/package/test_mender.py b/support/testing/tests/package/test_mender.py index 7f606eb729..dfda9bc1cc 100644 --- a/support/testing/tests/package/test_mender.py +++ b/support/testing/tests/package/test_mender.py @@ -7,9 +7,12 @@ class TestMenderInfra(infra.basetest.BRTest): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ BR2_PACKAGE_MENDER=y + BR2_PACKAGE_HOST_MENDER_ARTIFACT=y BR2_TARGET_ROOTFS_CPIO=y + BR2_ROOTFS_POST_BUILD_SCRIPT="{}" BR2_ROOTFS_OVERLAY="{}" """.format( + infra.filepath("tests/package/test_mender/post-build.sh"), # overlay to add a fake 'fw_printenv', used by Mender infra.filepath("tests/package/test_mender/rootfs-overlay")) diff --git a/support/testing/tests/package/test_mender/post-build.sh b/support/testing/tests/package/test_mender/post-build.sh new file mode 100755 index 0000000000..1afa231082 --- /dev/null +++ b/support/testing/tests/package/test_mender/post-build.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -e +DEVICE_TYPE="buildroot-arm" +ARTIFACT_NAME="RUNTIME_TEST_ARTIFACT_NAME" + +generate_mender_bootstrap_artifact() { + "${HOST_DIR}"/bin/mender-artifact \ + write bootstrap-artifact \ + --artifact-name "${ARTIFACT_NAME}" \ + --device-type "${DEVICE_TYPE}" \ + --provides "rootfs-image.version:${ARTIFACT_NAME}" \ + --clears-provides "rootfs-image.*" \ + --output-path "${TARGET_DIR}"/var/lib/mender/bootstrap.mender \ + --version 3 +} + +function mender_fixup() { + rm -rf "${TARGET_DIR}"/var/lib/mender + mkdir -p "${TARGET_DIR}"/var/lib/mender + echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}"/var/lib/mender/device_type + +} + +mender_fixup +generate_mender_bootstrap_artifact