From patchwork Thu Jul 16 08:20:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joris OFFOUGA X-Patchwork-Id: 1330056 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=h6LThSLy; 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 4B6nJp6ZzYz9sRW for ; Thu, 16 Jul 2020 18:21:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EFA64227A0; Thu, 16 Jul 2020 08:21:10 +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 fqYp8taNioFr; Thu, 16 Jul 2020 08:21:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E0BAD220DD; Thu, 16 Jul 2020 08:21:08 +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 EE2E91BF312 for ; Thu, 16 Jul 2020 08:21:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EAE858AF4B for ; Thu, 16 Jul 2020 08:21:06 +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 0WQK+LGfAx5T for ; Thu, 16 Jul 2020 08:21:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id D5CC88AF19 for ; Thu, 16 Jul 2020 08:21:05 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id 17so10520051wmo.1 for ; Thu, 16 Jul 2020 01:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KQztZIdk7dYPyC5L4w+P+NT5HtDcqRGHT6MZQo9V9z0=; b=h6LThSLyr72TCIuep82VCxCcvZclzK76xcpyllElt3JKYd16ioGvGlXY4vYPUr6uPi Cm1MxGDg1wgi8hqKkLotjuajE4qXXA+a1gdvKNNPXZUaB1jH6/9SY/Vb6EZR51TdIitP Bz/a6tsWS22jkdcrHHdKC09W3rHBkiYHIjYjEikO6JHQXt6Mn6yHqZ02RPoKuJZo6qw9 +QIAkuz2xoH7ch/3wnZGxUSpzajXr8yqp1nZ5BIRet/hxp+jlmsOtwStMFmNc0sj0xcR HuKFP0sGSDiC5miuow9Y/vd436pLRBSh5a/G7DToSVq5o/yJo3HF8ewE3OQ5McSKs+F7 UMzw== 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:mime-version :content-transfer-encoding; bh=KQztZIdk7dYPyC5L4w+P+NT5HtDcqRGHT6MZQo9V9z0=; b=dZvbTFXgHyxWtCF/lABO5DkProL/dzpexGi/2KCns66GYYLwz+mhg8W6qzUWETOTkp JDSrGDj+SJ/N03lN5e8IrzxY5rUbeP4nQtJNkoMfFKMoAE5Vn92rzZDAghb8h7mVB+U/ xejymXxD6l+RBiKrJmkNcrhXmhtDKUBvy4CZ7QPa1ln9YCm5xj6ur4KTM37DlUKeFcBt 62bUyY6+CqH1uE8EdC3rBT6pV1npRZa8Hhytvan9imYJGe4H7d+P2uADrAt/fCwYInTY uRxlaCrdsE7O/4A3E8DqUwnAU5ONXh4b4q4fu54c/FWmhgnA0YBanluz/Gth5fMpo5Qw FiXw== X-Gm-Message-State: AOAM533ykwSJHVMUMEJqGE8iOZiW3Yn6qeAb6zSL5fAg03o5ZhBDI/cV Ccm4DBCgc5caaKm9/RpUKv7hCZgj X-Google-Smtp-Source: ABdhPJy49BNMAB8rnp00MvpwvcathEwYHghUPSXUSFgurYlIcX6oW8fV6ZYT/58usb3P6C4knnwVLw== X-Received: by 2002:a1c:98c1:: with SMTP id a184mr3315399wme.116.1594887663732; Thu, 16 Jul 2020 01:21:03 -0700 (PDT) Received: from XPS-15-7590.home ([2a01:cb19:16b:9900:1140:2591:5237:7a2c]) by smtp.gmail.com with ESMTPSA id g3sm8598250wrb.59.2020.07.16.01.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 01:21:03 -0700 (PDT) From: Joris Offouga To: buildroot@buildroot.org Date: Thu, 16 Jul 2020 10:20:41 +0200 Message-Id: <20200716082042.9335-1-offougajoris@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/swupdate: Backport fixes 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: Joris Offouga Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Applied same commit [1] of meta-swupdate for fixes: [2] Shellscript stops before completing [3] diskpart: force kernel to reread partition table [1]: https://github.com/sbabic/meta-swupdate/commit/3fccf23e2816b176075588309e3e4702a318dfc7 [2]: https://github.com/sbabic/swupdate/commit/1078af97a5ac5c3091c8e601b836cd69a7aab7fc [3]: https://github.com/sbabic/swupdate/commit/e3a6b120ff88f6dc34570002de97754b607966ec Signed-off-by: Joris Offouga --- ...-Shellscript-stops-before-completing.patch | 51 +++++++++++++++++++ ...rce-kernel-to-reread-partition-table.patch | 31 +++++++++++ 2 files changed, 82 insertions(+) create mode 100644 package/swupdate/0001-Shellscript-stops-before-completing.patch create mode 100644 package/swupdate/0001-diskpart-force-kernel-to-reread-partition-table.patch diff --git a/package/swupdate/0001-Shellscript-stops-before-completing.patch b/package/swupdate/0001-Shellscript-stops-before-completing.patch new file mode 100644 index 0000000000..7a6038afc0 --- /dev/null +++ b/package/swupdate/0001-Shellscript-stops-before-completing.patch @@ -0,0 +1,51 @@ +From 1078af97a5ac5c3091c8e601b836cd69a7aab7fc Mon Sep 17 00:00:00 2001 +From: Stefano Babic +Date: Tue, 16 Jun 2020 10:29:55 +0200 +Subject: [PATCH] Shellscript stops before completing + +Commit 8fb94d7 reworks the way shell script are called, redirecting +stdout and stderr to SWUpdate. A shell script runs then in a child +process. Under some circumstances, SWUpdate closes the forked process +before the child process completes. + +Be sure that the child process has terminated before to go on. + +Signed-off-by: Stefano Babic +Reported-by: Piotr Piwko +Tested-by: Piotr Piwko +--- + core/pctl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/core/pctl.c b/core/pctl.c +index 8b1c667..01ad540 100644 +--- a/core/pctl.c ++++ b/core/pctl.c +@@ -263,6 +263,7 @@ int run_system_cmd(const char *cmd) + } + } else { + int fds[2]; ++ pid_t w; + + close(stdoutpipe[PIPE_WRITE]); + close(stderrpipe[PIPE_WRITE]); +@@ -276,7 +277,6 @@ int run_system_cmd(const char *cmd) + * and from stderr (of the child process) as ERROR + */ + do { +- pid_t w; + int n1 = 0; + struct timeval tv; + fd_set readfds; +@@ -373,7 +373,7 @@ int run_system_cmd(const char *cmd) + } + } + } while (ret > 0 && n1 > 0); +- } while (!WIFEXITED(wstatus)); ++ } while (w != process_id); + + close(stdoutpipe[PIPE_READ]); + close(stderrpipe[PIPE_READ]); +-- +2.25.1 + diff --git a/package/swupdate/0001-diskpart-force-kernel-to-reread-partition-table.patch b/package/swupdate/0001-diskpart-force-kernel-to-reread-partition-table.patch new file mode 100644 index 0000000000..275493e1b5 --- /dev/null +++ b/package/swupdate/0001-diskpart-force-kernel-to-reread-partition-table.patch @@ -0,0 +1,31 @@ +From e3a6b120ff88f6dc34570002de97754b607966ec Mon Sep 17 00:00:00 2001 +From: Stefano Babic +Date: Tue, 9 Jun 2020 13:58:06 +0000 +Subject: [PATCH] diskpart: force kernel to reread partition table + +After writing a partition table to disk, the kernel should be informed +(like the partconf tool does), else it is not possible to install images +in the new created partitions. + +Signed-off-by: Stefano Babic +--- + handlers/diskpart_handler.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c +index 16adc17..372412b 100644 +--- a/handlers/diskpart_handler.c ++++ b/handlers/diskpart_handler.c +@@ -273,7 +273,8 @@ static int diskpart(struct img_type *img, + /* + * Everything done, write into disk + */ +- ret = fdisk_write_disklabel(cxt); ++ ret = fdisk_write_disklabel(cxt) | ++ fdisk_reread_partition_table(cxt); + + handler_exit: + if (fdisk_deassign_device(cxt, 0)) +-- +2.25.1 +