Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 2acf85b3 authored by Robert Nelson's avatar Robert Nelson
Browse files

chroot: make sure we dont lose /etc/resolv.conf


Signed-off-by: default avatarRobert Nelson <robertcnelson@gmail.com>
parent f9e776a3
Branches
Tags
No related merge requests found
......@@ -601,23 +601,23 @@ cat > "${DIR}/chroot_script.sh" <<-__EOF__
echo "debug: apt-get upgrade -y--------"
apt-get upgrade -y
if [ -f /etc/resolv.conf ] ; then
echo "debug: networking: --------------"
cat /etc/resolv.conf || true
echo "---------------------------------"
cp -v /etc/resolv.conf /etc/resolv.conf.bak
if [ ! -f /etc/resolv.conf ] ; then
echo "debug: /etc/resolv.conf was removed! Fixing..."
#'/etc/resolv.conf.bak' -> '/etc/resolv.conf'
#cp: not writing through dangling symlink '/etc/resolv.conf'
cp -v --remove-destination /etc/resolv.conf.bak /etc/resolv.conf
fi
echo "---------------------------------"
echo "debug: apt-get dist-upgrade -y---"
apt-get dist-upgrade -y
echo "---------------------------------"
if [ ! -f /etc/resolv.conf ] ; then
echo "debug: /etc/resolv.conf was removed! Fixing..."
#'/etc/resolv.conf.bak' -> '/etc/resolv.conf'
#cp: not writing through dangling symlink '/etc/resolv.conf'
cp -v --remove-destination /etc/resolv.conf.bak /etc/resolv.conf
fi
echo "---------------------------------"
if [ "x${chroot_very_small_image}" = "xenable" ] ; then
if [ -f /bin/busybox ] ; then
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment