mirror of
https://github.com/Fishwaldo/build.git
synced 2025-06-22 14:18:56 +00:00
Try to fix DNS (privacy) issues
This commit is contained in:
parent
e358089bbc
commit
f10acc0080
3 changed files with 9 additions and 6 deletions
|
@ -59,7 +59,6 @@ create_chroot()
|
||||||
printf '#!/bin/sh\nexit 101' > $target_dir/usr/sbin/policy-rc.d
|
printf '#!/bin/sh\nexit 101' > $target_dir/usr/sbin/policy-rc.d
|
||||||
chmod 755 $target_dir/usr/sbin/policy-rc.d
|
chmod 755 $target_dir/usr/sbin/policy-rc.d
|
||||||
rm $target_dir/etc/resolv.conf 2>/dev/null
|
rm $target_dir/etc/resolv.conf 2>/dev/null
|
||||||
echo "1.1.1.1" > $target_dir/etc/resolv.conf
|
|
||||||
rm $target_dir/etc/hosts 2>/dev/null
|
rm $target_dir/etc/hosts 2>/dev/null
|
||||||
echo "127.0.0.1 localhost" > $target_dir/etc/hosts
|
echo "127.0.0.1 localhost" > $target_dir/etc/hosts
|
||||||
mkdir -p $target_dir/root/{build,overlay,sources} $target_dir/selinux
|
mkdir -p $target_dir/root/{build,overlay,sources} $target_dir/selinux
|
||||||
|
|
|
@ -199,7 +199,8 @@ install_common()
|
||||||
|
|
||||||
# DNS fix. package resolvconf is not available everywhere
|
# DNS fix. package resolvconf is not available everywhere
|
||||||
if [ -d /etc/resolvconf/resolv.conf.d ]; then
|
if [ -d /etc/resolvconf/resolv.conf.d ]; then
|
||||||
echo 'nameserver 1.1.1.1' > $SDCARD/etc/resolvconf/resolv.conf.d/head
|
echo -e "# In case of DNS problems, try uncommenting this and reboot for debugging\n# nameserver 1.1.1.1" \
|
||||||
|
> $SDCARD/etc/resolvconf/resolv.conf.d/head
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# premit root login via SSH for the first boot
|
# premit root login via SSH for the first boot
|
||||||
|
@ -265,8 +266,6 @@ install_distribution_specific()
|
||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
chmod +x $SDCARD/etc/rc.local
|
chmod +x $SDCARD/etc/rc.local
|
||||||
# DNS fix
|
|
||||||
sed -i "s/#DNS=.*/DNS=1.1.1.1/g" $SDCARD/etc/systemd/resolved.conf
|
|
||||||
;;
|
;;
|
||||||
bionic)
|
bionic)
|
||||||
# remove doubled uname from motd
|
# remove doubled uname from motd
|
||||||
|
@ -297,8 +296,6 @@ install_distribution_specific()
|
||||||
version: 2
|
version: 2
|
||||||
renderer: NetworkManager
|
renderer: NetworkManager
|
||||||
EOF
|
EOF
|
||||||
# DNS fix
|
|
||||||
sed -i "s/#DNS=.*/DNS=1.1.1.1/g" $SDCARD/etc/systemd/resolved.conf
|
|
||||||
# Journal service adjustements
|
# Journal service adjustements
|
||||||
sed -i "s/#Storage=.*/Storage=volatile/g" $SDCARD/etc/systemd/journald.conf
|
sed -i "s/#Storage=.*/Storage=volatile/g" $SDCARD/etc/systemd/journald.conf
|
||||||
sed -i "s/#Compress=.*/Compress=yes/g" $SDCARD/etc/systemd/journald.conf
|
sed -i "s/#Compress=.*/Compress=yes/g" $SDCARD/etc/systemd/journald.conf
|
||||||
|
|
|
@ -56,6 +56,13 @@ case "$1" in
|
||||||
/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check whether DNS resolution works, if not switch to Cloudflare DNS
|
||||||
|
fping cloudflare.com >/dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
sed -i "s/#DNS=.*/DNS=1.1.1.1/" /etc/systemd/resolved.conf
|
||||||
|
sed -i "s/# nameserver.*/nameserver 1.1.1.1/" /etc/resolvconf/resolv.conf.d/head
|
||||||
|
fi
|
||||||
|
|
||||||
# some hardware workarounds
|
# some hardware workarounds
|
||||||
case $LINUXFAMILY in
|
case $LINUXFAMILY in
|
||||||
sun7i|sun8i)
|
sun7i|sun8i)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue