From 6efb96c040705fac09a15a5a76b23f9871579bab Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Fri, 19 May 2023 05:47:17 +0800 Subject: [PATCH] Clear /etc/resolv.conf before building image (#12592) (#15104) Cherry pick PR#12592 Why I did it nameserver and domain entries from build system fsroot gets into sonic image. How I did it Clear /etc/resolv.conf before building image How to verify it Built image with it and verified with install that /etc/resolv.conf is empty Co-authored-by: Devesh Pathak <54966909+devpatha@users.noreply.github.com> --- build_debian.sh | 1 + files/image_config/resolv-config/resolv.conf | 0 2 files changed, 1 insertion(+) create mode 100644 files/image_config/resolv-config/resolv.conf diff --git a/build_debian.sh b/build_debian.sh index 008efd1623..5f58f031e6 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -612,6 +612,7 @@ sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS sudo du -hsx $FILESYSTEM_ROOT sudo mkdir -p $FILESYSTEM_ROOT/var/lib/docker scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT +sudo cp files/image_config/resolv-config/resolv.conf $FILESYSTEM_ROOT/etc/resolv.conf sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -e boot -e var/lib/docker -e $PLATFORM_DIR # Ensure admin gid is 1000 diff --git a/files/image_config/resolv-config/resolv.conf b/files/image_config/resolv-config/resolv.conf new file mode 100644 index 0000000000..e69de29bb2