summaryrefslogtreecommitdiffstats
path: root/lib/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmd')
-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}
}