diff --git a/lib/functions/configuration/main-config.sh b/lib/functions/configuration/main-config.sh index 40f599399..887f7d729 100644 --- a/lib/functions/configuration/main-config.sh +++ b/lib/functions/configuration/main-config.sh @@ -338,11 +338,6 @@ function do_extra_configuration() { fi fi - # Debian needs the ports repo when strapping riscv64 - revise after bookworm release - if [[ "${ARCH}" == "riscv64" ]] && [[ $DISTRIBUTION == Debian ]]; then - DEBIAN_MIRROR='deb.debian.org/debian-ports' - fi - # Control aria2c's usage of ipv6. [[ -z $DISABLE_IPV6 ]] && DISABLE_IPV6="true" diff --git a/lib/functions/general/apt-utils.sh b/lib/functions/general/apt-utils.sh index 6c0e3a364..d63697a75 100644 --- a/lib/functions/general/apt-utils.sh +++ b/lib/functions/general/apt-utils.sh @@ -12,7 +12,6 @@ function apt_find_upstream_package_version_and_download_url() { declare -a package_info_download_urls=() declare first_letter_of_sought_package_name="${sought_package_name:0:1}" declare mirror_with_slash="undetermined/" - declare pool_name_extension="" case "${DISTRIBUTION}" in Ubuntu) # try both the jammy-updates and jammy repos, use whatever returns first @@ -24,7 +23,6 @@ function apt_find_upstream_package_version_and_download_url() { Debian) package_info_download_urls+=("https://packages.debian.org/${RELEASE}/${ARCH}/${sought_package_name}/download") mirror_with_slash="${DEBIAN_MIRROR}" - [[ "${ARCH}" == riscv64 ]] && pool_name_extension="-riscv64" ;; *) @@ -37,10 +35,7 @@ function apt_find_upstream_package_version_and_download_url() { mirror_with_slash="${mirror_with_slash}/" fi - # riscv64 under Debian needs exception - - - declare base_down_url="http://${mirror_with_slash}pool${pool_name_extension}/main/${first_letter_of_sought_package_name}/${sought_package_name}" + declare base_down_url="http://${mirror_with_slash}pool/main/${first_letter_of_sought_package_name}/${sought_package_name}" declare index package_info_download_url # loop over the package_info_download_urls with index and value diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index ba8b046ff..215b6c89c 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -322,7 +322,7 @@ function adaptative_prepare_host_dependencies() { if [[ "${wanted_arch}" == "riscv64" || "${wanted_arch}" == "all" ]]; then host_dependencies+=("gcc-riscv64-linux-gnu") # crossbuild-essential-riscv64 is not even available "yet" - host_dependencies+=("debian-ports-archive-keyring") # Debian Ports keyring needed, as riscv64 is not released yet + host_dependencies+=("debian-archive-keyring") fi if [[ "${wanted_arch}" != "amd64" ]]; then diff --git a/lib/functions/rootfs/distro-specific.sh b/lib/functions/rootfs/distro-specific.sh index cf97038d7..d6d751e6f 100644 --- a/lib/functions/rootfs/distro-specific.sh +++ b/lib/functions/rootfs/distro-specific.sh @@ -159,6 +159,12 @@ function create_sources_list_and_deploy_repo_key() { deb http://${DEBIAN_MIRROR} unstable main contrib non-free non-free-firmware #deb-src http://${DEBIAN_MIRROR} unstable main contrib non-free non-free-firmware EOF + + # Exception: with riscv64 not everything was moved from ports + # https://lists.debian.org/debian-riscv/2023/07/msg00053.html + if [[ "${ARCH}" == riscv64 ]]; then + echo "deb http://deb.debian.org/debian-ports/ sid main " >> "${basedir}"/etc/apt/sources.list + fi ;; focal | jammy | kinetic | lunar) diff --git a/lib/functions/rootfs/rootfs-create.sh b/lib/functions/rootfs/rootfs-create.sh index 167d89b9f..97fa67b66 100644 --- a/lib/functions/rootfs/rootfs-create.sh +++ b/lib/functions/rootfs/rootfs-create.sh @@ -80,20 +80,6 @@ function create_new_rootfs_cache_via_debootstrap() { deboostrap_arguments+=("--foreign") # release name - # Debian does not carry riscv64 in their main repo, needs ports, which needs a specific keyring in the host. - # that's done in prepare-host.sh when by adding debian-ports-archive-keyring hostdep, but there's an if anyway. - # debian-ports-archive-keyring is also included in-image by: config/optional/architectures/riscv64/_config/cli/_all_distributions/main/packages - # Revise this after bookworm release. - # @TODO: rpardini: this clearly shows a need for hooks for debootstrap - if [[ "${ARCH}" == "riscv64" ]] && [[ $DISTRIBUTION == Debian ]]; then - if [[ -f /usr/share/keyrings/debian-ports-archive-keyring.gpg ]]; then - display_alert "Adding ports keyring for Debian debootstrap" "riscv64" "info" - deboostrap_arguments+=("--keyring" "/usr/share/keyrings/debian-ports-archive-keyring.gpg") - else - exit_with_error "Debian debootstrap for riscv64 needs debian-ports-archive-keyring hostdep" - fi - fi - deboostrap_arguments+=("${RELEASE}" "${SDCARD}/" "${debootstrap_apt_mirror}") # release, path and mirror; always last, positional arguments. run_host_command_logged debootstrap "${deboostrap_arguments[@]}" || {