summaryrefslogtreecommitdiffstats
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
parentaa385dd34aebe6bc41acb8b17778391aca4f1863 (diff)
install: Write opkg.conf
-rw-r--r--lib/cmd/install.sh11
-rw-r--r--locale/en_US.sh3
2 files changed, 12 insertions, 2 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}
}
diff --git a/locale/en_US.sh b/locale/en_US.sh
index b0362c3..3d2946f 100644
--- a/locale/en_US.sh
+++ b/locale/en_US.sh
@@ -66,7 +66,8 @@ msg_prokit_cmd_install_selected_mirror='Using mirror %s'
msg_prokit_cmd_install_setting_up_chroot='Setting up root...'
msg_prokit_cmd_install_chroot_dir_exists='Directory "%s" exists"'
msg_prokit_cmd_install_mkdir_chroot_fail='Failed to create directory "%s"'
-msg_prokit_cmd_install_find_pkgs='Retrieving Packages files...'
+msg_prokit_cmd_install_find_pkgs='Configuring opkg and retrieving Packages '\
+'files...'
# lib/profile.sh
msg_prokit_profile_not_found='Profile "%s" not found'