From 5196095c351e624fb82199b50ba75000693a9aa0 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 18 Aug 2014 17:54:15 -0400 Subject: install: Write opkg.conf --- (limited to 'lib') 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} } -- cgit v0.9.1