Skip to content

Commit

Permalink
Merge pull request #274 from viraniac/master
Browse files Browse the repository at this point in the history
Handle dns for symlinked resolv.conf files
  • Loading branch information
numbqq authored Apr 26, 2024
2 parents 96f543d + 929eaae commit 7bbff0c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/functions/build-rootfs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,13 @@ build_rootfs() {
echo "NOTE: ENTER CHROOT AND EXECUTE SCRIPT: $POST_SCRIPT"
echo
mount_chroot "$ROOTFS_TEMP"

if [ -L "$ROOTFS_TEMP"/etc/resolv.conf ] && [ ! -e "$ROOTFS_TEMP"/etc/resolv.conf ]; then
resolvconf_file=$(readlink -m $ROOTFS_TEMP/etc/resolv.conf)
mkdir -p $(dirname $resolvconf_file)
echo "nameserver $NAMESERVER" >> $resolvconf_file
fi

chroot $ROOTFS_TEMP/ bash "/tmp/${POST_SCRIPT##*/}"

## Logo
Expand Down

0 comments on commit 7bbff0c

Please sign in to comment.