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.
This commit is contained in:
Cody Shepherd 2020-09-04 07:33:00 -07:00
parent e23685134e
commit 515bc1430b
No known key found for this signature in database
GPG Key ID: 0DB7E5F05C3FAB5F

View File

@ -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