move armbian source to create_sources_list (#1532)

1. move armbian source to create_sources_list
2. check DOWNLOAD_MIRROR
3. alse change prebuild rootfs's source list

Signed-off-by: Zhang Ning <832666+zhangn1985@users.noreply.github.com>
This commit is contained in:
zhangn1985 2019-09-01 06:11:40 +08:00 committed by Igor Pečovnik
parent 1b5096e961
commit e71c145cb7
2 changed files with 13 additions and 8 deletions

View file

@ -117,6 +117,7 @@ create_rootfs_cache()
[[ $? -ne 0 ]] && rm $cache_fname && exit_with_error "Cache $cache_fname is corrupted and was deleted. Restart."
rm $SDCARD/etc/resolv.conf
echo "nameserver $NAMESERVER" >> $SDCARD/etc/resolv.conf
create_sources_list "$RELEASE" "$SDCARD/"
else
display_alert "... remote not found" "Creating new rootfs cache for $RELEASE" "info"
@ -184,14 +185,6 @@ create_rootfs_cache()
# stage: create apt sources list
create_sources_list "$RELEASE" "$SDCARD/"
# stage: add armbian repository and install key
echo "deb http://apt.armbian.com $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" > $SDCARD/etc/apt/sources.list.d/armbian.list
cp $SRC/config/armbian.key $SDCARD
eval 'chroot $SDCARD /bin/bash -c "cat armbian.key | apt-key add -"' \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
rm $SDCARD/armbian.key
# add armhf arhitecture to arm64
[[ $ARCH == arm64 ]] && eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "dpkg --add-architecture armhf"'

View file

@ -164,6 +164,18 @@ create_sources_list()
EOF
;;
esac
# stage: add armbian repository and install key
if [[ $DOWNLOAD_MIRROR == "china" ]]; then
echo "deb http://mirrors.tuna.tsinghua.edu.cn/armbian $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" > $SDCARD/etc/apt/sources.list.d/armbian.list
else
echo "deb http://apt.armbian.com $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" > $SDCARD/etc/apt/sources.list.d/armbian.list
fi
cp $SRC/config/armbian.key $SDCARD
eval 'chroot $SDCARD /bin/bash -c "cat armbian.key | apt-key add -"' \
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
rm $SDCARD/armbian.key
}
# fetch_from_repo <url> <directory> <ref> <ref_subdir>