diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-11-29 15:43:16 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-17 17:24:50 +0000 |
commit | 019ba25654cd3ae63a6b6c0f2d67da520bf10bc6 (patch) | |
tree | 14b580e66114d16448bf956069e2993ff716fa5b /meta/classes/rootfs_rpm.bbclass | |
parent | b05efc27d03381f32d612122ae75c8d1224d7b5d (diff) | |
download | poky-019ba25654cd3ae63a6b6c0f2d67da520bf10bc6.tar.gz |
classes/*_rpm: integrate Smart into RPM filesystem construction
Use Smart to construct the root filesystem for images and the contents
of SDKs rather than the custom scripts around rpm we had previously.
This ensures the result when producing an updated image will be the
same as upgrading to the same package versions from an older image on
the target, as well as allowing us to remove a substantial amount of
code making the rpm classes much easier to follow.
Some bugfixes from Bogdan Marinescu <bogdan.marinescu@intel.com>.
SDK implementation and testing as well as a number of bugfixes from
Mark Hatle <mark.hatle@windriver.com>.
(From OE-Core rev: a726ae7c032fac1aa49ce34180fa2ed2dcaf87d3)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index 2bb1b08740..d0b0d5793f 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass | |||
@@ -7,11 +7,15 @@ ROOTFS_PKGMANAGE = "rpm zypper" | |||
7 | # Add 50Meg of extra space for zypper database space | 7 | # Add 50Meg of extra space for zypper database space |
8 | IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "zypper", " + 51200", "" ,d)}" | 8 | IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "zypper", " + 51200", "" ,d)}" |
9 | 9 | ||
10 | # Smart is python based, so be sure python-native is available to us. | ||
11 | EXTRANATIVEPATH += "python-native" | ||
12 | |||
10 | # Postinstalls on device are handled within this class at present | 13 | # Postinstalls on device are handled within this class at present |
11 | ROOTFS_PKGMANAGE_BOOTSTRAP = "" | 14 | ROOTFS_PKGMANAGE_BOOTSTRAP = "" |
12 | 15 | ||
13 | do_rootfs[depends] += "rpm-native:do_populate_sysroot" | 16 | do_rootfs[depends] += "rpm-native:do_populate_sysroot" |
14 | do_rootfs[depends] += "rpmresolve-native:do_populate_sysroot" | 17 | do_rootfs[depends] += "rpmresolve-native:do_populate_sysroot" |
18 | do_rootfs[depends] += "python-smartpm-native:do_populate_sysroot" | ||
15 | 19 | ||
16 | # Needed for update-alternatives | 20 | # Needed for update-alternatives |
17 | do_rootfs[depends] += "opkg-native:do_populate_sysroot" | 21 | do_rootfs[depends] += "opkg-native:do_populate_sysroot" |
@@ -21,8 +25,8 @@ do_rootfs[depends] += "createrepo-native:do_populate_sysroot" | |||
21 | 25 | ||
22 | do_rootfs[recrdeptask] += "do_package_write_rpm" | 26 | do_rootfs[recrdeptask] += "do_package_write_rpm" |
23 | 27 | ||
24 | RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " | 28 | RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; " |
25 | RPM_POSTPROCESS_COMMANDS = "" | 29 | RPM_POSTPROCESS_COMMANDS = "rpm_setup_smart_target_config; " |
26 | 30 | ||
27 | # | 31 | # |
28 | # Allow distributions to alter when [postponed] package install scripts are run | 32 | # Allow distributions to alter when [postponed] package install scripts are run |
@@ -32,7 +36,7 @@ POSTINSTALL_INITPOSITION ?= "98" | |||
32 | rpmlibdir = "/var/lib/rpm" | 36 | rpmlibdir = "/var/lib/rpm" |
33 | opkglibdir = "${localstatedir}/lib/opkg" | 37 | opkglibdir = "${localstatedir}/lib/opkg" |
34 | 38 | ||
35 | RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'" | 39 | RPMOPTS="--dbpath ${rpmlibdir}" |
36 | RPM="rpm ${RPMOPTS}" | 40 | RPM="rpm ${RPMOPTS}" |
37 | 41 | ||
38 | # RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files | 42 | # RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files |
@@ -42,13 +46,10 @@ do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock" | |||
42 | fakeroot rootfs_rpm_do_rootfs () { | 46 | fakeroot rootfs_rpm_do_rootfs () { |
43 | ${RPM_PREPROCESS_COMMANDS} | 47 | ${RPM_PREPROCESS_COMMANDS} |
44 | 48 | ||
45 | #createrepo "${DEPLOY_DIR_RPM}" | ||
46 | |||
47 | # install packages | 49 | # install packages |
48 | # This needs to work in the same way as populate_sdk_rpm.bbclass! | 50 | # This needs to work in the same way as populate_sdk_rpm.bbclass! |
49 | export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}" | 51 | export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}" |
50 | export INSTALL_PLATFORM_RPM="${TARGET_ARCH}" | 52 | export INSTALL_PLATFORM_RPM="${TARGET_ARCH}" |
51 | export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}" | ||
52 | export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}" | 53 | export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}" |
53 | export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}" | 54 | export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}" |
54 | export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}" | 55 | export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}" |
@@ -114,18 +115,10 @@ EOF | |||
114 | # remove lock files | 115 | # remove lock files |
115 | rm -f ${IMAGE_ROOTFS}${rpmlibdir}/__db.* | 116 | rm -f ${IMAGE_ROOTFS}${rpmlibdir}/__db.* |
116 | 117 | ||
117 | # Move manifests into the directory with the logs | ||
118 | mv ${IMAGE_ROOTFS}/install/*.manifest ${T}/ | ||
119 | |||
120 | # Remove all remaining resolver files | 118 | # Remove all remaining resolver files |
121 | rm -rf ${IMAGE_ROOTFS}/install | 119 | rm -rf ${IMAGE_ROOTFS}/install |
122 | 120 | ||
123 | log_check rootfs | 121 | log_check rootfs |
124 | |||
125 | # Workaround so the parser knows we need the resolve_package function! | ||
126 | if false ; then | ||
127 | resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true | ||
128 | fi | ||
129 | } | 122 | } |
130 | 123 | ||
131 | remove_packaging_data_files() { | 124 | remove_packaging_data_files() { |
@@ -135,10 +128,19 @@ remove_packaging_data_files() { | |||
135 | mkdir -p $t | 128 | mkdir -p $t |
136 | mv ${IMAGE_ROOTFS}${rpmlibdir} $t | 129 | mv ${IMAGE_ROOTFS}${rpmlibdir} $t |
137 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} | 130 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} |
131 | rm -rf ${IMAGE_ROOTFS}/var/lib/smart | ||
132 | } | ||
133 | |||
134 | rpm_setup_smart_target_config() { | ||
135 | # Set up smart configuration for the target | ||
136 | rm -rf ${IMAGE_ROOTFS}/var/lib/smart | ||
137 | smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart channel --add rpmsys type=rpm-sys -y | ||
138 | smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart config --set rpm-nolinktos=1 | ||
139 | smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart config --set rpm-noparentdirs=1 | ||
140 | rm -f ${IMAGE_ROOTFS}/var/lib/smart/config.old | ||
138 | } | 141 | } |
139 | 142 | ||
140 | RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}" \ | 143 | RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"' |
141 | -D "__dbi_txn create nofsync private"' | ||
142 | 144 | ||
143 | list_installed_packages() { | 145 | list_installed_packages() { |
144 | GET_LIST=$(${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN} %{Platform}\n]") | 146 | GET_LIST=$(${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN} %{Platform}\n]") |