{"id":1148282,"url":"http://patchwork.ozlabs.org/api/patches/1148282/?format=json","web_url":"http://patchwork.ozlabs.org/project/openwrt/patch/20190816150517.29633-2-zajec5@gmail.com/","project":{"id":45,"url":"http://patchwork.ozlabs.org/api/projects/45/?format=json","name":"OpenWrt development","link_name":"openwrt","list_id":"openwrt-devel.lists.openwrt.org","list_email":"openwrt-devel@lists.openwrt.org","web_url":"http://openwrt.org/","scm_url":"git://git.openwrt.org/openwrt.git","webscm_url":"https://dev.openwrt.org/browser","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20190816150517.29633-2-zajec5@gmail.com>","list_archive_url":null,"date":"2019-08-16T15:05:17","name":"[OpenWrt-Devel,2/2] treewide: sysupgrade: pass \"save_partitions\" option to the \"sysupgrade\" method","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"ec709099396fb344fe4b2c4b8944d2fd36165570","submitter":{"id":5824,"url":"http://patchwork.ozlabs.org/api/people/5824/?format=json","name":"Rafał Miłecki","email":"zajec5@gmail.com"},"delegate":{"id":54625,"url":"http://patchwork.ozlabs.org/api/users/54625/?format=json","username":"rmilecki","first_name":"Rafał","last_name":"Miłecki","email":"zajec5@gmail.com"},"mbox":"http://patchwork.ozlabs.org/project/openwrt/patch/20190816150517.29633-2-zajec5@gmail.com/mbox/","series":[{"id":125618,"url":"http://patchwork.ozlabs.org/api/series/125618/?format=json","web_url":"http://patchwork.ozlabs.org/project/openwrt/list/?series=125618","date":"2019-08-16T15:05:16","name":"[OpenWrt-Devel,1/2] base-files: pass \"save_config\" option to the \"sysupgrade\" method","version":1,"mbox":"http://patchwork.ozlabs.org/series/125618/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1148282/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1148282/checks/","tags":{},"related":[],"headers":{"Return-Path":"<openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org\n\t(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;\n\tenvelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=gmail.com","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"h9QJb1I8\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"QlnR31+7\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[IPv6:2607:7c80:54:e::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 46968S26blz9sND\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 17 Aug 2019 01:06:00 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux))\n\tid 1hydnX-00019y-4D; Fri, 16 Aug 2019 15:05:47 +0000","from mail-lf1-x141.google.com ([2a00:1450:4864:20::141])\n\tby bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux))\n\tid 1hydnK-0000y3-2G\n\tfor openwrt-devel@lists.openwrt.org; Fri, 16 Aug 2019 15:05:35 +0000","by mail-lf1-x141.google.com with SMTP id b17so4267510lff.7\n\tfor <openwrt-devel@lists.openwrt.org>;\n\tFri, 16 Aug 2019 08:05:33 -0700 (PDT)","from localhost.localdomain\n\t(ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233])\n\tby smtp.gmail.com with ESMTPSA id\n\tw21sm961810lfl.84.2019.08.16.08.05.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 16 Aug 2019 08:05:30 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References:\n\tIn-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=hBK4Wyip5WWJT4jc85c3qcn9y2XBT7PTJWSTHhRbqcs=;\n\tb=h9QJb1I8OdQ0VJ\n\tk28aNDMWx3k7ErlvfdpFkWSHzfqTYR35UhBdILnLEIO2zYj8//xadBACuM3VgnHR3ezgEanCnDTm8\n\tRMUT7aHRG3Bp/Alc1sKjsf8TVHI+NDweea/lxxWFp7hdiRiINntkWi0gBH2uCB/grPVN9+I7SVwVa\n\tIDm/pO0O31OKS7jF69UgubNNjtef2oO5e3y6JhUx+U2SZbnDV/CEjE4HyLn0G956wH5FbIwUlb6j+\n\tLX1pF9Rqx/SuJ3HLfKseQesaFVg0uV/znigpsxoflGWCtgMUi+4dOujOCowmpLK+eW1ilNH+MLssC\n\tUhjhNbFd/2AfrrZ3CUPQ==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=2OcALIl3JpXq9R7ikU8sFtu6d9WD4sJsgP4GJkb9FZA=;\n\tb=QlnR31+7ZJV9p/C47Bo/PPqR9eOcQmMnwFz1l3Yb/XcQd/c0KLV16xPr02P+Uw72aR\n\t+3nQ3MwOVi/Pqn0uNy0nnNcOJrwEY+Ya1RQ4vfj68WrEt1btyByuG+dyKjHio76oO3Jy\n\tmngO138hGgV931G+XFeq1+/+D3aa9mh57nAwIQSFRhPpUpLuNKiln9PTVNsReG+CYFYf\n\t1Mj5Z2w4v5NEs+LJw7jwMJrRM+qCLallXGd6Y4X7D7hkci5CjTBF0uSzYqeWA3huQJxz\n\tnIjGJHKX+fiQq/Nsmu2GgE2xHCZFsWOL0TEHD2eb2/iyllNlgzOgP45V3PfsR9jjtd6q\n\tJHJw=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=2OcALIl3JpXq9R7ikU8sFtu6d9WD4sJsgP4GJkb9FZA=;\n\tb=PnXUcwX3Abqugew8G85Jrn8I+NyhArdd4DeOU9W+kQg6cnCuJeL8eYPn3GYDXPNLON\n\t+Y2+pp7dqh2WnGc0srk86bJmL9aiU2zpkgKPZuOm4DnakG5H76AphWvgswwFDPe450oy\n\tu4h6roPjnlI/U3Ca/T4kQv2uit4BrTTSGhxhol+nI3kOogljfspWIeaLfP4Jue5emvmj\n\t/Q0V2YHWvb5C3SnzxeGo5EnjXoLiEHr1tc1knNBzfdS4sMk0kOvd/T0j79juk0uTrlq/\n\te5BVVgn/KP22gGuB6x+5x1jmNMqYo7WqXoigbqtC0vaKNSn4+OlqwPBBXGz8fA2FGNtP\n\tYhVw==","X-Gm-Message-State":"APjAAAX6QKaUta9V4cgmXncScoI2pW3mGucdGHnRbccYeDl0RMeHJe4o\n\tGUhtajUEff8nHJPPLTO+MKdUGmDW","X-Google-Smtp-Source":"APXvYqzOHTVrPv1yGwiqQaZHGYvtExA1CILC0W9Oyl4oMHOflolNYIDREewGR9OoDcENPzBn1zKI+Q==","X-Received":"by 2002:a19:ca4b:: with SMTP id\n\th11mr5202956lfj.162.1565967931023; \n\tFri, 16 Aug 2019 08:05:31 -0700 (PDT)","From":"=?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <zajec5@gmail.com>","To":"openwrt-devel@lists.openwrt.org","Date":"Fri, 16 Aug 2019 17:05:17 +0200","Message-Id":"<20190816150517.29633-2-zajec5@gmail.com>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190816150517.29633-1-zajec5@gmail.com>","References":"<20190816150517.29633-1-zajec5@gmail.com>","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20190816_080534_178388_E584AEC2 ","X-CRM114-Status":"GOOD (  11.16  )","X-Spam-Score":"0.1 (/)","X-Spam-Report":"SpamAssassin version 3.4.2 on bombadil.infradead.org summary:\n\tContent analysis details:   (0.1 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,\n\tno trust [2a00:1450:4864:20:0:0:0:141 listed in]\n\t[list.dnswl.org]\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (zajec5[at]gmail.com)\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n\t0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends\n\tin digit (zajec5[at]gmail.com)\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n\tenvelope-from domain","Subject":"[OpenWrt-Devel] [PATCH 2/2] treewide: sysupgrade: pass\n\t\"save_partitions\" option to the \"sysupgrade\" method","X-BeenThere":"openwrt-devel@lists.openwrt.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<openwrt-devel.lists.openwrt.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/openwrt-devel>, \n\t<mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/openwrt-devel/>","List-Post":"<mailto:openwrt-devel@lists.openwrt.org>","List-Help":"<mailto:openwrt-devel-request@lists.openwrt.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/openwrt-devel>, \n\t<mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe>","Cc":"=?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <rafal@milecki.pl>,\n\tJo-Philipp Wich <jo@mein.io>, John Crispin <john@phrozen.org>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Sender":"\"openwrt-devel\" <openwrt-devel-bounces@lists.openwrt.org>","Errors-To":"openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org"},"content":"From: Rafał Miłecki <rafal@milecki.pl>\n\nThis explicitly lets stage2 know if partitions should be preserved. No\nmore \"touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap\" hack.\n\nSigned-off-by: Rafał Miłecki <rafal@milecki.pl>\n---\n package/base-files/files/lib/upgrade/stage2              | 5 -----\n package/base-files/files/sbin/sysupgrade                 | 9 ++-------\n target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh   | 2 +-\n target/linux/brcm2708/base-files/lib/upgrade/platform.sh | 2 +-\n target/linux/mvebu/base-files/lib/upgrade/sdcard.sh      | 2 +-\n target/linux/omap/base-files/lib/upgrade/platform.sh     | 2 +-\n target/linux/sunxi/base-files/lib/upgrade/platform.sh    | 2 +-\n target/linux/tegra/base-files/lib/upgrade/platform.sh    | 2 +-\n target/linux/x86/base-files/lib/upgrade/platform.sh      | 2 +-\n 9 files changed, 9 insertions(+), 19 deletions(-)","diff":"diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2\nindex 4e5837af83..ff2a9aee05 100755\n--- a/package/base-files/files/lib/upgrade/stage2\n+++ b/package/base-files/files/lib/upgrade/stage2\n@@ -6,8 +6,6 @@\n export IMAGE=\"$1\"\n COMMAND=\"$2\"\n \n-export SAVE_PARTITIONS=1\n-\n export INTERACTIVE=0\n export VERBOSE=1\n export CONFFILES=/tmp/sysupgrade.conffiles\n@@ -16,9 +14,6 @@ export CONF_TAR=/tmp/sysupgrade.tgz\n RAMFS_COPY_BIN=\t\t# extra programs for temporary ramfs root\n RAMFS_COPY_DATA=\t# extra data files\n \n-\n-[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0\n-\n include /lib/upgrade\n \n \ndiff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade\nindex 15514159b3..c27c1fbc47 100755\n--- a/package/base-files/files/sbin/sysupgrade\n+++ b/package/base-files/files/sbin/sysupgrade\n@@ -351,12 +351,6 @@ if [ $TEST -eq 1 ]; then\n \texit 0\n fi\n \n-if [ $SAVE_PARTITIONS -eq 0 ]; then\n-\ttouch /tmp/sysupgrade.always.overwrite.bootdisk.partmap\n-else\n-\trm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap\n-fi\n-\n install_bin /sbin/upgraded\n v \"Commencing upgrade. Closing all shell sessions.\"\n \n@@ -371,7 +365,8 @@ else\n \t\t\\\"path\\\": $(json_string \"$IMAGE\"),\n \t\t\\\"command\\\": $(json_string \"$COMMAND\"),\n \t\t\\\"options\\\": {\n-\t\t\t\\\"save_config\\\": $SAVE_CONFIG\n+\t\t\t\\\"save_config\\\": $SAVE_CONFIG,\n+\t\t\t\\\"save_partitions\\\": $SAVE_PARTITIONS\n \t\t}\n \t}\"\n fi\ndiff --git a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh\nindex c191271149..01327d926a 100644\n--- a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh\n+++ b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh\n@@ -43,7 +43,7 @@ mbl_do_upgrade() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\ndiff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh\nindex 37e479272b..693cde7779 100644\n--- a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh\n+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh\n@@ -45,7 +45,7 @@ platform_do_upgrade() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\ndiff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh\nindex 43fc2504fc..08ab17089d 100644\n--- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh\n+++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh\n@@ -49,7 +49,7 @@ platform_do_upgrade_sdcard() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\ndiff --git a/target/linux/omap/base-files/lib/upgrade/platform.sh b/target/linux/omap/base-files/lib/upgrade/platform.sh\nindex abe910b154..c8b0175fd5 100644\n--- a/target/linux/omap/base-files/lib/upgrade/platform.sh\n+++ b/target/linux/omap/base-files/lib/upgrade/platform.sh\n@@ -45,7 +45,7 @@ platform_do_upgrade() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\ndiff --git a/target/linux/sunxi/base-files/lib/upgrade/platform.sh b/target/linux/sunxi/base-files/lib/upgrade/platform.sh\nindex abe910b154..c8b0175fd5 100644\n--- a/target/linux/sunxi/base-files/lib/upgrade/platform.sh\n+++ b/target/linux/sunxi/base-files/lib/upgrade/platform.sh\n@@ -45,7 +45,7 @@ platform_do_upgrade() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\ndiff --git a/target/linux/tegra/base-files/lib/upgrade/platform.sh b/target/linux/tegra/base-files/lib/upgrade/platform.sh\nindex 97dd381041..66e7d91e3c 100644\n--- a/target/linux/tegra/base-files/lib/upgrade/platform.sh\n+++ b/target/linux/tegra/base-files/lib/upgrade/platform.sh\n@@ -62,7 +62,7 @@ platform_do_upgrade() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\ndiff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh\nindex 439ba8f512..162dbaf3aa 100644\n--- a/target/linux/x86/base-files/lib/upgrade/platform.sh\n+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh\n@@ -54,7 +54,7 @@ platform_do_upgrade() {\n \n \tsync\n \n-\tif [ \"$SAVE_PARTITIONS\" = \"1\" ]; then\n+\tif [ \"$UPGRADE_OPT_SAVE_PARTITIONS\" = \"1\" ]; then\n \t\tget_partitions \"/dev/$diskdev\" bootdisk\n \n \t\t#extract the boot sector from the image\n","prefixes":["OpenWrt-Devel","2/2"]}