From 515bc1430b7253db5f3990d92fa37dff2a5e7351 Mon Sep 17 00:00:00 2001 From: Cody Shepherd Date: Fri, 4 Sep 2020 07:33:00 -0700 Subject: [PATCH] Safely set /etc/resolv.conf to an empty file in buildd images. In the buildd image chroot, /etc/resolv.conf is a symbolic link to a configuration file in the /run directory. A call to truncate will modify that file, which we should not do. Instead, we want to remove the symbolic link and replace it with an empty file. --- live-build/buildd/hooks/49-empty-resolv-conf.binary | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/live-build/buildd/hooks/49-empty-resolv-conf.binary b/live-build/buildd/hooks/49-empty-resolv-conf.binary index df4a9b9a..a6f97526 100755 --- a/live-build/buildd/hooks/49-empty-resolv-conf.binary +++ b/live-build/buildd/hooks/49-empty-resolv-conf.binary @@ -1,4 +1,3 @@ -#!/bin/sh -set -e - -chroot chroot truncate -s 0 /etc/resolv.conf +#!/bin/sh -e +chroot chroot rm /etc/resolv.conf +chroot chroot touch /etc/resolv.conf