summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-18 17:54:15 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-18 17:55:47 (EDT)
commit5196095c351e624fb82199b50ba75000693a9aa0 (patch)
treed95703d4761e41e66b5a2d169c760fd892a8dd20 /lib
parentaa385dd34aebe6bc41acb8b17778391aca4f1863 (diff)
install: Write opkg.conf
Diffstat (limited to 'lib')
-rw-r--r--lib/cmd/install.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index 3e8119a..efbd551 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -20,6 +20,7 @@
use getopt
use feed
use profile
+use fd
cmd_install_optstring='a:P:m:'
@@ -96,12 +97,16 @@ cmd_install_find_pkgs()
local arch="${3}"
local plat="${4}"
local chroot="${5}"
+ local opkg_conf_fd=
local feed_idx=
local feed=
- mkdir -p "${chroot}/var/lib/opkg/lists"
+ mkdir -p "${chroot}/etc/opkg" "${chroot}/var/lib/opkg/lists"
+ fopen "${chroot}/etc/opkg/opkg.conf" 'w'
+ opkg_conf_fd=${FD}
while read -r feed_idx feed; do
+ printf 'src %s %s\n' "${feed_idx}" "${feed}" >&${opkg_conf_fd}
feed_download "${feed}" \
>"${chroot}/var/lib/opkg/lists/${feed_idx}"
feed_find_pkgs "${chroot}/var/lib/opkg/lists/${feed_idx}" \
@@ -112,4 +117,8 @@ cmd_install_find_pkgs()
done <<-EOF
$(profile_feeds "${mirror}" "${arch}" "${plat}" "${suite}")
EOF
+
+ printf '\ndest root /\n' >&${opkg_conf_fd}
+ printf 'arch %s 1\n' 'all' "${arch}" 'src' >&${opkg_conf_fd}
+ fclose ${opkg_conf_fd}
}