diff --git a/build-rpi.sh b/build-rpi.sh index cad3831..106aeb5 100755 --- a/build-rpi.sh +++ b/build-rpi.sh @@ -30,8 +30,16 @@ version=23.04 YYYYMMDD="$(date +%Y%m%d)" imagename=ubuntusway-$version-$channel-rpi-$YYYYMMDD -mkdir -p "${basedir}" -cd "${basedir}" +# Remove old builds before creating new one +echo -e " +#----------------------# +# REMOVE OLD BUILDS # +#----------------------# +" + +if [ -d $rootdir/artifacts ]; then + rm -rf $rootdir/artifacts +fi # Bootstrap an ubuntu minimal system echo -e " @@ -40,6 +48,9 @@ echo -e " #----------------------# " +mkdir -p "${basedir}" +cd "${basedir}" + debootstrap \ --arch $architecture \ --components=main,restricted,universe,multiverse \