diff options
author | Richard Purdie <richard@openedhand.com> | 2007-08-29 19:29:56 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-08-29 19:29:56 +0000 |
commit | 226a5dd8a2dd9d45721ffd575fcfb5cd2eba00a0 (patch) | |
tree | 42fe3626f3a738b1cf2a71e10ebc4c78c99be521 /meta/classes/kernel.bbclass | |
parent | 4a319e98fd0011cd83bd0389c5d006f948ef69f1 (diff) | |
download | poky-226a5dd8a2dd9d45721ffd575fcfb5cd2eba00a0.tar.gz |
kernel.bbclass: Sync with OE for packaging changes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2597 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 2eea6ed1df..b25275e702 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -143,7 +143,10 @@ kernel_do_install() { | |||
143 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} | 143 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} |
144 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} | 144 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} |
145 | install -d ${D}/etc/modutils | 145 | install -d ${D}/etc/modutils |
146 | 146 | if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then | |
147 | install -d ${D}/etc/modprobe.d | ||
148 | fi | ||
149 | |||
147 | # Check if scripts/genksyms exists and if so, build it | 150 | # Check if scripts/genksyms exists and if so, build it |
148 | if [ -e scripts/genksyms/ ]; then | 151 | if [ -e scripts/genksyms/ ]; then |
149 | oe_runmake SUBDIRS="scripts/genksyms" | 152 | oe_runmake SUBDIRS="scripts/genksyms" |
@@ -158,26 +161,38 @@ kernel_do_configure() { | |||
158 | } | 161 | } |
159 | 162 | ||
160 | pkg_postinst_kernel () { | 163 | pkg_postinst_kernel () { |
161 | update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true | 164 | cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true |
162 | } | 165 | } |
163 | 166 | ||
164 | pkg_postrm_kernel () { | 167 | pkg_postrm_kernel () { |
165 | update-alternatives --remove ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true | 168 | cd /${KERNEL_IMAGEDEST}; update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true |
166 | } | 169 | } |
167 | 170 | ||
168 | inherit cml1 | 171 | inherit cml1 |
169 | 172 | ||
170 | EXPORT_FUNCTIONS do_compile do_install do_stage do_configure | 173 | EXPORT_FUNCTIONS do_compile do_install do_stage do_configure |
171 | 174 | ||
172 | PACKAGES = "kernel kernel-image kernel-dev" | 175 | # kernel-base becomes kernel-${KERNEL_VERSION} |
176 | # kernel-image becomes kernel-image-${KERNEL_VERISON} | ||
177 | PACKAGES = "kernel kernel-base kernel-image kernel-dev" | ||
173 | FILES = "" | 178 | FILES = "" |
174 | FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" | 179 | FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" |
175 | FILES_kernel-dev = "/boot/System.map* /boot/config*" | 180 | FILES_kernel-dev = "/boot/System.map* /boot/config*" |
176 | RDEPENDS_kernel = "kernel-image-${KERNEL_VERSION}" | 181 | RDEPENDS_kernel = "kernel-base" |
182 | # Allow machines to override this dependency if kernel image files are | ||
183 | # not wanted in images as standard | ||
184 | RDEPENDS_kernel-base ?= "kernel-image" | ||
177 | PKG_kernel-image = "kernel-image-${KERNEL_VERSION}" | 185 | PKG_kernel-image = "kernel-image-${KERNEL_VERSION}" |
186 | PKG_kernel-base = "kernel-${KERNEL_VERSION}" | ||
178 | ALLOW_EMPTY_kernel = "1" | 187 | ALLOW_EMPTY_kernel = "1" |
188 | ALLOW_EMPTY_kernel-base = "1" | ||
179 | ALLOW_EMPTY_kernel-image = "1" | 189 | ALLOW_EMPTY_kernel-image = "1" |
180 | 190 | ||
191 | # Userspace workarounds for kernel modules issues | ||
192 | # This is shame, fix the kernel instead! | ||
193 | DEPENDS_kernel-module-dtl1-cs = "bluez-dtl1-workaround" | ||
194 | RDEPENDS_kernel-module-dtl1-cs = "bluez-dtl1-workaround" | ||
195 | |||
181 | pkg_postinst_kernel-image () { | 196 | pkg_postinst_kernel-image () { |
182 | if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then | 197 | if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then |
183 | mkdir -p $D/lib/modules/${KERNEL_VERSION} | 198 | mkdir -p $D/lib/modules/${KERNEL_VERSION} |
@@ -335,13 +350,16 @@ python populate_packages_prepend () { | |||
335 | # Write out any modconf fragment | 350 | # Write out any modconf fragment |
336 | modconf = bb.data.getVar('module_conf_%s' % basename, d, 1) | 351 | modconf = bb.data.getVar('module_conf_%s' % basename, d, 1) |
337 | if modconf: | 352 | if modconf: |
338 | name = '%s/etc/modutils/%s.conf' % (dvar, basename) | 353 | if bb.data.getVar("KERNEL_MAJOR_VERSION", d, 1) == "2.6": |
354 | name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) | ||
355 | else: | ||
356 | name = '%s/etc/modutils/%s.conf' % (dvar, basename) | ||
339 | f = open(name, 'w') | 357 | f = open(name, 'w') |
340 | f.write("%s\n" % modconf) | 358 | f.write("%s\n" % modconf) |
341 | f.close() | 359 | f.close() |
342 | 360 | ||
343 | files = bb.data.getVar('FILES_%s' % pkg, d, 1) | 361 | files = bb.data.getVar('FILES_%s' % pkg, d, 1) |
344 | files = "%s /etc/modutils/%s /etc/modutils/%s.conf" % (files, basename, basename) | 362 | files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) |
345 | bb.data.setVar('FILES_%s' % pkg, files, d) | 363 | bb.data.setVar('FILES_%s' % pkg, files, d) |
346 | 364 | ||
347 | if vals.has_key("description"): | 365 | if vals.has_key("description"): |
@@ -362,13 +380,13 @@ python populate_packages_prepend () { | |||
362 | 380 | ||
363 | postinst = bb.data.getVar('pkg_postinst_modules', d, 1) | 381 | postinst = bb.data.getVar('pkg_postinst_modules', d, 1) |
364 | postrm = bb.data.getVar('pkg_postrm_modules', d, 1) | 382 | postrm = bb.data.getVar('pkg_postrm_modules', d, 1) |
365 | do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='update-modules kernel-image-%s' % bb.data.getVar("KERNEL_VERSION", d, 1)) | 383 | do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='update-modules kernel-%s' % bb.data.getVar("KERNEL_VERSION", d, 1)) |
366 | 384 | ||
367 | import re, os | 385 | import re, os |
368 | metapkg = "kernel-modules" | 386 | metapkg = "kernel-modules" |
369 | bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d) | 387 | bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d) |
370 | bb.data.setVar('FILES_' + metapkg, "", d) | 388 | bb.data.setVar('FILES_' + metapkg, "", d) |
371 | blacklist = [ 'kernel-dev', 'kernel-image' ] | 389 | blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base' ] |
372 | for l in module_deps.values(): | 390 | for l in module_deps.values(): |
373 | for i in l: | 391 | for i in l: |
374 | pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) | 392 | pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) |
@@ -382,5 +400,4 @@ python populate_packages_prepend () { | |||
382 | bb.data.setVar('DESCRIPTION_' + metapkg, 'Kernel modules meta package', d) | 400 | bb.data.setVar('DESCRIPTION_' + metapkg, 'Kernel modules meta package', d) |
383 | packages.append(metapkg) | 401 | packages.append(metapkg) |
384 | bb.data.setVar('PACKAGES', ' '.join(packages), d) | 402 | bb.data.setVar('PACKAGES', ' '.join(packages), d) |
385 | |||
386 | } | 403 | } |