From patchwork Thu Nov 26 08:29:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijai Kumar K X-Patchwork-Id: 249 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:df02:0:0:0:0:0 with SMTP id i2csp1570370oou; Thu, 26 Nov 2020 10:30:25 -0800 (PST) X-Received: by 2002:a17:902:9891:b029:d8:fdf6:7c04 with SMTP id s17-20020a1709029891b02900d8fdf67c04mr3684782plp.54.1606415425446; Thu, 26 Nov 2020 10:30:25 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1606415425; cv=pass; d=google.com; s=arc-20160816; b=Nyy2/XQzMdXKJtlb1iKtk1KoBNlpEp/TmfbEVOygiRvCvA00/fZMK98KnHvTVADJ2R 7s/DcNrF8Q5CaHDY8rtFhhapVGhrpJPG0dI5tsUHjDbBOV6XPQ4ooFa5QoQo6oUXMS+t QK6EvIszpcv2HfhrSZZjDEAjkNb5E0H2KXwO3m1VfLDFsSyGS2jJ7neeh3feiH6a0Nnc VnXS/tpxfy1FjldD+hijfEW/J9H7ImmtfslTkAX21IJa22D0gNYf7QtTXgtXz92qBWoe y+tx1lc2fX10nFCanctwv44XZnoDRShDUfU0rqho4HAVdN5gvSic9Qwi+Bb8w3iGSq0q nYXw== ARC-Message-Signature: i=3; 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:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=QAIMLEF0wiqz5yNNY69+eYtXIbSVDZjuv4wqfJOuO0A=; b=x0cEhk3NlI9N+Q4lx3/cZ64/fTbpF+Ta07P0kKuRycU9zWwiXm4BKh+1k2WHDyNYRT fhoPXpJOp2bQd5z/9CY/xHIyoRKDIUMNwCPLPRIWuxqUVF2ryiWsi7vtP2p/Ul0it6Ml cgCtC1NrLF+86PX0dXlHRX6a/592ov9nApFUfHKP2G91EolKaAjMDLde2t+nOdGW8Z3N 2AHuVUBp417+cjzjurniVO861wQnlcUJM9uSQv704qCPr0ZAq3QVMwqXw62UvrAgJWBz AtqXqJLFtzGGzO3VU5Fmx+gKzOvbetyqjJh9E2TtXsei9hofwKhJC1ha18cB2fG37KbG iYCQ== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=Sw2uV9nj; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbqhi776qkgqet62r4jq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBQHI776QKGQET62R4JQ@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id y5sor3970837pji.4.2020.11.26.10.30.25 (Google Transport Security); Thu, 26 Nov 2020 10:30:25 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbqhi776qkgqet62r4jq@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=Sw2uV9nj; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbqhi776qkgqet62r4jq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBQHI776QKGQET62R4JQ@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1606415425; cv=pass; d=google.com; s=arc-20160816; b=BxXu7KJJkLBW3QKr2biJ2nAsiILE3ua8dG9K59Mns9dGzsNcwi3/shkPzKy1r97k2c lXy/ItEkBgpuxFrY4MZCFLv7Q+/q6HRBXLqnGqxTPVEUbx7Q/FdpeVnaoReGzbRGiRV7 QLFfY40gZqCkPistvScfuxqKpEi0F5yTxouBPihRshvdZMq9CJui+EyfyHPjd/sBqyZz 2/cLxSsiFGfodrrVttzV8J4GLtcSaEMmI2/+vpxGAbYg6jeVF/6lF3uWcnlwdXET2TWm FNiPVdSIblnnsjWmIQ6epu6NqZuRXx4evE0QJ4xx1Vkh8zjnwiXfpClkf2dhm6mLh6k0 tuIA== 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:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=QAIMLEF0wiqz5yNNY69+eYtXIbSVDZjuv4wqfJOuO0A=; b=ROrTE7c5Mn4nnWjEAr4gQQqROCSEQvx+qePCV8KAjUXrsvfE5o+yic3BPlpAu7gpfq Pm9yvAwHSmY9zjNvY0Zq2Rsu7u2FhsA4SIhP2L+lE/6JjW15R7u5lH3azDK+yMfQ0cfE gp2MDeA/JgyL1ArZBRaBxKUWuhsqIfbTzRoZhx3CUwcR48FSxG1rtoyzZQ8aJ5GUPrZy E9YHoYg1qQWazJ4aw9m+fw9N9eBwID5/pSuG1st6wqHkL1hS5m/ElOVJ1qcRjPZyi0KP 5ZUOFByaNVFUqqVf5y8TkqWSvcPADqkk9AosPuezXN7qqwj/m26tfwFCU5s/Wp4D4psR mJkw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=QAIMLEF0wiqz5yNNY69+eYtXIbSVDZjuv4wqfJOuO0A=; b=Sw2uV9njFcpSpDJmsQ+Xx9vjZQKH05HOEbwq8d+EnjoUeQIXgehTk4e1TTSInajgGe 8wWNYgTxAJWmXqg38RKFLlydIV6LaxH6a5htucnWb20A54VHGBg5BoLMt6aRAUIMycUy 6k/d8DXGBj5Up+tVBhJdIL1NDGKc7TyYH/rr0PK5k8uTggR/oQPJGxXsuqvWuJ8XH8FC OeE0CfqnyrKjsV8Nwe6beXA7VEvU/8sgMZ2b9omBCDAgcAu8d0s8/qFht9I2vsamhLSX eVj5t7/o1iifxxFkk+UJ1JIzK5dRWDhayKdaz9Vzi4k1xXfM1xuVWzJemdP5nvMPiQFK HUcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=QAIMLEF0wiqz5yNNY69+eYtXIbSVDZjuv4wqfJOuO0A=; b=Hvagki7Njgg2DczFkcEnPavtS9Cy/NCCXYjPdELJjEfkzmJlXUthQUf+SgjE2+cJZO qwuxLWB7VfSS8KXwQfqMdKezPi3lwungWfXedHjYqsFW0IJZpHqOtlJVDPTHcyr9qG+o vP9YGhkZ2qFEOQ/VXEdhh5/jT1/wpsXICLRD63cL9F4P2KzWL3Q3QKY7GDZ1PSgRKnY/ eX3zV84tC7VjckN2s/4rVuI3mXzLCdbGTg0IV9U1oHC9J/FBLzvITDdU204Ti7/zEWXb i0Igl4pqBh9rflQ83FCMxuM9wCEdFHn8vrd3q29FNpCOSWw/iqAvjw04wBESOjdENkjU N2EQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533vkOX3SdxjfrzyAQfPlTlwlPrLYIcHcxyTlWvOYfi3pPjkA/KY YXIw0Y9GDcqbkM3SLERsAlY= X-Google-Smtp-Source: ABdhPJwEBWzFm7Y7I/B8CWQ42jy2SDe6Etykm/vai2AaFHcyavAbgGD/ZwR1/5uhO/qH+l2ZAUzuiw== X-Received: by 2002:a17:90b:1645:: with SMTP id il5mr5074171pjb.15.1606415425045; Thu, 26 Nov 2020 10:30:25 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:524:: with SMTP id 33ls1327582plf.6.gmail; Thu, 26 Nov 2020 10:30:24 -0800 (PST) X-Received: by 2002:a17:90b:104c:: with SMTP id gq12mr4929412pjb.167.1606415424362; Thu, 26 Nov 2020 10:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606415424; cv=none; d=google.com; s=arc-20160816; b=w5rLAtefXP4ku3ZNuiNpJGvjtOL57LtleKX1nBv1SjBTDzzNe7uvDiBuUlE7bMk6Sp Yt6c+IWPlReHPYLVQ3LijUHwI/qKDG5UKdPNZJHLs4WTuu0EfcMS8GaYg4h1He70UG+q NYDoETkbX5gie9eutx7wm7S4OEzv5PiU7hM4sFo7PDsNUARWkzyeMl975CC/Yz459pM3 VwFxFO/WJoRMcrXKGA1esWaN+CLgFjAKg/DgpkILVXh1OfWEqavRb5Am4vnS/N7RDS6V sihyjZXuTM1ATowWoMmtkvhY43ep1ISjKk7TvtwUFq8sRZ+QUEi1+9f951dIwdEfL+5d k6wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=bz3Ffi+QTqIAkvjPfuanrzWssstDOmJH3k0IUQraIwQ=; b=XacYQs1vPd5LZB5u+zhCkSHfjjyoLeagnWc557FKhFfraPq2dC4l8PA8C+m/4TTkOJ 9bMkzwnwD9TN6NaV4XfM2zwASArGXluXkNsUt8kmPBfQ0rO9WXnxzM8SvLfR3rXpGk/M bnJgK00RY+dmvbCIAlin8aNepi5DwIjC6w7hCxI8qmnQ619kHhWjBl/y8ZvYPtsSlrap rI514BX3AvgjS7R4JV6X7Lh9/c1RxCO3/yZ8cSLNiAbtrKBSrqJOXG+7Cswwdw12RdNt cnpfp3DaexLUoa4ut4AOCe8/6v17pxMqGJB+QH6SmmBeCONdo+S94wzSvKInXCHBDYpp Sc4A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id s12si571207pjq.3.2020.11.26.10.30.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 10:30:24 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; IronPort-SDR: gkM9v6I/19GW0dbaB4LWEs4T6XBqqWWPCrm9wUN+Sw9Mk3S62ojFb2HZk0PbedG+pqQVizw+fD Rfkk7yuWcbD5HuWQWAJsNvJ+4xcdi4UaAtZ8o2tX/w6nZbBfiw59P/ub2s48G402nh/o6ZozBU k8hZUULW0AzcWopj7REfw03DqkkeiD1Qobe+l6wk41m6jHq9w30qAQJt4s/ApQwNJW/r1TqTyV YxmuQMuj/G2Sbqd25TlQpdj20uBFCyBH+yckfR9b8h27sFuP1bhPy/DHbq3jMkdXzSyvyc6jcB 9K8= X-IronPort-AV: E=Sophos;i="5.78,372,1599552000"; d="scan'208";a="55536078" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 26 Nov 2020 10:30:23 -0800 IronPort-SDR: R5W0NFf5+JNWBjsC1vLx1PH61ndf6bJIu1GmST7ABZz9GuAYG5ONLQYo7CXJ2icLQVgwd6IpXO tpZJlJTqoYubeCIj0MhkxYShfoyiExABdd2D2ZfYFsEYmYKb3zDDQ/QAfKqtweV+Cp2BTEv2Ac DT7hpeptyehTPa8feDJbkSzIPB3MT5Jym44n5D4oi+tLLJCcACIin4kr5tLTzWQBRFnTHR4kqd H2uXZsXKF8MLq8W035X/h+BbopQy3ae5Ny+bjMrTc+tpbscBlfarQdLD8UC+1zk8dF4fkuuLZi TwM= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v10 12/14] rootfs: Fix possible overwrite of existing resolv.conf Date: Thu, 26 Nov 2020 23:59:51 +0530 Message-ID: <20201126182953.7518-4-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201126182953.7518-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201126182818.7261-9-Vijaikumar_Kanagarajan@mentor.com> <20201126182953.7518-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-Original-Sender: vijaikumar_kanagarajan@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1684448661112143400?= X-GMAIL-MSGID: =?utf-8?q?1684448661112143400?= There is a possiblilty that one of the packages installed in the rootfs provides /etc/resolv.conf and we might accidentally remove it. Fix it by taking a backup of any existing resolv conf files and restoring it later. This is needed since we could not effectively move caching before rootfs_install_clean_files since we need the latest dpkg log. Signed-off-by: Vijai Kumar K --- meta/classes/rootfs.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index b589dbc..99f677b 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -186,10 +186,18 @@ python do_rootfs_install() { addtask rootfs_install before do_rootfs_postprocess after do_unpack cache_deb_src() { + if [ -e "${ROOTFSDIR}"/etc/resolv.conf ]; then + sudo mv "${ROOTFSDIR}"/etc/resolv.conf "${ROOTFSDIR}"/etc/resolv.conf.isar + fi rootfs_install_resolvconf + deb_dl_dir_import ${ROOTFSDIR} ${ROOTFS_DISTRO} debsrc_download ${ROOTFSDIR} ${ROOTFS_DISTRO} - rootfs_install_clean_files + + sudo rm -f "${ROOTFSDIR}"/etc/resolv.conf + if [ -e "${ROOTFSDIR}"/etc/resolv.conf.isar ]; then + sudo mv "${ROOTFSDIR}"/etc/resolv.conf.isar "${ROOTFSDIR}"/etc/resolv.conf + fi } ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'clean-package-cache', 'rootfs_postprocess_clean_package_cache', '', d)}"