summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_deb.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-12-22 14:46:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-03 12:14:26 +0000
commit38c2f66ea79f3ee3fed1757160340548e7687181 (patch)
tree757ad1a88ce2394db734acb20e6bd63cd5cb3d24 /meta/classes/rootfs_deb.bbclass
parent8a77467fe87de0e8a51e624aade2c994ee322836 (diff)
downloadpoky-38c2f66ea79f3ee3fed1757160340548e7687181.tar.gz
classes/image: implement generic locale package installation
Let each package-specific rootfs implementation provide basic functions to query the existence of a package and install a list of packages and then have a generic install function so this logic is in one place. Note: unlike previous versions of this code in OE-Core this uses the IMAGE_LINGUAS variable and not IMAGE_LOCALES - note that IMAGE_LINGUAS was what was used in OE-Classic and it is already used in OE-Core in order to install locale-base-*. This will mean that if IMAGE_LINGUAS is left at the default you will now get more packages installed. If you don't want these language support packages then you should set IMAGE_LINGUAS explicitly. This restores locale installation to the same state as OE-Classic, only we now support all the packaging backends. (From OE-Core rev: c0fc36f8629a6abb9a7b542df8a2857526547a31) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs_deb.bbclass')
-rw-r--r--meta/classes/rootfs_deb.bbclass37
1 files changed, 27 insertions, 10 deletions
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index bef055c6f5..b6c706c580 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -8,8 +8,18 @@ ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
8do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot" 8do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
9do_rootfs[recrdeptask] += "do_package_write_deb" 9do_rootfs[recrdeptask] += "do_package_write_deb"
10 10
11DEB_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
12
11opkglibdir = "${localstatedir}/lib/opkg" 13opkglibdir = "${localstatedir}/lib/opkg"
12 14
15deb_package_setflag() {
16 sed -i -e "/^Package: $2\$/{n; s/Status: install ok .*/Status: install ok $1/;}" ${IMAGE_ROOTFS}/var/lib/dpkg/status
17}
18
19deb_package_getflag() {
20 cat ${IMAGE_ROOTFS}/var/lib/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}"
21}
22
13fakeroot rootfs_deb_do_rootfs () { 23fakeroot rootfs_deb_do_rootfs () {
14 set +e 24 set +e
15 25
@@ -28,25 +38,18 @@ fakeroot rootfs_deb_do_rootfs () {
28 export INSTALL_TASK_DEB="rootfs" 38 export INSTALL_TASK_DEB="rootfs"
29 39
30 package_install_internal_deb 40 package_install_internal_deb
31 41 ${DEB_POSTPROCESS_COMMANDS}
32 42
33 export D=${IMAGE_ROOTFS} 43 export D=${IMAGE_ROOTFS}
34 export OFFLINE_ROOT=${IMAGE_ROOTFS} 44 export OFFLINE_ROOT=${IMAGE_ROOTFS}
35 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} 45 export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
36 export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} 46 export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
37 47
38 _flag () {
39 sed -i -e "/^Package: $2\$/{n; s/Status: install ok .*/Status: install ok $1/;}" ${IMAGE_ROOTFS}/var/lib/dpkg/status
40 }
41 _getflag () {
42 cat ${IMAGE_ROOTFS}/var/lib/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}"
43 }
44
45 # Attempt to run preinsts 48 # Attempt to run preinsts
46 # Mark packages with preinst failures as unpacked 49 # Mark packages with preinst failures as unpacked
47 for i in ${IMAGE_ROOTFS}/var/lib/dpkg/info/*.preinst; do 50 for i in ${IMAGE_ROOTFS}/var/lib/dpkg/info/*.preinst; do
48 if [ -f $i ] && ! sh $i; then 51 if [ -f $i ] && ! sh $i; then
49 _flag unpacked `basename $i .preinst` 52 deb_package_setflag unpacked `basename $i .preinst`
50 fi 53 fi
51 done 54 done
52 55
@@ -54,7 +57,7 @@ fakeroot rootfs_deb_do_rootfs () {
54 # Mark packages with postinst failures as unpacked 57 # Mark packages with postinst failures as unpacked
55 for i in ${IMAGE_ROOTFS}/var/lib/dpkg/info/*.postinst; do 58 for i in ${IMAGE_ROOTFS}/var/lib/dpkg/info/*.postinst; do
56 if [ -f $i ] && ! sh $i configure; then 59 if [ -f $i ] && ! sh $i configure; then
57 _flag unpacked `basename $i .postinst` 60 deb_package_setflag unpacked `basename $i .postinst`
58 fi 61 fi
59 done 62 done
60 63
@@ -104,3 +107,17 @@ list_package_depends() {
104list_package_recommends() { 107list_package_recommends() {
105 ${DPKG_QUERY_COMMAND} -s $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [0-9a-zA-Z.~\-]*)::g' 108 ${DPKG_QUERY_COMMAND} -s $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [0-9a-zA-Z.~\-]*)::g'
106} 109}
110
111rootfs_check_package_exists() {
112 if [ `apt-cache showpkg $1 | wc -l` -gt 2 ]; then
113 echo $1
114 fi
115}
116
117rootfs_install_packages() {
118 ${STAGING_BINDIR_NATIVE}/apt-get install $@ --force-yes --allow-unauthenticated
119
120 for pkg in $@ ; do
121 deb_package_setflag installed $pkg
122 done
123}