summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/cpan-base.bbclass55
-rw-r--r--classes/cpan.bbclass51
-rw-r--r--classes/cpan_build.bbclass47
-rw-r--r--classes/image.bbclass2
-rw-r--r--classes/insane.bbclass2
-rw-r--r--classes/magicbox-image.bbclass37
6 files changed, 122 insertions, 72 deletions
diff --git a/classes/cpan-base.bbclass b/classes/cpan-base.bbclass
new file mode 100644
index 0000000000..a5fdb33895
--- /dev/null
+++ b/classes/cpan-base.bbclass
@@ -0,0 +1,55 @@
+#
+# cpan-base providers various perl related information needed for building
+# cpan modules
+#
+FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5"
+
+DEPENDS += "perl perl-native"
+RDEPENDS += "perl"
+
+# Determine the staged version of perl from the perl configuration file
+def get_perl_version(d):
+ import os, bb, re
+ cfg = bb.data.expand('${STAGING_DIR}/${HOST_SYS}/perl/config.sh', d)
+ try:
+ f = open(cfg, 'r')
+ except IOError:
+ return None
+ l = f.readlines();
+ f.close();
+ r = re.compile("version='(\d\.\d\.\d)'")
+ for s in l:
+ m = r.match(s)
+ if m:
+ return m.group(1)
+ return None
+
+# Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout
+def is_new_perl(d):
+ ver = get_perl_version(d)
+ if ver == "5.8.4" or ver == "5.8.7":
+ return "no"
+ return "yes"
+
+# Determine where the library directories are
+def perl_get_libdirs(d):
+ import bb
+ libdir = bb.data.getVar('libdir', d, 1)
+ if is_new_perl(d) == "yes":
+ libdirs = libdir + '/perl5'
+ else:
+ libdirs = libdir + '/*/*/perl5'
+ return libdirs
+
+def is_target(d):
+ import bb
+ if not bb.data.inherits_class('native', d):
+ return "yes"
+ return "no"
+
+IS_NEW_PERL = "${@is_new_perl(d)}"
+PERLLIBDIRS = "${@perl_get_libdirs(d)}"
+
+FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
+ ${PERLLIBDIRS}/auto/*/*/.debug \
+ ${PERLLIBDIRS}/auto/*/*/*/.debug"
diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass
index 687dbcd1cb..3b1a2b72ca 100644
--- a/classes/cpan.bbclass
+++ b/classes/cpan.bbclass
@@ -1,60 +1,15 @@
#
# This is for perl modules that use the old Makefile.PL build system
#
-FILES_${PN} += '${libdir}/perl5 ${datadir}/perl5'
-EXTRA_CPANFLAGS ?= ""
-
-DEPENDS += "perl-native"
-RDEPENDS += "perl"
-
-# Determine the staged version of perl from the perl configuration file
-def get_perl_version(d):
- import os, bb, re
- cfg = bb.data.expand('${STAGING_DIR}/${HOST_SYS}/perl/config.sh', d)
- try:
- f = open(cfg, 'r')
- except IOError:
- return None
- l = f.readlines();
- f.close();
- r = re.compile("version='(\d\.\d\.\d)'")
- for s in l:
- m = r.match(s)
- if m:
- return m.group(1)
- return None
-
-# Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout
-def is_new_perl(d):
- ver = get_perl_version(d)
- if ver == "5.8.4" or ver == "5.8.7":
- return "no"
- return "yes"
+inherit cpan-base
-# Determine where the library directories are
-def perl_get_libdirs(d):
- import bb
- libdir = bb.data.getVar('libdir', d, 1)
- if is_new_perl(d) == "yes":
- libdirs = libdir + '/perl5'
- else:
- libdirs = libdir + '/*/*/perl5'
- return libdirs
-
-def is_target(d):
- import bb
- if not bb.data.inherits_class('native', d):
- return "yes"
- return "no"
-
-IS_NEW_PERL = "${@is_new_perl(d)}"
-PERLLIBDIRS = "${@perl_get_libdirs(d)}"
+EXTRA_CPANFLAGS ?= ""
# Env var which tells perl if it should use host (no) or target (yes) settings
export PERLCONFIGTARGET = "${@is_target(d)}"
cpan_do_configure () {
- perl Makefile.PL ${EXTRA_CPANFLAGS}
+ yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
. ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
if [ "${IS_NEW_PERL}" = "yes" ]; then
diff --git a/classes/cpan_build.bbclass b/classes/cpan_build.bbclass
index 0660ef9b82..63e716c099 100644
--- a/classes/cpan_build.bbclass
+++ b/classes/cpan_build.bbclass
@@ -1,16 +1,14 @@
#
# This is for perl modules that use the new Build.PL build system
#
-INHIBIT_NATIVE_STAGE_INSTALL = "1"
-FILES_${PN} += '${libdir}/perl5'
+inherit cpan-base
-DEPENDS += "perl-native"
-RDEPENDS += "perl"
+INHIBIT_NATIVE_STAGE_INSTALL = "1"
#
# We also need to have built libmodule-build-perl-native for
# everything except libmodule-build-perl-native itself (which uses
-# this class, but uses itself as the probider of
+# this class, but uses itself as the provider of
# libmodule-build-perl)
#
def cpan_build_dep_prepend(d):
@@ -24,24 +22,29 @@ def cpan_build_dep_prepend(d):
DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}"
-def is_crosscompiling(d):
- import bb
- if not bb.data.inherits_class('native', d):
- return "yes"
- return "no"
-
cpan_build_do_configure () {
- if [ ${@is_crosscompiling(d)} == "yes" ]; then
+ if [ ${@is_target(d)} == "yes" ]; then
# build for target
. ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
- perl Build.PL --installdirs vendor \
- --destdir ${D} \
- --install_path lib="${libdir}/perl5/site_perl/${version}" \
- --install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
- --install_path script=${bindir} \
- --install_path bin=${bindir} \
- --install_path bindoc=${mandir}/man1 \
- --install_path libdoc=${mandir}/man3
+ if [ "${IS_NEW_PERL}" = "yes" ]; then
+ perl Build.PL --installdirs vendor \
+ --destdir ${D} \
+ --install_path lib="${datadir}/perl5" \
+ --install_path arch="${libdir}/perl5" \
+ --install_path script=${bindir} \
+ --install_path bin=${bindir} \
+ --install_path bindoc=${mandir}/man1 \
+ --install_path libdoc=${mandir}/man3
+ else
+ perl Build.PL --installdirs vendor \
+ --destdir ${D} \
+ --install_path lib="${libdir}/perl5/site_perl/${version}" \
+ --install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
+ --install_path script=${bindir} \
+ --install_path bin=${bindir} \
+ --install_path bindoc=${mandir}/man1 \
+ --install_path libdoc=${mandir}/man3
+ fi
else
# build for host
perl Build.PL --installdirs site
@@ -53,13 +56,13 @@ cpan_build_do_compile () {
}
cpan_build_do_install () {
- if [ ${@is_crosscompiling(d)} == "yes" ]; then
+ if [ ${@is_target(d)} == "yes" ]; then
perl Build install
fi
}
do_stage_append () {
- if [ ${@is_crosscompiling(d)} == "no" ]; then
+ if [ ${@is_target(d)} == "no" ]; then
perl Build install
fi
}
diff --git a/classes/image.bbclass b/classes/image.bbclass
index 2954dcdf39..5f1dfa2dce 100644
--- a/classes/image.bbclass
+++ b/classes/image.bbclass
@@ -80,7 +80,7 @@ fakeroot do_rootfs () {
insert_feed_uris
- rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/oe
+ rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/*
${IMAGE_PREPROCESS_COMMAND}
diff --git a/classes/insane.bbclass b/classes/insane.bbclass
index 30b164b734..c3a211eefd 100644
--- a/classes/insane.bbclass
+++ b/classes/insane.bbclass
@@ -219,7 +219,7 @@ def package_qa_check_rpath(file,name,d):
#bb.note("???%s???" % bad_dir_test)
for line in txt:
#bb.note("===%s===" % line)
- if bad_dir_test in line:
+ if bad_dir in line:
package_qa_write_error( 1, name, file, d)
bb.error("QA Issue package %s contains bad RPATH %s in file %s" % (name, line, file))
#bb.note("Fixing RPATH for you in %s" % file)
diff --git a/classes/magicbox-image.bbclass b/classes/magicbox-image.bbclass
new file mode 100644
index 0000000000..05de28b76b
--- /dev/null
+++ b/classes/magicbox-image.bbclass
@@ -0,0 +1,37 @@
+magicbox_gen_images() {
+ # find latest kernel
+ KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/uImage* | tail -1`
+ if [ -z "$KERNEL" ]; then
+ oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Exiting !"
+ exit 1
+ fi
+
+ #squashfs
+ #We need to prep the image so that u-boot recognizes it
+ mv ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs.bin
+ ${STAGING_BINDIR_NATIVE}/mkimage -A ppc -O linux -T ramdisk -C none -n "OPLinux-uclibc-squashfs" \
+ -d ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs
+ rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs.bin
+
+
+ #squashfs-lzma
+ #same as squashfs
+ mv ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzma ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs-lzma.bin
+ ${STAGING_BINDIR_NATIVE}/mkimage -A ppc -O linux -T ramdisk -C none -n "OPLinux-uclibc-squashfs-lzma" \
+ -d ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs-lzma.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzma
+ rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs-lzma.bin
+
+ #kernel+jffs2 in a single image
+ #Add jffs2 marker at the end of the rootfs file
+ echo -ne '\xde\xad\xc0\xde' >> ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2
+
+
+ ( dd if=$KERNEL bs=65536 conv=sync; \
+ dd if=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 bs=65536 conv=sync; \
+ ) > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.jffs2.flash.bin
+
+}
+
+
+
+IMAGE_POSTPROCESS_COMMAND += "magicbox_gen_images; "