Don't rely on local dns

Could possibly be systemd-resolved or dnsmasq, etc. Broken on running
pacstrap.
This commit is contained in:
Felix Yan 2020-08-12 05:21:17 +08:00
parent e5c82ad97f
commit 1dcf524b05
No known key found for this signature in database
GPG key ID: 786C63F330D7CB92

View file

@ -58,7 +58,12 @@ download_and_extract_bootstrap() {
sha1sum -c sha1sums.txt || exit 1 sha1sum -c sha1sums.txt || exit 1
tar -xpzf "$filename" tar -xpzf "$filename"
rm -f "$filename" rm -f "$filename"
if grep -E '^nameserver\s+127\.' /etc/resolv.conf > /dev/null; then
echo "nameserver 8.8.8.8" > "/root.$cpu_type/etc/resolv.conf"
else
cp -L /etc/resolv.conf "/root.$cpu_type/etc" cp -L /etc/resolv.conf "/root.$cpu_type/etc"
fi
# Mount options taked from arch-chroot script # Mount options taked from arch-chroot script
mount -t proc proc -o nosuid,noexec,nodev "/root.$cpu_type/proc" mount -t proc proc -o nosuid,noexec,nodev "/root.$cpu_type/proc"