diff options
-rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 31 | ||||
-rw-r--r-- | meta/lib/oe/package_manager.py | 47 | ||||
-rw-r--r-- | meta/lib/oe/rootfs.py | 5 | ||||
-rw-r--r-- | meta/lib/oe/sdk.py | 4 |
4 files changed, 52 insertions, 35 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 9d63450dd1..6d4f9facc0 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
@@ -23,35 +23,6 @@ OPKGLIBDIR = "${localstatedir}/lib" | |||
23 | 23 | ||
24 | MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg" | 24 | MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg" |
25 | 25 | ||
26 | ipk_insert_feed_uris () { | ||
27 | |||
28 | echo "Building from feeds activated!" | ||
29 | |||
30 | for line in ${IPK_FEED_URIS} | ||
31 | do | ||
32 | # strip leading and trailing spaces/tabs, then split into name and uri | ||
33 | line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`" | ||
34 | feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`" | ||
35 | feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`" | ||
36 | |||
37 | echo "Added $feed_name feed with URL $feed_uri" | ||
38 | |||
39 | # insert new feed-sources | ||
40 | echo "src/gz $feed_name $feed_uri" >> ${IPKGCONF_TARGET} | ||
41 | done | ||
42 | |||
43 | # Allow to use package deploy directory contents as quick devel-testing | ||
44 | # feed. This creates individual feed configs for each arch subdir of those | ||
45 | # specified as compatible for the current machine. | ||
46 | # NOTE: Development-helper feature, NOT a full-fledged feed. | ||
47 | if [ -n "${FEED_DEPLOYDIR_BASE_URI}" ]; then | ||
48 | for arch in ${PACKAGE_ARCHS} | ||
49 | do | ||
50 | echo "src/gz local-$arch ${FEED_DEPLOYDIR_BASE_URI}/$arch" >> ${IMAGE_ROOTFS}/etc/opkg/local-$arch-feed.conf | ||
51 | done | ||
52 | fi | ||
53 | } | ||
54 | |||
55 | python () { | 26 | python () { |
56 | 27 | ||
57 | if d.getVar('BUILD_IMAGES_FROM_FEEDS', True): | 28 | if d.getVar('BUILD_IMAGES_FROM_FEEDS', True): |
@@ -60,7 +31,7 @@ python () { | |||
60 | flags = flags.replace("do_deploy", "") | 31 | flags = flags.replace("do_deploy", "") |
61 | flags = flags.replace("do_populate_sysroot", "") | 32 | flags = flags.replace("do_populate_sysroot", "") |
62 | d.setVarFlag('do_rootfs', 'recrdeptask', flags) | 33 | d.setVarFlag('do_rootfs', 'recrdeptask', flags) |
63 | d.setVar('OPKG_PREPROCESS_COMMANDS', "ipk_insert_feed_uris") | 34 | d.setVar('OPKG_PREPROCESS_COMMANDS', "") |
64 | d.setVar('OPKG_POSTPROCESS_COMMANDS', '') | 35 | d.setVar('OPKG_POSTPROCESS_COMMANDS', '') |
65 | } | 36 | } |
66 | 37 | ||
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 969292c093..d3e8a0885b 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -805,7 +805,10 @@ class OpkgPM(PackageManager): | |||
805 | 805 | ||
806 | bb.utils.mkdirhier(self.opkg_dir) | 806 | bb.utils.mkdirhier(self.opkg_dir) |
807 | 807 | ||
808 | self._create_config() | 808 | if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1": |
809 | self._create_config() | ||
810 | else: | ||
811 | self._create_custom_config() | ||
809 | 812 | ||
810 | """ | 813 | """ |
811 | This function will change a package's status in /var/lib/opkg/status file. | 814 | This function will change a package's status in /var/lib/opkg/status file. |
@@ -835,6 +838,45 @@ class OpkgPM(PackageManager): | |||
835 | 838 | ||
836 | os.rename(status_file + ".tmp", status_file) | 839 | os.rename(status_file + ".tmp", status_file) |
837 | 840 | ||
841 | def _create_custom_config(self): | ||
842 | bb.note("Building from feeds activated!") | ||
843 | |||
844 | with open(self.config_file, "w+") as config_file: | ||
845 | priority = 1 | ||
846 | for arch in self.pkg_archs.split(): | ||
847 | config_file.write("arch %s %d\n" % (arch, priority)) | ||
848 | priority += 5 | ||
849 | |||
850 | for line in (self.d.getVar('IPK_FEED_URIS', True) or "").split(): | ||
851 | feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line) | ||
852 | |||
853 | if feed_match is not None: | ||
854 | feed_name = feed_match.group(1) | ||
855 | feed_uri = feed_match.group(2) | ||
856 | |||
857 | bb.note("Add %s feed with URL %s" % (feed_name, feed_uri)) | ||
858 | |||
859 | config_file.write("src/gz %s %s\n" % (feed_name, feed_uri)) | ||
860 | |||
861 | """ | ||
862 | Allow to use package deploy directory contents as quick devel-testing | ||
863 | feed. This creates individual feed configs for each arch subdir of those | ||
864 | specified as compatible for the current machine. | ||
865 | NOTE: Development-helper feature, NOT a full-fledged feed. | ||
866 | """ | ||
867 | if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True) or "") != "": | ||
868 | for arch in self.pkg_archs.split(): | ||
869 | cfg_file_name = os.path.join(self.target_rootfs, | ||
870 | self.d.getVar("sysconfdir", True), | ||
871 | "opkg", | ||
872 | "local-%s-feed.conf" % arch) | ||
873 | |||
874 | with open(cfg_file_name, "w+") as cfg_file: | ||
875 | cfg_file.write("src/gz local-%s %s/%s" % | ||
876 | arch, | ||
877 | self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True), | ||
878 | arch) | ||
879 | |||
838 | def _create_config(self): | 880 | def _create_config(self): |
839 | with open(self.config_file, "w+") as config_file: | 881 | with open(self.config_file, "w+") as config_file: |
840 | priority = 1 | 882 | priority = 1 |
@@ -847,7 +889,8 @@ class OpkgPM(PackageManager): | |||
847 | for arch in self.pkg_archs.split(): | 889 | for arch in self.pkg_archs.split(): |
848 | pkgs_dir = os.path.join(self.deploy_dir, arch) | 890 | pkgs_dir = os.path.join(self.deploy_dir, arch) |
849 | if os.path.isdir(pkgs_dir): | 891 | if os.path.isdir(pkgs_dir): |
850 | config_file.write("src oe-%s file:%s\n" % (arch, pkgs_dir)) | 892 | config_file.write("src oe-%s file:%s\n" % |
893 | (arch, pkgs_dir)) | ||
851 | 894 | ||
852 | def update(self): | 895 | def update(self): |
853 | self.deploy_dir_lock() | 896 | self.deploy_dir_lock() |
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 95c275875f..7455a865a4 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py | |||
@@ -534,8 +534,9 @@ class OpkgRootfs(Rootfs): | |||
534 | opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS', True) | 534 | opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS', True) |
535 | rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND', True) | 535 | rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND', True) |
536 | 536 | ||
537 | # update PM index files | 537 | # update PM index files, unless users provide their own feeds |
538 | self.pm.write_index() | 538 | if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1": |
539 | self.pm.write_index() | ||
539 | 540 | ||
540 | execute_pre_post_process(self.d, opkg_pre_process_cmds) | 541 | execute_pre_post_process(self.d, opkg_pre_process_cmds) |
541 | 542 | ||
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py index b54e51697c..518076e75d 100644 --- a/meta/lib/oe/sdk.py +++ b/meta/lib/oe/sdk.py | |||
@@ -216,7 +216,9 @@ class OpkgSdk(Sdk): | |||
216 | def _populate_sysroot(self, pm, manifest): | 216 | def _populate_sysroot(self, pm, manifest): |
217 | pkgs_to_install = manifest.parse_initial_manifest() | 217 | pkgs_to_install = manifest.parse_initial_manifest() |
218 | 218 | ||
219 | pm.write_index() | 219 | if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1": |
220 | pm.write_index() | ||
221 | |||
220 | pm.update() | 222 | pm.update() |
221 | 223 | ||
222 | for pkg_type in self.install_order: | 224 | for pkg_type in self.install_order: |