summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/sdk.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/sdk.py')
-rw-r--r--meta/lib/oe/sdk.py87
1 files changed, 1 insertions, 86 deletions
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index b675b6549c..8b97f05a29 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -110,92 +110,6 @@ class Sdk(object, metaclass=ABCMeta):
110 pass 110 pass
111 111
112 112
113class OpkgSdk(Sdk):
114 def __init__(self, d, manifest_dir=None):
115 super(OpkgSdk, self).__init__(d, manifest_dir)
116
117 self.target_conf = self.d.getVar("IPKGCONF_TARGET")
118 self.host_conf = self.d.getVar("IPKGCONF_SDK")
119
120 self.target_manifest = OpkgManifest(d, self.manifest_dir,
121 Manifest.MANIFEST_TYPE_SDK_TARGET)
122 self.host_manifest = OpkgManifest(d, self.manifest_dir,
123 Manifest.MANIFEST_TYPE_SDK_HOST)
124
125 ipk_repo_workdir = "oe-sdk-repo"
126 if "sdk_ext" in d.getVar("BB_RUNTASK"):
127 ipk_repo_workdir = "oe-sdk-ext-repo"
128
129 self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
130 self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"),
131 ipk_repo_workdir=ipk_repo_workdir)
132
133 self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
134 self.d.getVar("SDK_PACKAGE_ARCHS"),
135 ipk_repo_workdir=ipk_repo_workdir)
136
137 def _populate_sysroot(self, pm, manifest):
138 pkgs_to_install = manifest.parse_initial_manifest()
139
140 if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
141 pm.write_index()
142
143 pm.update()
144
145 for pkg_type in self.install_order:
146 if pkg_type in pkgs_to_install:
147 pm.install(pkgs_to_install[pkg_type],
148 [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
149
150 def _populate(self):
151 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
152
153 bb.note("Installing TARGET packages")
154 self._populate_sysroot(self.target_pm, self.target_manifest)
155
156 self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
157
158 self.target_pm.run_intercepts(populate_sdk='target')
159
160 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
161
162 if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
163 self.target_pm.remove_packaging_data()
164
165 bb.note("Installing NATIVESDK packages")
166 self._populate_sysroot(self.host_pm, self.host_manifest)
167 self.install_locales(self.host_pm)
168
169 self.host_pm.run_intercepts(populate_sdk='host')
170
171 execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
172
173 if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
174 self.host_pm.remove_packaging_data()
175
176 target_sysconfdir = os.path.join(self.sdk_target_sysroot, self.sysconfdir)
177 host_sysconfdir = os.path.join(self.sdk_host_sysroot, self.sysconfdir)
178
179 self.mkdirhier(target_sysconfdir)
180 shutil.copy(self.target_conf, target_sysconfdir)
181 os.chmod(os.path.join(target_sysconfdir,
182 os.path.basename(self.target_conf)), 0o644)
183
184 self.mkdirhier(host_sysconfdir)
185 shutil.copy(self.host_conf, host_sysconfdir)
186 os.chmod(os.path.join(host_sysconfdir,
187 os.path.basename(self.host_conf)), 0o644)
188
189 native_opkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
190 self.d.getVar('localstatedir_nativesdk').strip('/'),
191 "lib", "opkg")
192 self.mkdirhier(native_opkg_state_dir)
193 for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "opkg", "*")):
194 self.movefile(f, native_opkg_state_dir)
195
196 self.remove(os.path.join(self.sdk_output, "var"), True)
197
198
199class DpkgSdk(Sdk): 113class DpkgSdk(Sdk):
200 def __init__(self, d, manifest_dir=None): 114 def __init__(self, d, manifest_dir=None):
201 super(DpkgSdk, self).__init__(d, manifest_dir) 115 super(DpkgSdk, self).__init__(d, manifest_dir)
@@ -305,6 +219,7 @@ def populate_sdk(d, manifest_dir=None):
305 219
306 img_type = d.getVar('IMAGE_PKGTYPE') 220 img_type = d.getVar('IMAGE_PKGTYPE')
307 from oe.package_manager.rpm.sdk import RpmSdk 221 from oe.package_manager.rpm.sdk import RpmSdk
222 from oe.package_manager.ipk.sdk import OpkgSdk
308 if img_type == "rpm": 223 if img_type == "rpm":
309 RpmSdk(d, manifest_dir).populate() 224 RpmSdk(d, manifest_dir).populate()
310 elif img_type == "ipk": 225 elif img_type == "ipk":