From patchwork Mon Feb 12 10:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1897685 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=YUikrDLq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=m4atoFL2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (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 4TYLzt4P14z23nM for ; Mon, 12 Feb 2024 21:58:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MaPPuCUecMgGV/ItqktqiaOOaa4EUDSPQSXVRFbVRSM=; b=YUikrDLqyRW3xl 9Drbnz1f/bqAM0+wmdSTf9j6ghON5/uNEzMVC5I6eHBMewXUpRbF58Y6wPaTpKNoiGBanVLw7lMGs ADAFTgKPi2SxZ+lhDoUzul80ggUP2P274qseKVG4ytZNWm6tkX9p6bcbukMNDtyWZrHJkOVCCTtt/ OJf1L0X0LmFzrudMOlZbuJE5I/WJ3hkaWRYjRoYUlQnQYJlR056UqhsJoewJRtltkHzRxV1vl6rSV +rOWzFB9G8hvbXIfhbCYZ0WH7gVXD81cBVtMj6juh2nyqKBLnBS5Y1L1bE3fYD/Dwqpw735X/YoHi nogs803d4yEQD/cfwu+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0P-000000050O4-3vo2; Mon, 12 Feb 2024 10:57:45 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0N-000000050ND-1eaE for openwrt-devel@lists.openwrt.org; Mon, 12 Feb 2024 10:57:44 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so3938848a12.1 for ; Mon, 12 Feb 2024 02:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707735461; x=1708340261; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ri/1z65F4/i7leLgN+8h/QcwIMM6I1swqTL/KqYq/mU=; b=m4atoFL2i2dhy0iC+eypnKlyjC5Y2FVCqqbQ4dAPSO0LeCRl6HG9bOh3cVsdZDC3v+ QriC0qXDnY5t6F49yB86+mGmEo9wKOzy+UtQks1PxjWFp712I8iSdOSJYKlkmu76B4DL 4c40d7cejLvKt9K6nThLJsCMcj351ZI87I2TP4w/mQ4jC+C3Au5o+a2RM/GRebq5iTzt cqkU2yHnm8064FPRHCFeVp4F81kQYiH9lkOYyR6UFnfKtm+T7URRWpFAsF/8ARrgO8cn 7KgbpzLtfmgW8A/MlrImTNGvulUodhpG5/F/CeIEiyUs+0n7wxFpfyE5zm1dp/pzgPev uoxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707735461; x=1708340261; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ri/1z65F4/i7leLgN+8h/QcwIMM6I1swqTL/KqYq/mU=; b=AI2s3YmQpeasuoKDQN17FU0KafxUTK9lzvd8PY3x+84gBW1B5Ycl2EyzgawOrGs9oA iPFzS+nhaWLccAB51JwTn0xkMN32EM52OekrhQ+piDCpD+Re0A9KbZZwqPHuO3961FI2 qdYxbr2+E+9UE4THKwQlfPyxL45PoDDJKu/gTdSCsMekrMBd/e4KIPjhamH/skeaKYFk ThuLBWe822UKO/WHykxXnpboNBtvZgaVOW4U5xmr447hAIsm10Vk1C+6CN99bgh5Kn6V fX0bRxQcUcwQoubvTRqcvhyKG5U5UbMUQ/W1JDJ5ETqfrjp6wuaEI9pb/Z4QxBTYbi/3 SnoQ== X-Gm-Message-State: AOJu0YyAJfp044Qh0QMP/PQDLg1fC+yHfHSmRf2WgUe9UdthyZgVXTjs UHv8/FxStTzsfwAURdTBoplbTCysv99zk2K02kAa98qFCJJs42O1ei2kSeIM X-Google-Smtp-Source: AGHT+IHVPbVAq1gnhUGW1o695Ru+x9AKfrXtwBKJVU1GbL4c0W65hcbPRUkNHv5DYuxvMiogayMYfA== X-Received: by 2002:a17:906:68cc:b0:a3c:908b:bb29 with SMTP id y12-20020a17090668cc00b00a3c908bbb29mr2271013ejr.6.1707735461378; Mon, 12 Feb 2024 02:57:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUAG9vKlp87zEJGUzEaGKv7nA5vx66uflUygKVhTQ2puy2DIWnFYQLdju/qaNgAZsKfIzJ5OFBBjcZug5+4Z3XEKvYfua0Imp7GSA== Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id e2-20020a17090681c200b00a3c8f4bc31bsm91394ejx.38.2024.02.12.02.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:57:41 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/5] base-files: sysupgrade: replace UMOUNT_ETCBACKUP_DIR with a local variable Date: Mon, 12 Feb 2024 11:56:57 +0100 Message-Id: <20240212105701.5812-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240212_025743_463495_A754F19C X-CRM114-Status: GOOD ( 10.18 ) X-Spam-Score: 0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_It_was?= =?unknown-8bit?q?_used_inside_do=5Fsave=5Fconffiles=28=29?= =?unknown-8bit?q?_only=2E_Signed-off-by=3A_Rafa=C5=82_Mi=C5=82ecki_---_packa?= =?unknown-8bit?q?ge/base-files/files/sbin/sysupgrade?= =?unknown-8bit?q?_=7C_7_++++---_1_file_changed=2C_4_insertions=28+=29=2C_3_d?= =?unknown-8bit?q?eletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E0_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MmIgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends_in?= =?unknown-8bit?q?_digit?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail_provider?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki It was used inside do_save_conffiles() only. Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 9315091302..afcd868bae 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -24,7 +24,6 @@ export NEED_IMAGE= export HELP=0 export FORCE=0 export TEST=0 -export UMOUNT_ETCBACKUP_DIR=0 # parse options while [ -n "$1" ]; do @@ -225,6 +224,8 @@ include /lib/upgrade do_save_conffiles() { local conf_tar="$1" + local umount_etcbackup_dir=0 + [ "$(rootfs_type)" = "tmpfs" ] && { echo "Cannot save config while running from ramdisk." >&2 ask_bool 0 "Abort" && exit @@ -241,7 +242,7 @@ do_save_conffiles() { RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)" mkdir -p "$RAMFS/upper" "$RAMFS/work" mount -t overlay overlay -o lowerdir=$ETCBACKUP_DIR,upperdir=$RAMFS/upper,workdir=$RAMFS/work $ETCBACKUP_DIR && - UMOUNT_ETCBACKUP_DIR=1 || { + umount_etcbackup_dir=1 || { echo "Cannot mount '$ETCBACKUP_DIR' as tmpfs to avoid touching disk while saving the list of installed packages." >&2 ask_bool 0 "Abort" && exit } @@ -264,7 +265,7 @@ do_save_conffiles() { exit 1 fi - [ "$UMOUNT_ETCBACKUP_DIR" -eq 1 ] && { + [ "$umount_etcbackup_dir" -eq 1 ] && { umount "$ETCBACKUP_DIR" rm -rf "$RAMFS" }