diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-01-13 10:16:43 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:53:39 +0000 |
commit | f52391a919ec4969d3a0254513d4e0c971dd611f (patch) | |
tree | d6ab2af1f45a39cd5056934a15f86feed612df2d /meta/classes/rootfs_ipk.bbclass | |
parent | 31906d8e916f72da8493655672bd6731e46b20f5 (diff) | |
download | poky-f52391a919ec4969d3a0254513d4e0c971dd611f.tar.gz |
Cleanup image,rootfs_ipk,package_ipk bbclass files
This commit cleans up the functions that were ported to python.
(From OE-Core rev: d950ef40a3eae4b54cc62828e66d84a62d78c447)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs_ipk.bbclass')
-rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 109 |
1 files changed, 3 insertions, 106 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index f97f027804..9d63450dd1 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
@@ -15,117 +15,14 @@ rootfs_ipk_do_rootfs[vardepsexclude] += "BUILDNAME" | |||
15 | 15 | ||
16 | do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock" | 16 | do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock" |
17 | 17 | ||
18 | OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf" | 18 | OPKG_PREPROCESS_COMMANDS = "" |
19 | 19 | ||
20 | OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; " | 20 | OPKG_POSTPROCESS_COMMANDS = "" |
21 | 21 | ||
22 | OPKGLIBDIR = "${localstatedir}/lib" | 22 | OPKGLIBDIR = "${localstatedir}/lib" |
23 | 23 | ||
24 | MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg" | 24 | MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg" |
25 | 25 | ||
26 | fakeroot rootfs_ipk_do_rootfs () { | ||
27 | #set -x | ||
28 | |||
29 | rm -f ${IPKGCONF_TARGET} | ||
30 | touch ${IPKGCONF_TARGET} | ||
31 | |||
32 | ${OPKG_PREPROCESS_COMMANDS} | ||
33 | |||
34 | mkdir -p ${T}/ | ||
35 | |||
36 | export INSTALL_CONF_IPK="${IPKGCONF_TARGET}" | ||
37 | export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}" | ||
38 | STATUS=${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status | ||
39 | mkdir -p ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg | ||
40 | |||
41 | opkg-cl ${OPKG_ARGS} update | ||
42 | |||
43 | # prime the status file with bits that we don't want | ||
44 | for i in ${BAD_RECOMMENDATIONS}; do | ||
45 | pkginfo="`opkg-cl ${OPKG_ARGS} info $i`" | ||
46 | if [ ! -z "$pkginfo" ]; then | ||
47 | echo "$pkginfo" | awk "/^Status:/ { print \"Status: deinstall hold not-installed\n\" }" - >> $STATUS | ||
48 | else | ||
49 | echo "Requested ignored recommendation $i is not a package" | ||
50 | fi | ||
51 | done | ||
52 | |||
53 | #install | ||
54 | export INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}" | ||
55 | export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}" | ||
56 | export INSTALL_TASK_IPK="rootfs" | ||
57 | |||
58 | |||
59 | export INSTALL_PACKAGES_IPK="${PACKAGE_INSTALL}" | ||
60 | |||
61 | #post install | ||
62 | export D=${IMAGE_ROOTFS} | ||
63 | export OFFLINE_ROOT=${IMAGE_ROOTFS} | ||
64 | export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} | ||
65 | export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT} | ||
66 | export INTERCEPT_DIR=${WORKDIR}/intercept_scripts | ||
67 | export NATIVE_ROOT=${STAGING_DIR_NATIVE} | ||
68 | |||
69 | package_install_internal_ipk | ||
70 | |||
71 | # Distro specific packages should create this | ||
72 | #mkdir -p ${IMAGE_ROOTFS}/etc/opkg/ | ||
73 | #grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf | ||
74 | |||
75 | rootfs_install_complementary | ||
76 | |||
77 | ${OPKG_POSTPROCESS_COMMANDS} | ||
78 | ${ROOTFS_POSTINSTALL_COMMAND} | ||
79 | |||
80 | install -d ${IMAGE_ROOTFS}/${sysconfdir} | ||
81 | echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version | ||
82 | |||
83 | ${ROOTFS_POSTPROCESS_COMMAND} | ||
84 | |||
85 | if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then | ||
86 | delayed_postinsts="$(delayed_postinsts)" | ||
87 | if [ -n "$delayed_postinsts" ]; then | ||
88 | bberror "The following packages could not be configured offline and rootfs is read-only: $delayed_postinsts" | ||
89 | exit 1 | ||
90 | fi | ||
91 | fi | ||
92 | |||
93 | rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/* | ||
94 | log_check rootfs | ||
95 | } | ||
96 | |||
97 | rootfs_ipk_do_rootfs[vardeps] += "delayed_postinsts" | ||
98 | |||
99 | delayed_postinsts () { | ||
100 | cat ${STATUS}|grep -e "^Package:" -e "^Status:"|sed -ne 'N;s/Package: \(.*\)\nStatus:.*unpacked/\1/p' | ||
101 | } | ||
102 | |||
103 | save_postinsts () { | ||
104 | # Scripts need to be ordered when executed, this ensures numeric order | ||
105 | # If we ever run into needing more the 899 scripts, we'll have to | ||
106 | # change num to start with 1000. | ||
107 | num=100 | ||
108 | for p in $(delayed_postinsts); do | ||
109 | install -d ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts | ||
110 | cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/info/$p.postinst ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts/$num-$p | ||
111 | num=`echo \$((num+1))` | ||
112 | done | ||
113 | } | ||
114 | |||
115 | remove_packaging_data_files() { | ||
116 | rm -rf ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg | ||
117 | # We need the directory for the package manager lock | ||
118 | mkdir ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg | ||
119 | } | ||
120 | |||
121 | rootfs_install_packages() { | ||
122 | opkg-cl ${OPKG_ARGS} install `cat $1` | ||
123 | } | ||
124 | |||
125 | rootfs_uninstall_packages() { | ||
126 | opkg-cl ${OPKG_ARGS} --force-depends remove $@ | ||
127 | } | ||
128 | |||
129 | ipk_insert_feed_uris () { | 26 | ipk_insert_feed_uris () { |
130 | 27 | ||
131 | echo "Building from feeds activated!" | 28 | echo "Building from feeds activated!" |
@@ -163,7 +60,7 @@ python () { | |||
163 | flags = flags.replace("do_deploy", "") | 60 | flags = flags.replace("do_deploy", "") |
164 | flags = flags.replace("do_populate_sysroot", "") | 61 | flags = flags.replace("do_populate_sysroot", "") |
165 | d.setVarFlag('do_rootfs', 'recrdeptask', flags) | 62 | d.setVarFlag('do_rootfs', 'recrdeptask', flags) |
166 | d.setVar('OPKG_PREPROCESS_COMMANDS', "package_generate_archlist\nipk_insert_feed_uris") | 63 | d.setVar('OPKG_PREPROCESS_COMMANDS', "ipk_insert_feed_uris") |
167 | d.setVar('OPKG_POSTPROCESS_COMMANDS', '') | 64 | d.setVar('OPKG_POSTPROCESS_COMMANDS', '') |
168 | } | 65 | } |
169 | 66 | ||