From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7185526202960969728 X-Received: by 2002:a92:c60e:0:b0:302:be57:41aa with SMTP id p14-20020a92c60e000000b00302be5741aamr5315292ilm.231.1673010690103; Fri, 06 Jan 2023 05:11:30 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:f87:b0:30b:f63e:3073 with SMTP id v7-20020a056e020f8700b0030bf63e3073ls6967914ilo.5.-pod-prod-gmail; Fri, 06 Jan 2023 05:11:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXspN4AMPStdG5zm4+FYfggX+3KIPabrzt3IdyIa3QlhlfWO82RTqWez2yy5NEhx/HPq49SG X-Received: by 2002:a92:b708:0:b0:303:9e8d:8455 with SMTP id k8-20020a92b708000000b003039e8d8455mr35776251ili.7.1673010689597; Fri, 06 Jan 2023 05:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673010689; cv=none; d=google.com; s=arc-20160816; b=KeEIG806lCaoESFjESwteOJLGWcZmTzzSfIjP6xAU7F2ooW07Yd7D9ikFp+s5ARngV ZFQRCb/2NqqmZvJIolb7C+lFPiFU/HBbekOTV2kTasT0SptHcvBUfqcOAlC18M33W+wD qsnjnRszGPFdQhiMRERb76yRZlGeHCdTU2HhTG0RdVbXVlxQtpJ+PPfshVXuxvZZaCcw PoYW6+MXYNdkyQlRz59AWzrSbm393Fj8vfctTSFQPc+apklqJhlm1l3qfn/CPwLeueKq tU6HWqNeisw9QGNjEZZYLJ6D9HPHm1WPeybRm0MB6zZZ0YILOJ7ZOW4SsSLOg2aWP0TZ 3MJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=lBcUtmPbq58NGNRAQaP5hJCixzXIl4n2hVun9r84xk0=; b=mLbFNedQqVdCYGanud0c8xyUp5nlfJixEVVxEPJ2J2dHH4NJ1YC0yGVWXr4Jpje2x9 bqVavtQ5Scv65w4FvefU6vX6jZ48N/hwVz+wcV/piIKucBM4tb3Z3sLdbsmbIKXcCogN zZQkUIOpfzUQmCzX8sk2nq8sFta/8N/0wj9Zj5rA3vYmm/NgcLMsoTswq/lgRY1z/TJG XXPJNMjW5P3YNVCqx4cgfO9Qr5cA2bZGloXDOBcxaTHbxGBWVuUSdWiRE9nFSISAichA 9zUSAsndgmoa9wsmZ/bzICgS19cPT7DYIxovW2i0LfjHAPmz2frJA+MQdXm5+qmGtNtF jgog== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.167 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Return-Path: Received: from relay06.th.seeweb.it (relay06.th.seeweb.it. [5.144.164.167]) by gmr-mx.google.com with ESMTPS id h2-20020a92d082000000b0030bd6caf60asi62747ilh.5.2023.01.06.05.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 05:11:29 -0800 (PST) Received-SPF: pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.167 as permitted sender) client-ip=5.144.164.167; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.167 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Received: from localhost.localdomain (unknown [IPv6:2a02:8071:3187:7b80:1035:7147:9529:4b60]) by m-r2.th.seeweb.it (Postfix) with ESMTPA id 30C323EEE4; Fri, 6 Jan 2023 14:11:28 +0100 (CET) From: roberto.foglietta@linuxteam.org To: isar-users@googlegroups.com Cc: roberto.foglietta@gmail.com Subject: [PATCH v3] image: make sure do_rootfs_finalize can run multiple times, v3 Date: Fri, 6 Jan 2023 14:11:25 +0100 Message-Id: <20230106131125.3266701-1-roberto.foglietta@linuxteam.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: UWEP9hBe/xIU From: "Roberto A. Foglietta" image: make sure do_rootfs_finalize can run multiple times, v3 v2: essential code, only v3: code above the fix, rationalisation Signed-off-by: Roberto A. Foglietta --- meta/classes/image.bbclass | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 629a0c1..7a5ced5 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -419,15 +419,13 @@ do_rootfs_finalize() { mountpoint -q '${ROOTFSDIR}/sys' && \ umount -l ${ROOTFSDIR}/sys - rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list" - rm -f "${ROOTFSDIR}/etc/apt/preferences.d/isar-apt" - rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list" - rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar" - - mv "${ROOTFSDIR}/etc/apt/sources-list" \ - "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" - - rm -f "${ROOTFSDIR}/etc/apt/sources-list" + aptdir="${ROOTFSDIR}/etc/apt" + rm -f "${aptdir}/apt.conf.d/50isar" + rm -f "${aptdir}/preferences.d/isar-apt" + rm -f "${aptdir}/sources.list.d/isar-apt.list" + rm -f "${aptdir}/sources.list.d/base-apt.list" + mv -f "${aptdir}/sources-list" \ + "${aptdir}/sources.list.d/bootstrap.list" 2>/dev/null || : EOSUDO } addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess -- 2.34.1