done
EOF
chmod +x "$rootdir/usr/local/sbin/policy-rc.d"
-[ -z "$bare" ] && [ -z "$ubuntu" ] && chroot "$rootdir" apt-get install -y --no-install-recommends locales-all
-chroot "$rootdir" apt-get install -y --no-install-recommends build-essential
-[ -z "$bare" ] && chroot "$rootdir" apt-get install -y --no-install-recommends zsh less vim fakeroot devscripts gdb
+
if [ -n "$ubuntu" ]; then
echo "deb $mirror ${suite}-updates main" >> "$rootdir/etc/apt/sources.list"
echo "deb $mirror ${suite}-security main" >> "$rootdir/etc/apt/sources.list"
chroot "$rootdir" apt-get update
chroot "$rootdir" apt-get dist-upgrade -y
fi
+
+[ -z "$bare" ] && [ -z "$ubuntu" ] && chroot "$rootdir" apt-get install -y --no-install-recommends locales-all
+chroot "$rootdir" apt-get install -y --no-install-recommends build-essential
+[ -z "$bare" ] && chroot "$rootdir" apt-get install -y --no-install-recommends zsh less vim fakeroot devscripts gdb
rm -f "$rootdir/etc/apt/sources.list" "$rootdir/etc/apt/sources.list.d/*"
chroot "$rootdir" apt-get clean
umount "$rootdir/dev" 2>/dev/null || true