diff options
Diffstat (limited to 'src/install.sh')
-rw-r--r-- | src/install.sh | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/install.sh b/src/install.sh index b2002cb..8b5291b 100644 --- a/src/install.sh +++ b/src/install.sh @@ -98,6 +98,9 @@ install_find_pkgs() local name= local base_url= local gzip= + local cert_url= + local cert_fd= + local dl_func= local pkgs= mkdir -p "${root}/etc/opkg" "${root}/var/lib/opkg/lists" @@ -116,6 +119,23 @@ install_find_pkgs() fi pkgs_fd=${FD} + if cert_url="$(profile_get_cert_url "${mirror}")"; then + mkdir -p "${root}/etc/opkg/keys/" + if ! fopen "${root}/etc/opkg/keys/temp.cert"; then + return 1 + fi + cert_fd=${FD} + printf '%s\n---' "${cert_url}" >&${cert_fd} + IFS="${LF}" + printf 'K: %s\n' $(profile_get_root_key) >&${cert_fd} + unset IFS + printf '---' >&${cert_fd} + fclose ${cert_fd} + dl_func=feed_download_cert + else + dl_func=feed_download + fi + while read -r type name base_url; do case "${type}" in 'src') gzip=false;; @@ -124,8 +144,11 @@ install_find_pkgs() esac printf '%s %s %s\n' "${type}" "${name}" \ "${base_url}" >&${opkg_conf_fd} - feed_download "${base_url}" \ - "${root}/var/lib/opkg/lists/${name}" ${gzip} + if ! ${dl_func} "${base_url}" \ + "${root}/var/lib/opkg/lists/${name}" \ + ${gzip}; then + return 1 + fi install_feed_url="${base_url}" feed_find_pkgs "${root}/var/lib/opkg/lists/${name}" \ "$(profile_dep_fields)" profile_include_pkg \ |