summaryrefslogtreecommitdiffstats
path: root/src/install.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-16 22:14:39 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-16 22:14:39 (EDT)
commit6fd5dc1719c320722e55b147e7eb4d97cbe5c475 (patch)
treef6bcd1433741c55f0700f68bf9cd6748bbda2993 /src/install.sh
parent05ed65eed03a70b318effe0915508ea27ba64b71 (diff)
install_find_pkgs(): Initialize cert and check sig
Diffstat (limited to 'src/install.sh')
-rw-r--r--src/install.sh27
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 \