diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/meta.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/package_ipk.bbclass | 44 | ||||
-rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 35 | ||||
-rw-r--r-- | meta/classes/task.bbclass | 27 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 1 | ||||
-rw-r--r-- | meta/packages/meta/meta-toolchain.bb | 29 |
6 files changed, 88 insertions, 52 deletions
diff --git a/meta/classes/meta.bbclass b/meta/classes/meta.bbclass new file mode 100644 index 0000000000..d35c40bccd --- /dev/null +++ b/meta/classes/meta.bbclass | |||
@@ -0,0 +1,4 @@ | |||
1 | |||
2 | PACKAGES = "" | ||
3 | |||
4 | do_build[recrdeptask] = "do_build" \ No newline at end of file | ||
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index d88d11b994..1175d1e751 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass | |||
@@ -4,6 +4,9 @@ BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" | |||
4 | DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" | 4 | DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" |
5 | IMAGE_PKGTYPE ?= "ipk" | 5 | IMAGE_PKGTYPE ?= "ipk" |
6 | 6 | ||
7 | IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/ipkg.conf" | ||
8 | IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/ipkg-sdk.conf" | ||
9 | |||
7 | python package_ipk_fn () { | 10 | python package_ipk_fn () { |
8 | from bb import data | 11 | from bb import data |
9 | bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) | 12 | bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) |
@@ -60,6 +63,47 @@ python package_ipk_install () { | |||
60 | raise bb.build.FuncFailed | 63 | raise bb.build.FuncFailed |
61 | } | 64 | } |
62 | 65 | ||
66 | # | ||
67 | # Update the Packages index files in ${DEPLOY_DIR_IPK} | ||
68 | # | ||
69 | package_update_index_ipk () { | ||
70 | set -x | ||
71 | |||
72 | ipkgarchs="${PACKAGE_ARCHS}" | ||
73 | |||
74 | if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then | ||
75 | return | ||
76 | fi | ||
77 | |||
78 | touch ${DEPLOY_DIR_IPK}/Packages | ||
79 | ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK} | ||
80 | |||
81 | for arch in $ipkgarchs; do | ||
82 | if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then | ||
83 | touch ${DEPLOY_DIR_IPK}/$arch/Packages | ||
84 | ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/ | ||
85 | fi | ||
86 | done | ||
87 | } | ||
88 | |||
89 | # | ||
90 | # Generate an ipkg conf file ${IPKGCONF_TARGET} suitable for use against | ||
91 | # the target system and an ipkg conf file ${IPKGCONF_SDK} suitable for | ||
92 | # use against the host system in sdk builds | ||
93 | # | ||
94 | package_generate_ipkg_conf () { | ||
95 | mkdir -p ${STAGING_ETCDIR_NATIVE}/ | ||
96 | echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_TARGET} | ||
97 | echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_SDK} | ||
98 | ipkgarchs="${PACKAGE_ARCHS}" | ||
99 | priority=1 | ||
100 | for arch in $ipkgarchs; do | ||
101 | echo "arch $arch $priority" >> ${IPKGCONF_TARGET} | ||
102 | echo "arch ${BUILD_ARCH}-$arch-sdk $priority" >> ${IPKGCONF_SDK} | ||
103 | priority=$(expr $priority + 5) | ||
104 | done | ||
105 | } | ||
106 | |||
63 | python do_package_ipk () { | 107 | python do_package_ipk () { |
64 | import sys, re, fcntl, copy | 108 | import sys, re, fcntl, copy |
65 | 109 | ||
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 3709f89743..3c9d03f9dd 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
@@ -8,41 +8,16 @@ | |||
8 | do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" | 8 | do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" |
9 | do_rootfs[recrdeptask] += "do_package_write_ipk" | 9 | do_rootfs[recrdeptask] += "do_package_write_ipk" |
10 | 10 | ||
11 | IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" | 11 | IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS}" |
12 | |||
13 | rootfs_ipk_do_indexes () { | ||
14 | set -x | ||
15 | |||
16 | ipkgarchs="${PACKAGE_ARCHS}" | ||
17 | |||
18 | if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then | ||
19 | touch ${DEPLOY_DIR_IPK}/Packages | ||
20 | ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK} | ||
21 | fi | ||
22 | |||
23 | for arch in $ipkgarchs; do | ||
24 | if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then | ||
25 | if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then | ||
26 | touch ${DEPLOY_DIR_IPK}/$arch/Packages | ||
27 | ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/ | ||
28 | fi | ||
29 | fi | ||
30 | done | ||
31 | } | ||
32 | 12 | ||
33 | fakeroot rootfs_ipk_do_rootfs () { | 13 | fakeroot rootfs_ipk_do_rootfs () { |
34 | set -x | 14 | set -x |
35 | 15 | ||
36 | rootfs_ipk_do_indexes | 16 | package_update_index_ipk |
17 | package_generate_ipkg_conf | ||
37 | 18 | ||
38 | mkdir -p ${T} | 19 | mkdir -p ${T} |
39 | echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf | 20 | |
40 | ipkgarchs="${PACKAGE_ARCHS}" | ||
41 | priority=1 | ||
42 | for arch in $ipkgarchs; do | ||
43 | echo "arch $arch $priority" >> ${T}/ipkg.conf | ||
44 | priority=$(expr $priority + 5) | ||
45 | done | ||
46 | ipkg-cl ${IPKG_ARGS} update | 21 | ipkg-cl ${IPKG_ARGS} update |
47 | if [ ! -z "${LINGUAS_INSTALL}" ]; then | 22 | if [ ! -z "${LINGUAS_INSTALL}" ]; then |
48 | ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n | 23 | ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n |
@@ -58,7 +33,7 @@ fakeroot rootfs_ipk_do_rootfs () { | |||
58 | export OFFLINE_ROOT=${IMAGE_ROOTFS} | 33 | export OFFLINE_ROOT=${IMAGE_ROOTFS} |
59 | export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} | 34 | export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} |
60 | mkdir -p ${IMAGE_ROOTFS}/etc/ipkg/ | 35 | mkdir -p ${IMAGE_ROOTFS}/etc/ipkg/ |
61 | grep "^arch" ${T}/ipkg.conf >${IMAGE_ROOTFS}/etc/ipkg/arch.conf | 36 | grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/ipkg/arch.conf |
62 | 37 | ||
63 | for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do | 38 | for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do |
64 | if [ -f $i ] && ! sh $i; then | 39 | if [ -f $i ] && ! sh $i; then |
diff --git a/meta/classes/task.bbclass b/meta/classes/task.bbclass new file mode 100644 index 0000000000..4edd704829 --- /dev/null +++ b/meta/classes/task.bbclass | |||
@@ -0,0 +1,27 @@ | |||
1 | # Task packages are only used to pull in other packages | ||
2 | # via their dependencies. They are empty. | ||
3 | ALLOW_EMPTY = "1" | ||
4 | |||
5 | # By default, only the task package itself is in PACKAGES. | ||
6 | # -dbg and -dev flavours are handled by the anonfunc below. | ||
7 | # This means that task recipes used to build multiple task | ||
8 | # packages have to modify PACKAGES after inheriting task.bbclass. | ||
9 | PACKAGES = "${PN}" | ||
10 | |||
11 | # By default, task packages do not depend on a certain architecture. | ||
12 | # Only if dependencies are modified by MACHINE_FEATURES, packages | ||
13 | # need to be set to MACHINE_ARCH after inheriting task.bbclass | ||
14 | PACKAGE_ARCH = "all" | ||
15 | |||
16 | # This automatically adds -dbg and -dev flavours of all PACKAGES | ||
17 | # to the list. Their dependencies (RRECOMMENDS) are handled as usual | ||
18 | # by package_depchains in a following step. | ||
19 | python () { | ||
20 | packages = bb.data.getVar('PACKAGES', d, 1).split() | ||
21 | genpackages = [] | ||
22 | for pkg in packages: | ||
23 | for postfix in ['-dbg', '-dev']: | ||
24 | genpackages.append(pkg+postfix) | ||
25 | bb.data.setVar('PACKAGES', ' '.join(packages+genpackages), d) | ||
26 | } | ||
27 | |||
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 7adc8ee9dc..24c3aa1c72 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -171,6 +171,7 @@ STAGING_BINDIR_CROSS = "${STAGING_DIR}/${BUILD_SYS}/bin/${HOST_SYS}" | |||
171 | STAGING_BINDIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}/bin" | 171 | STAGING_BINDIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}/bin" |
172 | STAGING_LIBDIR = "${STAGING_DIR}/${HOST_SYS}/lib" | 172 | STAGING_LIBDIR = "${STAGING_DIR}/${HOST_SYS}/lib" |
173 | STAGING_LIBDIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}/lib" | 173 | STAGING_LIBDIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}/lib" |
174 | STAGING_ETCDIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}/etc" | ||
174 | STAGING_INCDIR = "${STAGING_DIR}/${HOST_SYS}/include" | 175 | STAGING_INCDIR = "${STAGING_DIR}/${HOST_SYS}/include" |
175 | STAGING_DATADIR = "${STAGING_DIR}/${HOST_SYS}/share" | 176 | STAGING_DATADIR = "${STAGING_DIR}/${HOST_SYS}/share" |
176 | STAGING_LOADER_DIR = "${STAGING_DIR}/${HOST_SYS}/loader" | 177 | STAGING_LOADER_DIR = "${STAGING_DIR}/${HOST_SYS}/loader" |
diff --git a/meta/packages/meta/meta-toolchain.bb b/meta/packages/meta/meta-toolchain.bb index 1a1bde46c0..a0f38404b0 100644 --- a/meta/packages/meta/meta-toolchain.bb +++ b/meta/packages/meta/meta-toolchain.bb | |||
@@ -1,21 +1,15 @@ | |||
1 | DESCRIPTION = "Meta package for building a installable toolchain" | 1 | DESCRIPTION = "Meta package for building a installable toolchain" |
2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
3 | DEPENDS = "ipkg-native ipkg-utils-native fakeroot-native sed-native" | 3 | DEPENDS = "ipkg-native ipkg-utils-native fakeroot-native sed-native" |
4 | PR = "r3" | ||
5 | 4 | ||
6 | inherit sdk | 5 | inherit sdk meta |
7 | |||
8 | PACKAGES = "" | ||
9 | |||
10 | BUILD_ALL_DEPS = "1" | ||
11 | do_build[recrdeptask] = "do_build" | ||
12 | 6 | ||
13 | SDK_DIR = "${WORKDIR}/sdk" | 7 | SDK_DIR = "${WORKDIR}/sdk" |
14 | SDK_OUTPUT = "${SDK_DIR}/image" | 8 | SDK_OUTPUT = "${SDK_DIR}/image" |
15 | SDK_DEPLOY = "${TMPDIR}/deploy/sdk" | 9 | SDK_DEPLOY = "${TMPDIR}/deploy/sdk" |
16 | 10 | ||
17 | IPKG_HOST = "ipkg-cl -f ${SDK_DIR}/ipkg-host.conf -o ${SDK_OUTPUT}" | 11 | IPKG_HOST = "ipkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}" |
18 | IPKG_TARGET = "ipkg-cl -f ${SDK_DIR}/ipkg-target.conf -o ${SDK_OUTPUT}/${prefix}" | 12 | IPKG_TARGET = "ipkg-cl -f ${IPKGCONF_TARGET} -o ${SDK_OUTPUT}/${prefix}" |
19 | 13 | ||
20 | HOST_INSTALL = "task-poky-standalone-sdk-host" | 14 | HOST_INSTALL = "task-poky-standalone-sdk-host" |
21 | 15 | ||
@@ -30,20 +24,11 @@ do_populate_sdk() { | |||
30 | rm -rf ${SDK_OUTPUT} | 24 | rm -rf ${SDK_OUTPUT} |
31 | mkdir -p ${SDK_OUTPUT} | 25 | mkdir -p ${SDK_OUTPUT} |
32 | 26 | ||
33 | cat <<EOF >${SDK_DIR}/ipkg-host.conf | 27 | package_generate_ipkg_conf |
34 | src oe file:${DEPLOY_DIR_IPK} | 28 | |
35 | EOF | 29 | for arch in ${PACKAGE_ARCHS}; do |
36 | cat <<EOF >${SDK_DIR}/ipkg-target.conf | ||
37 | src oe file:${DEPLOY_DIR_IPK} | ||
38 | EOF | ||
39 | ipkgarchs="${PACKAGE_ARCHS}" | ||
40 | priority=1 | ||
41 | for arch in $ipkgarchs; do | ||
42 | echo "arch $arch $priority" >> ${SDK_DIR}/ipkg-target.conf | ||
43 | echo "arch ${BUILD_ARCH}-$arch-sdk $priority" >> ${SDK_DIR}/ipkg-host.conf | ||
44 | priority=$(expr $priority + 5) | ||
45 | revipkgarchs="$arch $revipkgarchs" | 30 | revipkgarchs="$arch $revipkgarchs" |
46 | done | 31 | done |
47 | 32 | ||
48 | rm -r ${SDK_OUTPUT} | 33 | rm -r ${SDK_OUTPUT} |
49 | mkdir -p ${SDK_OUTPUT} | 34 | mkdir -p ${SDK_OUTPUT} |