Fix rpi image creation broken since to #6087 (#6123)

* Revert "Don't generate armbian.list if when==image-early"
This reverts commit 0b79ff3a63.
* Remove armbian.list.disabled file if it exists
This commit is contained in:
Gunjan Gupta
2024-01-02 03:49:35 +05:30
committed by GitHub
parent 900309eb0e
commit fbad168eda
2 changed files with 20 additions and 16 deletions

View File

@@ -42,6 +42,12 @@ function build_rootfs_and_image() {
# Deploy the full apt lists, including the Armbian repo.
create_sources_list_and_deploy_repo_key "image-late" "${RELEASE}" "${SDCARD}/"
# We call this above method too many times. @TODO: find out why and fix the same
# We may have a armbian.list.disabled file lying around. Remove the same
if [[ -e "${SDCARD}"/etc/apt/sources.list.d/armbian.list.disabled ]]; then
rm "${SDCARD}"/etc/apt/sources.list.d/armbian.list.disabled
fi
# remove packages that are no longer needed. rootfs cache + uninstall might have leftovers.
LOG_SECTION="apt_purge_unneeded_packages_and_clean_apt_caches" do_with_logging apt_purge_unneeded_packages_and_clean_apt_caches

View File

@@ -210,24 +210,22 @@ function create_sources_list_and_deploy_repo_key() {
components+=("${RELEASE}-utils") # utils contains packages Igor picks from other repos
components+=("${RELEASE}-desktop") # desktop contains packages Igor picks from other repos
if [[ "${when}" != "image-early" ]]; then # only add armbian.list when==image-late
# stage: add armbian repository and install key
if [[ $DOWNLOAD_MIRROR == "china" ]]; then
echo "deb ${SIGNED_BY}https://mirrors.tuna.tsinghua.edu.cn/armbian $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
elif [[ $DOWNLOAD_MIRROR == "bfsu" ]]; then
echo "deb ${SIGNED_BY}http://mirrors.bfsu.edu.cn/armbian $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
else
echo "deb ${SIGNED_BY}http://$([[ $BETA == yes ]] && echo "beta" || echo "apt").armbian.com $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
fi
# stage: add armbian repository and install key
if [[ $DOWNLOAD_MIRROR == "china" ]]; then
echo "deb ${SIGNED_BY}https://mirrors.tuna.tsinghua.edu.cn/armbian $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
elif [[ $DOWNLOAD_MIRROR == "bfsu" ]]; then
echo "deb ${SIGNED_BY}http://mirrors.bfsu.edu.cn/armbian $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
else
echo "deb ${SIGNED_BY}http://$([[ $BETA == yes ]] && echo "beta" || echo "apt").armbian.com $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
fi
# replace local package server if defined. Suitable for development
[[ -n $LOCAL_MIRROR ]] && echo "deb ${SIGNED_BY}http://$LOCAL_MIRROR $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
# replace local package server if defined. Suitable for development
[[ -n $LOCAL_MIRROR ]] && echo "deb ${SIGNED_BY}http://$LOCAL_MIRROR $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list
# disable repo if SKIP_ARMBIAN_REPO==yes, or if when==image-early.
if [[ "${SKIP_ARMBIAN_REPO}" == "yes" ]]; then
display_alert "Disabling Armbian repo" "${ARCH}-${RELEASE} :: skip:${SKIP_ARMBIAN_REPO:-"no"} when:${when}" "info"
mv "${SDCARD}"/etc/apt/sources.list.d/armbian.list "${SDCARD}"/etc/apt/sources.list.d/armbian.list.disabled
fi
# disable repo if SKIP_ARMBIAN_REPO==yes, or if when==image-early.
if [[ "${when}" == "image-early" || "${SKIP_ARMBIAN_REPO}" == "yes" ]]; then
display_alert "Disabling Armbian repo" "${ARCH}-${RELEASE} :: skip:${SKIP_ARMBIAN_REPO:-"no"} when:${when}" "info"
mv "${SDCARD}"/etc/apt/sources.list.d/armbian.list "${SDCARD}"/etc/apt/sources.list.d/armbian.list.disabled
fi
declare CUSTOM_REPO_WHEN="${when}"