From 9b1fe7a820866cafad7b5592ba066e870ed81c30 Mon Sep 17 00:00:00 2001 From: Cody Shepherd Date: Wed, 12 Feb 2020 10:39:02 -0800 Subject: [PATCH] Fix broken DNS in buildd image builds. Instead of injecting an empty resolv.conf with an includes.chroot, we'll inject it in late with a hook. The empty resolv.conf breaks DNS early in the build, and causes some binary hooks to fail --- .../hooks/{49-policy-rc-d.binary => 48-policy-rc-d.binary} | 0 live-build/buildd/hooks/49-empty-resolv-conf.binary | 4 ++++ live-build/buildd/hooks/52-linux-virtual-image.binary | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) rename live-build/buildd/hooks/{49-policy-rc-d.binary => 48-policy-rc-d.binary} (100%) mode change 100644 => 100755 create mode 100755 live-build/buildd/hooks/49-empty-resolv-conf.binary diff --git a/live-build/buildd/hooks/49-policy-rc-d.binary b/live-build/buildd/hooks/48-policy-rc-d.binary old mode 100644 new mode 100755 similarity index 100% rename from live-build/buildd/hooks/49-policy-rc-d.binary rename to live-build/buildd/hooks/48-policy-rc-d.binary diff --git a/live-build/buildd/hooks/49-empty-resolv-conf.binary b/live-build/buildd/hooks/49-empty-resolv-conf.binary new file mode 100755 index 00000000..df4a9b9a --- /dev/null +++ b/live-build/buildd/hooks/49-empty-resolv-conf.binary @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +chroot chroot truncate -s 0 /etc/resolv.conf diff --git a/live-build/buildd/hooks/52-linux-virtual-image.binary b/live-build/buildd/hooks/52-linux-virtual-image.binary index 000eebc1..f373136b 100755 --- a/live-build/buildd/hooks/52-linux-virtual-image.binary +++ b/live-build/buildd/hooks/52-linux-virtual-image.binary @@ -27,10 +27,6 @@ cleanup_linux_virtual() { } trap cleanup_linux_virtual EXIT -# The base buildd chroot includes an empty resolv.conf -# We don't want to include that in the bootable images -rm $mount_d/etc/resolv.conf - # Install dependencies env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \ update --assume-yes