V2 Fix incremental rpm image generation
cover V2 Fix incremental rpm image generation
Changes of V2:
* Save rpmlib for core-image-minimal rather than remove it
// Robert
The following changes since commit 12b4543ac9f54c0db0ee4a7ee546a71946a051f8:
classes/rootfs_*: fix splitting package dependency strings (2012-05-13 20:09:56 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib robert/inc_rpm
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/inc_rpm
Robert Yang (2):
package_rpm.bbclass: Fix incremental rpm image generation rootfs_rpm.bbclass: save rpmlib rather than remove it
meta/classes/image.bbclass | 6 ++++++ meta/classes/package_rpm.bbclass | 20 ++++++++------------ meta/classes/rootfs_rpm.bbclass | 6 +++++- 3 files changed, 19 insertions(+), 13 deletions(-)
PATCH 1/2 package_rpm.bbclass: Fix incremental rpm image generation
Fix the incremental rpm image generation, it didn't work since the code has been changed.
The btmanifest should have a ".manifest" suffix, so that it can be moved to ${T} by rootfs_rpm.bbclass:
mv ${IMAGE_ROOTFS}/install/*.manifest ${T}/
Note: The locale pkgs would always be re-installed.
[YOCTO #2440]
--- meta/classes/package_rpm.bbclass | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-)
meta/classes/package_rpm.bbclass +8 -12
@@ -158,28 +158,24 @@ rpm_common_comand () { rpm_update_pkg () { manifest=$1 - btmanifest=$manifest.bt + btmanifest=$manifest.bt.manifest + pre_btmanifest=${T}/${btmanifest##/*/} local target_rootfs="${INSTALL_ROOTFS_RPM}" # Save the rpm's build time for incremental image generation, and the file # would be moved to ${T} - rm -f $btmanifest for i in `cat $manifest`; do # Use "rpm" rather than "${RPM}" here, since we don't need the # '--dbpath' option - echo "$i `rpm -qp --qf '%{BUILDTIME}\n' $i`" >> $btmanifest - done + echo "$i `rpm -qp --qf '%{BUILDTIME}\n' $i`" + done | sort -u > $btmanifest # Only install the different pkgs if incremental image generation is set - if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f ${T}/total_solution_bt.manifest -a \ + if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" -a \ "${IMAGE_PKGTYPE}" = "rpm" ]; then - cur_list="$btmanifest" - pre_list="${T}/total_solution_bt.manifest" - sort -u $cur_list -o $cur_list - sort -u $pre_list -o $pre_list - comm -1 -3 $cur_list $pre_list | sed 's#.*/\(.*\)\.rpm .*#\1#' > \ + comm -1 -3 $btmanifest $pre_btmanifest | sed 's#.*/\(.*\)\.rpm .*#\1#' > \ ${target_rootfs}/install/remove.manifest - comm -2 -3 $cur_list $pre_list | awk '{print $1}' > \ + comm -2 -3 $btmanifest $pre_btmanifest | awk '{print $1}' > \ ${target_rootfs}/install/incremental.manifest # Attempt to remove unwanted pkgs, the scripts(pre, post, etc.) has not
@@ -462,7 +458,7 @@ EOF # probably a feature. The only way to convince rpm to actually run the preinstall scripts # for base-passwd and shadow first before installing packages that depend on these packages # is to do two image installs, installing one set of packages, then the other. - if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f ${T}/total_solution_bt.manifest ]; then + if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" ]; then echo "Skipping pre install due to exisitng image" else echo "# Initial Install manifest" > ${target_rootfs}/install/initial_install.manifest
Signature · 1 line
1.7.1
PATCH 2/2 rootfs_rpm.bbclass: save rpmlib rather than remove it
In reply to Robert YangThe rpmlib was removed when core-image-minimal, which would make the increment rpm image generation doesn't work in the second build, since list_installed_packages would get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back when INC_RPM_IMAGE_GEN =1.
[YOCTO #2440]
--- meta/classes/image.bbclass | 6 ++++++ meta/classes/rootfs_rpm.bbclass | 6 +++++- 2 files changed, 11 insertions(+), 1 deletions(-)
meta/classes/image.bbclass +6 -0
@@ -142,6 +142,12 @@ fakeroot do_rootfs () { # When use the rpm incremental image generation, don't remove the rootfs if [ "${INC_RPM_IMAGE_GEN}" != "1" -o "${IMAGE_PKGTYPE}" != "rpm" ]; then rm -rf ${IMAGE_ROOTFS} + elif [ -d ${T}/saved_rpmlib/var/lib/rpm ]; then + # Move the rpmlib back + if [ ! -d ${IMAGE_ROOTFS}/var/lib/rpm ]; then + mkdir -p ${IMAGE_ROOTFS}/var/lib/ + mv ${T}/saved_rpmlib/var/lib/rpm ${IMAGE_ROOTFS}/var/lib/ + fi fi rm -rf ${MULTILIB_TEMP_ROOTFS} mkdir -p ${IMAGE_ROOTFS}
meta/classes/rootfs_rpm.bbclass +5 -1
@@ -154,7 +154,11 @@ EOF } remove_packaging_data_files() { - rm -rf ${IMAGE_ROOTFS}${rpmlibdir} + # Save the rpmlib for increment rpm image generation + t="${T}/saved_rpmlib/var/lib" + rm -fr $t + mkdir -p $t + mv ${IMAGE_ROOTFS}${rpmlibdir} $t rm -rf ${IMAGE_ROOTFS}${opkglibdir} }
Signature · 1 line
1.7.1
Re: [PATCH 2/2] rootfs_rpm.bbclass: save rpmlib rather than remove it
Op 14 mei 2012, om 10:11 heeft Robert Yang het volgende geschreven:
Quoted 1 line
The rpmlib was removed when core-image-minimal,
Please replace 'core-image-minimal' with something like:
images that add "remove_packaging_data_files ; " to ROOTFS_POSTPROCESS_COMMAND
That points out the actual problem instead of having to guess what core-image-minimal is doing 'wrong' to need this patch.
Quoted 56 lines
which would make the
increment rpm image generation doesn't work in the second build, sincelist_installed_packageswould get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back whenINC_RPM_IMAGE_GEN=1.[YOCTO #2440]
Signed-off-by Robert Yang <[email protected]>---
meta/classes/image.bbclass | 6 ++++++ meta/classes/rootfs_rpm.bbclass | 6 +++++- 2 files changed, 11 insertions(+), 1 deletions(-)meta/classes/image.bbclass +6
-0@@ -142,6 +142,12 @@ fakeroot do_rootfs () { # When use the rpm incremental image generation, don't remove the rootfs if [ "${INC_RPM_IMAGE_GEN}" != "1" -o "${IMAGE_PKGTYPE}" != "rpm" ]; then rm -rf ${IMAGE_ROOTFS} + elif [ -d ${T}/saved_rpmlib/var/lib/rpm ]; then + # Move the rpmlib back + if [ ! -d ${IMAGE_ROOTFS}/var/lib/rpm ]; then + mkdir -p ${IMAGE_ROOTFS}/var/lib/ + mv ${T}/saved_rpmlib/var/lib/rpm ${IMAGE_ROOTFS}/var/lib/ + fi fi rm -rf ${MULTILIB_TEMP_ROOTFS} mkdir -p ${IMAGE_ROOTFS}meta/classes/rootfs_rpm.bbclass +5
-1@@ -154,7 +154,11 @@ EOF } remove_packaging_data_files() { - rm -rf ${IMAGE_ROOTFS}${rpmlibdir} + # Save the rpmlib for increment rpm image generation + t="${T}/saved_rpmlib/var/lib" + rm -fr $t + mkdir -p $t + mv ${IMAGE_ROOTFS}${rpmlibdir} $t rm -rf ${IMAGE_ROOTFS}${opkglibdir} }Signature · 7 lines
1.7.1 _______________________________________________ Openembedded-core mailing list [email protected] http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [PATCH 2/2] rootfs_rpm.bbclass: save rpmlib rather than remove it
Quoted 10 lines · Koen Kooi
Op 14 mei 2012, om 10:11 heeft Robert Yang het volgende geschreven:
Quoted 1 line
The rpmlib was removed when core-image-minimal,
Please replace 'core-image-minimal' with something like:
images that add "
remove_packaging_data_files; " toROOTFS_POSTPROCESS_COMMANDThat points out the actual problem instead of having to guess what core-image-minimal is doing 'wrong' to need this patch.
Thanks, I've updated the commit message and pushed to:
git://git.pokylinux.org/poky-contrib robert/inc_rpm
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/inc_rpm
The current message is:
The rpmlib was removed when images that add "remove_packaging_data_files" to ROOTFS_POSTPROCESS_COMMAND, which would make the increment rpm image generation doesn't work in the second build, since list_installed_packages would get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back when INC_RPM_IMAGE_GEN =1.
// Robert
Quoted 64 lines
Quoted 53 lines
which would make the
increment rpm image generation doesn't work in the second build, sincelist_installed_packageswould get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back whenINC_RPM_IMAGE_GEN=1.[YOCTO #2440]
Signed-off-by Robert Yang<[email protected]>---
meta/classes/image.bbclass | 6 ++++++ meta/classes/rootfs_rpm.bbclass | 6 +++++- 2 files changed, 11 insertions(+), 1 deletions(-)meta/classes/image.bbclass +6
-0@@ -142,6 +142,12 @@ fakeroot do_rootfs () { # When use the rpm incremental image generation, don't remove the rootfs if [ "${INC_RPM_IMAGE_GEN}" != "1" -o "${IMAGE_PKGTYPE}" != "rpm" ]; then rm -rf ${IMAGE_ROOTFS} + elif [ -d ${T}/saved_rpmlib/var/lib/rpm ]; then + # Move the rpmlib back + if [ ! -d ${IMAGE_ROOTFS}/var/lib/rpm ]; then + mkdir -p ${IMAGE_ROOTFS}/var/lib/ + mv ${T}/saved_rpmlib/var/lib/rpm ${IMAGE_ROOTFS}/var/lib/ + fi fi rm -rf ${MULTILIB_TEMP_ROOTFS} mkdir -p ${IMAGE_ROOTFS}meta/classes/rootfs_rpm.bbclass +5
-2@@ -154,7 +154,11 @@ EOF } remove_packaging_data_files() { - rm -rf ${IMAGE_ROOTFS}${rpmlibdir} + # Save the rpmlib for increment rpm image generation + t="${T}/saved_rpmlib/var/lib" + rm -fr $t + mkdir -p $t + mv ${IMAGE_ROOTFS}${rpmlibdir} $t rm -rf ${IMAGE_ROOTFS}${opkglibdir} } --1.7.1
Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Saul Wold
AppliedQuoted 23 lines · Robert Yang
Changes of V2:
* Save rpmlib for core-image-minimal rather than remove it// Robert
The following changes since commit
12b4543ac9f54c0db0ee4a7ee546a71946a051f8:classes/rootfs_*: fix splitting package dependency strings (2012-05-13 20:09:56 +0100)are available in the git repository at:
git://git.pokylinux.org/poky-contribrobert/inc_rpm
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/inc_rpmRobert Yang (2):
package_rpm.bbclass: Fix incremental rpm image generation rootfs_rpm.bbclass: save rpmlib rather than remove itmeta/classes/image.bbclass | 6 ++++++ meta/classes/package_rpm.bbclass | 20 ++++++++------------ meta/classes/rootfs_rpm.bbclass | 6 +++++- 3 files changed, 19 insertions(+), 13 deletions(-)
Quoted 5 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Merged into OE-Core
Thanks
Sau!
Flanagan, Elizabeth
AppliedRe: [PATCH 2/2] rootfs_rpm.bbclass: save rpmlib rather than remove it
In reply to Robert YangQuoted 28 lines · Robert Yang
Quoted 6 lines · Koen Kooi
Op 14 mei 2012, om 10:11 heeft Robert Yang het volgende geschreven:
Quoted 1 line
The rpmlib was removed when core-image-minimal,
Quoted 8 lines
Please replace 'core-image-minimal' with something like:
images that add "
remove_packaging_data_files; " toROOTFS_POSTPROCESS_COMMANDThat points out the actual problem instead of having to guess what core-image-minimal is doing 'wrong' to need this patch.
Thanks, I've updated the commit message and pushed to:
git://git.pokylinux.org/poky-contribrobert/inc_rpm
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/inc_rpmThe current message is:
The rpmlib was removed when images that add "
remove_packaging_data_files" toROOTFS_POSTPROCESS_COMMAND, which would
Quoted 7 lines
make the increment rpm image generation doesn't work in the second build, since
list_installed_packageswould get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back whenINC_RPM_IMAGE_GEN=1.// Robert
Merged into OE-Core
Thanks
-b
Quoted 75 lines
Quoted 58 lines
Quoted 58 lines
which would make the
increment rpm image generation doesn't work in the second build, sincelist_installed_packageswould get incorrect value in the second build, move the rpmlib to ${T} rather than remove it, and move it back whenINC_RPM_IMAGE_GEN=1.[YOCTO #2440]
Signed-off-by Robert Yang<[email protected]>---
meta/classes/image.bbclass | 6 ++++++
meta/classes/rootfs_rpm.bbclass | 6 +++++-2 files changed, 11 insertions(+), 1 deletions(-)meta/classes/image.bbclass +0
-0@@ -142,6 +142,12 @@ fakeroot do_rootfs () { # When use the rpm incremental image generation, don't remove therootfs
if [ "${INC_RPM_IMAGE_GEN}" != "1" -o "${IMAGE_PKGTYPE}" != "rpm" ]; then
rm -rf ${IMAGE_ROOTFS}
+ elif [ -d ${T}/saved_rpmlib/var/lib/rpm ]; then
+ # Move the rpmlib back
+ if [ ! -d ${IMAGE_ROOTFS}/var/lib/rpm ]; then
+ mkdir -p ${IMAGE_ROOTFS}/var/lib/
+ mv ${T}/saved_rpmlib/var/lib/rpm ${IMAGE_ROOTFS}/var/lib/
+ fi
fi
rm -rf ${MULTILIB_TEMP_ROOTFS}
mkdir -p ${IMAGE_ROOTFS}meta/classes/rootfs_rpm.bbclass +5
-2@@ -154,7 +154,11 @@ EOF } remove_packaging_data_files() { - rm -rf ${IMAGE_ROOTFS}${rpmlibdir} + # Save the rpmlib for increment rpm image generation + t="${T}/saved_rpmlib/var/lib" + rm -fr $t + mkdir -p $t + mv ${IMAGE_ROOTFS}${rpmlibdir} $t rm -rf ${IMAGE_ROOTFS}${opkglibdir} } --1.7.1
Quoted 12 lines
Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 3 lines
Elizabeth Flanagan Yocto Project Build and Release