From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7188654611285147648 X-Received: by 2002:a25:4683:0:b0:7b8:6b6d:cdc4 with SMTP id t125-20020a254683000000b007b86b6dcdc4mr3512492yba.635.1673739080642; Sat, 14 Jan 2023 15:31:20 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a25:a4c1:0:b0:7d0:bb42:da0d with SMTP id g59-20020a25a4c1000000b007d0bb42da0dls2471901ybi.3.-pod-prod-gmail; Sat, 14 Jan 2023 15:31:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXviE5fSjcPueJyL6daOsSsGbeUMJz48VgB/DTwfNlZwcbZOplTFZeeilO5N6axQxqu4i7oZ X-Received: by 2002:a25:a28c:0:b0:7d6:df8d:a7b2 with SMTP id c12-20020a25a28c000000b007d6df8da7b2mr873657ybi.21.1673739079863; Sat, 14 Jan 2023 15:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673739079; cv=none; d=google.com; s=arc-20160816; b=sj52xadp5ZaPlzWinpPk66izjZAVhjeHbB9KyafkqqOHOLxc+d9SJDH8VML6VN/gRG P5OPNgajTT4GL8inLkeXRIfOJ7XmMqYHqX5hxSrx3SkQMJyLg55uHQggaX1Byq+1Ebb4 PuykBP/fc7wuuoTJSKGfuCs68sj7Op6O8uNb+60/20zNzIs1LgtcFjpF6nazE9K6DHPb s+gekXYJLy+LraOmmU3mcO54EVBPaxZv8RUfyRZkQ0SwYqz5BAfMVcm5+nWOkGBiSvrr TgL+haBaUcMOENuWW/CgHitIFaGsH07LZU08wUGuI5KOUg1KTF5FwpWhnDTE3aTZIdfE keag== 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=C3lGLj1WLNkgRIEIf+XrsL/mdkkcqqQp6uj9LIcHMwU=; b=ycukbxDhFymbXLWBZYKqa/W5jQfs3kHNvt3CLbYd6fNm7sxKOimcEpFXFVAZjlsk6e Wfp0gcUnkp30nM6uM6x42V0nBNEUr/lJq3m2jM2Dha6Q6l2dy9BHPR99Ea7a2vV6ywbg 1WfhaToEqAPqnF/A1GRjJde2DCD5EIohP1wTcfu7xociDa6ZuCLk2FACKrQAOFt4TVNa Grg0tASAKR3c+T4zzmAPZzww1/EwCutzizhVzhU3j9JNOGhE/9VQAVhMc7HIVHTXd8A9 x9oy02XCcdKiAHymR8Coo5MQevfMpkmBBstVC5E0cDZgmRpBfMmxnaqiUcFBfMZsPBq5 OwvQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 2001:4b7a:2000:18::170 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Return-Path: Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it. [2001:4b7a:2000:18::170]) by gmr-mx.google.com with ESMTPS id y125-20020a257d83000000b007b5afaf560esi2232249ybc.4.2023.01.14.15.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Jan 2023 15:31:19 -0800 (PST) Received-SPF: pass (google.com: domain of roberto.foglietta@linuxteam.org designates 2001:4b7a:2000:18::170 as permitted sender) client-ip=2001:4b7a:2000:18::170; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 2001:4b7a:2000:18::170 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Received: from localhost.localdomain (unknown [IPv6:2a02:8071:3187:7b80:a441:b437:8b5e:2f2]) by m-r1.th.seeweb.it (Postfix) with ESMTPA id 61AD71F858; Sun, 15 Jan 2023 00:31:17 +0100 (CET) From: roberto.foglietta@linuxteam.org To: isar-users@googlegroups.com Cc: roberto.foglietta@gmail.com Subject: [PATCH v5] image: make sure do_rootfs_finalize can run multiple times, v5 Date: Sun, 15 Jan 2023 00:31:11 +0100 Message-Id: <20230114233111.542062-1-roberto.foglietta@linuxteam.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: uE0f8y6+lSlN From: "Roberto A. Foglietta" image, bugfix: make sure do_rootfs_finalize can run multiple times The rootfs_finalize task currently cannot be re-executed, as it moves the sources-list into bootstrap.list. As this only has to be done once, it is not required on subsequent executions. To fix the rebuild issue, we simply ignore the return code of the mv statement. v2: essential code, only v3: rationalisation of the code above the fix v4: like v3 but with the description provided by Felix Moessbauer v5: rationalisation of the code above the fix using 'cd $dir' + 'cd -' 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..4605d4f 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" + cd "${ROOTFSDIR}/etc/apt" + rm -f "apt.conf.d/50isar" + rm -f "preferences.d/isar-apt" + rm -f "sources.list.d/isar-apt.list" + rm -f "sources.list.d/base-apt.list" + mv -f "sources-list" "sources.list.d/bootstrap.list" 2>/dev/null ||: + cd - EOSUDO } addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess -- 2.34.1