From patchwork Sat Jan 14 23:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roberto.foglietta@linuxteam.org X-Patchwork-Id: 2492 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sun, 15 Jan 2023 00:31:27 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-yb1-f189.google.com (mail-yb1-f189.google.com [209.85.219.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 30ENVQM0003851 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Jan 2023 00:31:26 +0100 Received: by mail-yb1-f189.google.com with SMTP id i17-20020a25bc11000000b007b59a5b74aasf26626220ybh.7; Sat, 14 Jan 2023 15:31:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673739080; cv=pass; d=google.com; s=arc-20160816; b=TDhpWp2lz54YZxmHDWNKklw/0NQgKFlBfdo7wKpJNj4ujwHI884dibXApkS+Kf19N+ ax55SOWofpVcOoFbx0elr6TiNWmHZgWHrSQ9QCnLBXyxrqa4OEbbz4MpZUPivQg9eaVo mvjXCQe2VwwdULdzvyYA/raEjTKM/ew5F1xkVFxsFsjpKSHiMTQvKZfxgYAG85CR9+yB NtMc+VbZUCBzvEHjOV0jTr0UKbLF6DqCEZwsdyA+0zYmk4KdR0a6GJ0Xd0zylT6abcx0 DqvoYb1W4et0yw+NWFBX4GVj1YDaEvpdplmGAsuFM0/IUaDFmsaV0WRIHL6mKUx/zNVS zyhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=/uLnvOlVlkdLJQKmfx6yi/UcjayKSwuMKVGZEi7eLkA=; b=tPRh1Pew6s8pJBPIeGFZSEkoYVS91iQRSXitY1ltyBDCH4Gr943iBmSIaQLzlgkmNJ Yprn/Jo+1V5JurOmru6Rg9lldO9UU/l/sOoBbYHBXWCMkjyp6G4rGgbZC+gS1zR5Q+O2 7XMQChmyb2+HKADxhFUToCVrPXx99cmTRy/swqXCEVStbs9rnQgaRlZZXyZ5/pjDxPCT 8iZSl47waABfU0bPkZD7RALtLVvquKbtsLnQ8/MpsVNgRY6mzSMomQmS4Fc/cTVDw+vU KHJtxwKVithMV3S6OEkQECA7HDHupDS6HhXd74N8SMhivLPVDebcy0e6ILODOOyBw//N F0YQ== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=/uLnvOlVlkdLJQKmfx6yi/UcjayKSwuMKVGZEi7eLkA=; b=hIef55ftUV3d67w5dtNOgq8hHdQSPDqQJAwtwMCb7QC5EA350GMlfUkW4Rd73TlG3X jyTzYfRY6t9+Qt0GAz43fZSVbNpsRNgAvFbBvip89BsqigZX7kcuNQxNO9kZ6g0B4ChP XL1DJvgVgCMuzGtzFb4KLudKh2sRpxfVsBU2Yya7ShcqUPhHTEwaDFwObfEPXQPyS9hX wGUlW7WV7ld2x3N5uAQth8JQdqiyV0S0hF7HLbMBDKG95yOoB0Ds/fe35G/I/DrtEFe2 MHd60K2MeI88mW2fBl3+CtUfP/DCQJR4Y0cGaEByv5uP2KbVVnDLuweBEKqLaZB+8P41 AYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=/uLnvOlVlkdLJQKmfx6yi/UcjayKSwuMKVGZEi7eLkA=; b=kkfFCK3CygQi3UaXQkyhe0T0ExTHxCmZR5rr3fY8YdjJQU7lYskFaKNInmwEFp/8cJ rqJbBkOCghIgokB2EMIbUl5bbfYJHeDhQ9omkTkbPdyGr0nSpajDf5IcV80gBquqSNQx EchNoIVA8Qn/HlspamJ3buxUzBW5my9OSKnb9fXtJnlhDi4jj6/gt8jcLZ9MkmxM60ri wUInQWUjJD3mH8NKITCAV8xvsyVxH6IAie2VcKnb36UqnP0Jeq35v4WOTEel9Ur+wFLm dbx7Qt7d3OaYRyAP2b0jBM8u0FQveRNVjH5b66R7nZpRtOwqkssg4gFYV+LCeQdNgG7p JrZQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AFqh2kpQWEXYGlQzJwkKIleqy2nShLOFHxoPJwBL4EjSsb6ATpdW/4jm qgE9ihvv2AaDl5TmTAhvphM= X-Google-Smtp-Source: AMrXdXvsG/zubZSJYiHunwEiT+/QtsWBSbwgEDlxNAJSzpLDsKPeEboXZb1MzGR2rBVjAGT7E3muDA== X-Received: by 2002:a25:606:0:b0:70b:cfb3:c0d5 with SMTP id 6-20020a250606000000b0070bcfb3c0d5mr8948136ybg.319.1673739080575; 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-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 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; 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 X-Original-Sender: roberto.foglietta@linuxteam.org X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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