Skip to content

Commit

Permalink
Set resolv.conf early
Browse files Browse the repository at this point in the history
  • Loading branch information
mekanix committed May 17, 2023
1 parent 3b5ea07 commit 82282e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 0 additions & 7 deletions scripts/base-network-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ dns() {
jexec ${SERVICE} usr/local/bin/reggae-register.sh ipv6 add ${IPV6_PREFIX}${MASTER_IP6} @ ${DOMAIN}
jexec ${SERVICE} /usr/local/bin/reggae-register.sh ipv6 add ${IPV6_PREFIX}${MASTER_IP6} network ${DOMAIN}
fi
echo "search $(hostname)" >"${BASE_WORKDIR}/${SERVICE}/etc/resolv.conf"
if [ "${USE_IPV4}" = "yes" ]; then
echo "nameserver 127.0.01" >>"${BASE_WORKDIR}/${SERVICE}/etc/resolv.conf"
fi
if [ "${USE_IPV6}" = "yes" ]; then
echo "nameserver ::1" >>"${BASE_WORKDIR}/${SERVICE}/etc/resolv.conf"
fi
}


Expand Down
8 changes: 7 additions & 1 deletion scripts/mkjail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ bsdinstall distextract
sed -i "" -e "s/^Components .*/Components world/" "${BSDINSTALL_CHROOT}/etc/freebsd-update.conf"
mkdir -p "${BSDINSTALL_CHROOT}/usr/local/etc/pkg/repos"
echo -e "FreeBSD: {\n url: \"pkg+http://${PKG_MIRROR}/\${ABI}/${PKG_REPO}\",\n}">"${BSDINSTALL_CHROOT}/usr/local/etc/pkg/repos/FreeBSD.conf"
cp /etc/resolv.conf "${BSDINSTALL_CHROOT}/etc/resolv.conf"
echo "domain ${DOMAIN}" >"${BSDINSTALL_CHROOT}/etc/resolv.conf"
if [ "${USE_IPV4}" = "yes" ]; then
echo "nameserver ${INTERFACE_IP}" >>"${BSDINSTALL_CHROOT}/etc/resolv.conf"
fi
if [ "${USE_IPV6}" = "yes" ]; then
echo "nameserver ${IPV6_PREFIX}${INTERFACE_IP6}" >>"${BSDINSTALL_CHROOT}/etc/resolv.conf"
fi
if [ "${UPDATE}" != "no" -a "${OS_VERSION_NAME}" = "RELEASE" ]; then
chroot "${BSDINSTALL_CHROOT}" freebsd-update --currently-running "${OS_VERSION}-${OS_VERSION_NAME}" fetch install
fi
Expand Down

0 comments on commit 82282e7

Please sign in to comment.