From patchwork Wed Nov 25 03:45:56 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: 218 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:df02:0:0:0:0:0 with SMTP id i2csp373669oou; Wed, 25 Nov 2020 05:46:29 -0800 (PST) X-Received: by 2002:a7b:cc8c:: with SMTP id p12mr3607028wma.22.1606311988796; Wed, 25 Nov 2020 05:46:28 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1606311988; cv=pass; d=google.com; s=arc-20160816; b=fIyl0aHriCayoN/1N2c1VyGsjRFvVCT52XEvobusdHoXPhzPgmTT950i/jOyzzQA40 6WWqnd4LFT9e/jNfQ7UsPx4+77QLgMwOaSqOYLNrPEBTuN5HU8ftjAHDjkGl5lGLeHxb m8bUhbTJ+Mk8My3M7Y3Yt4WPe0FAra0sciKtBIgvffC5kOLrwDCXfqY32/pOq2wAuWpz ihUuFKnLdwffw8ZXbAfFO5mnFh3u2H8t6k0B0BaUrtc/jNrzIOavDUUuvYO4PS24/O6E 2aywIaZPb9pMUa6UqdWqgp3wDAekGtlnsu0s7uf+ZVSBhztLPK+i/7f/I7qAsq2zM8xB Wjqg== 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=P9gtxliX5HKM0NH3s3IC4XZ69gcJGrZCKRtc3+AZNwg=; b=wNGQDFzxf4IDoazsHwNR18NIgfrUxkTdDKCCbn9GBEaV+kB68BRbW8YeuV/hW0Hlqj +W9LkfUTH40yIF8mNyLX3RtlUXgHyeoUDqqT5J6t1FeR1K22lurH2UPdISvPJNDflDrw fPTk0ZsBFP4wBrK6uA3Sa0B1MPxBSTGuzxLY0oQhIV+42c6/itt6fpsqIlDNn4NpVNIl 6umLxa8pHBdeG6CovTlb/EUKAEu2rwaxYEqQod0nEBPyFy2U/Zozh3TxhjPFSodu4zLD o6KS1TzoWUh6uuiKPFzQe219pKMSBxC0yw21p3mPrydflbKI42oI7VsEpQYlqbd6Kmw9 AS9Q== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=XolSD0EB; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbnga7h6qkgqesu4sbfy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBNGA7H6QKGQESU4SBFY@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 i18sor1127159wrs.26.2020.11.25.05.46.28 (Google Transport Security); Wed, 25 Nov 2020 05:46:28 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbnga7h6qkgqesu4sbfy@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=XolSD0EB; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbnga7h6qkgqesu4sbfy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBNGA7H6QKGQESU4SBFY@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1606311988; cv=pass; d=google.com; s=arc-20160816; b=HasDaAgqWt1ul2kJ7E0S30kejFND4Avp9OnRQBkusEwY2L0IZy1CRg3YarokJNqhJO lKcT5ZkztAmH5YLYZaqypjm9/pqOgM5uZQWnHHxF2VcaoI9Z8qTnSD+FWyFJ8B4n6ntO 15YM7oW3MGdUX8PMquWQL025jQYVvgiR+C5KhBAsm48HgrWprsa350k8AgH3u5eD6UWp 75eGlasUhEBuBc04YmZiVhnPpoeIN4cBSpLT/i9CUCSQnV0n/2ASo4x+a/15BHofgusB LREWAFqvIPSJjGQFfnG16/dSRMpHIxcqfVlAJAWr0RgfAjzZOOJjHIo8pnzq2ktUgqgK sSKQ== 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=P9gtxliX5HKM0NH3s3IC4XZ69gcJGrZCKRtc3+AZNwg=; b=O746m+tYfhocMAjnZ4lrNmFqYc8ODGVDXH3gTQxjhZOaZw4yEijuCBTi4HHAQHfIfA 5gVOMmwDCB+GXQo5WCPoYTI3ZoeqXJXKQWdY9wOxgAdFtxzMf4wAQ1P8m8zqakgo2kLn gkUQoC1OvFY85GgS073y2kwkRiES0pYTZ3pNUdptIqSP4I5s/5yDsybMCw+arQauy5hE WLcH7Irmv2Kt8tUazyxHcZPPl4HydDdgnoQn3r+BCXKUlHXIYubDkI8E12YJ5sww0HM1 Cmsk5ZqiQ36gw818WuTMTRLmzWQuHfRfJ3syQJS/s4c90hvLqvW64aMX376RbGk8XxEb /xVw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 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=P9gtxliX5HKM0NH3s3IC4XZ69gcJGrZCKRtc3+AZNwg=; b=XolSD0EBOZ890vIA4MpGQpBHrqx21PaygGA5geYX2tI44lhQ5BToKj1eh6jP0LiHFT xnPkzrtwoG6aVcl4J5ze7VQkIL2riGJopOyi3RJJu/Vivnl7FPIYpeV2ECJBkZk7tTLp x26T9VqU8YmIByGBds4KQXN9yac4yJPSB7iQXuY51FmCWt+HCeEgswXHpGK4bFcvLl5K r4/OX00Yt1I8n+3taqQe/4OvP0NU57vAs+axQGypG+WvhTNm5Jq4Aa6D60swh8LGsnf2 RuLC+BQ98FVx7OyceSq004zKabXbi3g3XChg66Jc07xaBiZfEFFKgUj0roAoNVRntizc UWFA== 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=P9gtxliX5HKM0NH3s3IC4XZ69gcJGrZCKRtc3+AZNwg=; b=NeWX9nnYEEufJ8xHfvgYmi2//KqmkLpu2k4jD8JeUpMVLme5n96/rFG2p3h0gPMka8 QV7xiGZHX5HPybZOOybpP4xJfh30KW8dA29lXyGt7gh5Yc7L5UIkzQsqbIHQUOQE4j+9 ctrE4AQIhqxawuFoPovp4YNxOeu/ZUulphxWjFsN93M0IKlMS/nr/syBYL0E3Agf50H4 ULClgdcbmWqPGS0R2Jn0QOMAfeoRmBPrtYp09YfYh0rqfC1ut/zpF2xaE5xDmoesJUxE 1SwPdbS/0nuz06icTA/AjgpdHAjY71/gww4kpfzu4gjJv1lHUzmiIS8hBr3nLwolbboJ shUg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532FV3ihvCf3R71NiJhRmW0VJWxJxN+bNMheWeXUHN//P/b1EKrr HoOKNuUTQ1Ow6EaHhV+D16E= X-Google-Smtp-Source: ABdhPJw7YuhtJzeLMi1Z1AcrZy6RBn1AykGrlU4ipY3fRVsAFdDS+DmZY71dWzYbXhH75mqDnSTJCA== X-Received: by 2002:a5d:4bc7:: with SMTP id l7mr4434930wrt.105.1606311988535; Wed, 25 Nov 2020 05:46:28 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:f70d:: with SMTP id r13ls2844154wrp.1.gmail; Wed, 25 Nov 2020 05:46:27 -0800 (PST) X-Received: by 2002:adf:9e4d:: with SMTP id v13mr4115340wre.135.1606311987659; Wed, 25 Nov 2020 05:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606311987; cv=none; d=google.com; s=arc-20160816; b=heG89UdUvVF+jpDKOkqjC3QxR3eXFgSgHznGrdjchSR7/QSgMplKZd4o5sjj3Wm8QM pZOEwtpFCZAqg8R1P2iEsYZ1ONEw5s88pCio3gkpIYuYtcQPu2KUABQsymmtWWbaI16N LL83c3g0pPdaHvvOKPglFQrGRqi8052AH0LioMkLvJsMIz49LcweC7YcTbeEYR9L+qYC C/x/n8itOayNv8poZliz7LJcMK4HHqFZTfk3sx7TQbWeG9D2z0/GI3OllSQba0KqtEqn C5l7pSd0aINzsqGA+50FBH+Y58LWNv1PrvIMy4YTF9OoXMDIrUEksFyOruBnuXb7m2kd bYDw== 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=m56Ql/yoYpxgzaP8G+s9k7Tl2aypB9c8UmAgAfs7OO4=; b=GUsSK7RlSUciLhYpCQXivlUkBv0sKQflEk1W/KTzXbowbOm06eZOyw3qC/T1DLBpXu IRIwYOA9Fm/cOPo+T+BMwIXj98hEx1IaqSii5ZoVPKI5Qq1lGCIvwfVcybIJmKKyhHWv 50FuETYNunXa6ItxS/BfB4HGWKc7RePvxjSyytAeZiUzau9DYd4oB+9mSdi2QNMZLPX6 +jTzoFeK6POqHxAPnmHHcZ+7g2CkDazL/yLD1IYA0WwheDGTrFL7cH9PnqBe4scDH9EF P/YUxWgZMJ2DeGs9haS0iIXCTYbmJNvNg3f0fxRlZJcpziw+VRH9ARYEHM3IinchjR3e Txdg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id m5si64609wmc.0.2020.11.25.05.46.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2020 05:46:27 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; IronPort-SDR: SAWOln2JuUldPckDx6xrLl3JHlAjJjSQcanvfsU7gkwvfIqhB5lLxORXUS27pEUgM4F0vWywBp nk48o7BkMdH0paoNp36umkVTQsTaYaiWwFRIXKX3Bd7RpK9eFEdbUIPVeBFmeF17WeY5YGDaDG qeEcNuZ/Q6hd1/lJVyNGtHMwPvcCh7cuCgm32VlZClgKuAHx0Bx6BfGF60Tfg9t8kmKjJCa/2Z WbblOHtGXoLZr5ypARj5xd/V8UQZIXRF3ZBlqAQeKTuUtezYZGXlvFhDvCcvttSxecFyZYPewz Y/I= X-IronPort-AV: E=Sophos;i="5.78,368,1599552000"; d="scan'208";a="55597805" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 25 Nov 2020 05:46:26 -0800 IronPort-SDR: kh/JK3dD3ZL/ThJ32e1F8YuGZSdQWRB9t5XIqQoZpJgD5OE1NoL0w4a8XUhz9ortkXSn+7Xw7P F4mcdu81oWrX2sTM2pK0M2zrt1qw48RTr260EWrpD1bnsWtzgJb5Fgof+tlcj36NExhJ/orPLM bNmKDj4kgBhJEpr+LQZTnq/4nVYt3jWgG3syZ7gpyUKIRRyFgErPIioQKfOeyD6Z8s02468yrj gR5hG88ratWhP47G8JuKsvhLA30IVe26XdfdpzPEehLEfJfAjRePpAtUGyk5JpuKRYzxizvqk1 sSk= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v8 12/14] rootfs: Fix possible overwrite of existing resolv.conf Date: Wed, 25 Nov 2020 19:15:56 +0530 Message-ID: <20201125134558.26246-3-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201125134558.26246-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201125134414.26061-5-Vijaikumar_Kanagarajan@mentor.com> <20201125134558.26246-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) 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.137.252 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?1684340200197644948?= X-GMAIL-MSGID: =?utf-8?q?1684340200197644948?= 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 0aa5502..ed43fb9 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)}"