Fix a number of rpm/zypper issues and related
cover Fix a number of rpm/zypper issues and related
This set of patches is believed for fix a number packaging, rpm and zypper related problems.
The first patch is necessary for debug information on packages with specific filenames embedded in them.
The second patch fixes a bug that is likely to affect a system only in the future if rpm, berkeley db or the way the DB is used changes significantly.
The third fix makes a minor change to the way zypper identifies the system release. I'm not 100% convinced this is necessary, we may choose to skip it as we don't have a file similar to "redhat-release" to scan for, for a system-wide version.
The fourth/fifth packages fix the sat-solver. Fourth uprevs the sat-solver to the latest version and enables gdb debugging info. The fifth adds a workaround suggested by the sat-solver maintainer for an RPM5 incompatibility as noted in the comments.
The sixth and final patch finally resolves the "repackage error" message generated by rpm when upgrades or package removals occur.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: mhatle/bernard/fixes
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/bernard/fixes
Thanks,
Mark Hatle <[email protected]>
---
Mark Hatle (6):
package.bbclass: Fix missing debug src files rootfs_rpm.bbclass: Add additional system configuration to RPM space
libzypp: Fix release query
sat-solver: uprev to the latest version
sat-solver: Add workaround for RPM 5 db construction
rpm: Disable repackage on upgrade/erasure by default
meta/classes/package.bbclass | 3 +- meta/classes/rootfs_rpm.bbclass | 26 +++++++++++++ .../conf/distro/include/poky-default-revisions.inc | 2 +- meta/recipes-devtools/rpm/rpm_5.4.0.bb | 3 +- .../libzypp/libzypp/config-release.patch | 21 +++++++++++ meta/recipes-extended/libzypp/libzypp_git.bb | 3 +- .../sat-solver/sat-solver/cmake.patch | 38 +++++++++----------- .../sat-solver/sat-solver/rpm5-solvdb.patch | 30 +++++++++++++++ meta/recipes-extended/sat-solver/sat-solver_git.bb | 3 +- 9 files changed, 103 insertions(+), 26 deletions(-) create mode 100644 meta/recipes-extended/libzypp/libzypp/config-release.patch create mode 100644 meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch
Signature · 1 line
1.7.3.4
PATCH 1/6 package.bbclass: Fix missing debug src files
The previous change used egrep instead of fgrep. We need to use fgrep because there are expression like syntaxes in some file names, we need exact matches.
--- meta/classes/package.bbclass | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
meta/classes/package.bbclass +2 -1
@@ -233,9 +233,10 @@ def splitfile2(debugsrcdir, d): processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | " # We need to ignore files that are not actually ours # we do this by only paying attention to items from this package - processdebugsrc += "egrep -z '%s' | " + processdebugsrc += "fgrep -z '%s' | " processdebugsrc += "(cd '%s' ; cpio -pd0mL '%s%s' 2>/dev/null)" + bb.note(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) os.system(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) # The copy by cpio may have resulted in some empty directories! Remove these
Signature · 1 line
1.7.3.4
Re: [poky] [PATCH 1/6] package.bbclass: Fix missing debug src files
Quoted 14 lines · Mark Hatle
The previous change used egrep instead of fgrep. We need to use fgrep because there are expression like syntaxes in some file names, we need exact matches.
Signed-off-by Mark Hatle <[email protected]>--- meta/classes/package.bbclass | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)meta/classes/package.bbclass +0
-0@@ -233,9 +233,10 @@ def splitfile2(debugsrcdir, d): processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | "
meta/classes/package.bbclass def splitfile2(debugsrcdir, d): · line 242
Quoted 10 lines
meta/classes/package.bbclass +2
-1# We need to ignore files that are not actually ours # we do this by only paying attention to items from this package - processdebugsrc += "egrep -z '%s' | " + processdebugsrc += "fgrep -z '%s' | " processdebugsrc += "(cd '%s' ; cpio -pd0mL '%s%s' 2>/dev/null)" + bb.note(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) os.system(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) # The copy by cpio may have resulted in some empty directories! Remove these
Did you mean to leave the bb.note() in?
Cheers,
Richard
Re: [poky] [PATCH 1/6] package.bbclass: Fix missing debug src files
Quoted 21 lines · Richard Purdie
Quoted 20 lines · Mark Hatle
The previous change used egrep instead of fgrep. We need to use fgrep because there are expression like syntaxes in some file names, we need exact matches.
Signed-off-by Mark Hatle <[email protected]>--- meta/classes/package.bbclass | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)meta/classes/package.bbclass +1
-1@@ -233,9 +233,10 @@ def splitfile2(debugsrcdir, d): processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | " # We need to ignore files that are not actually ours # we do this by only paying attention to items from this package - processdebugsrc += "egrep -z '%s' | " + processdebugsrc += "fgrep -z '%s' | " processdebugsrc += "(cd '%s' ; cpio -pd0mL '%s%s' 2>/dev/null)"
Quoted 6 lines
meta/classes/package.bbclass def splitfile2(debugsrcdir, d): · line 242
Quoted 4 lines
meta/classes/package.bbclass +1
-0+ bb.note(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) os.system(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) # The copy by cpio may have resulted in some empty directories! Remove theseDid you mean to leave the
bb.note()in?
No, that was supposed to be removed. Should I yank it and re-push the commit?
--Mark
Quoted 4 lines
Cheers,
Richard
Re: [poky] [PATCH 1/6] package.bbclass: Fix missing debug src files
Quoted 22 lines · Mark Hatle
Quoted 21 lines · Richard Purdie
Quoted 20 lines · Mark Hatle
The previous change used egrep instead of fgrep. We need to use fgrep because there are expression like syntaxes in some file names, we need exact matches.
Signed-off-by Mark Hatle <[email protected]>--- meta/classes/package.bbclass | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)meta/classes/package.bbclass +1
-1@@ -233,9 +233,10 @@ def splitfile2(debugsrcdir, d): processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | " # We need to ignore files that are not actually ours # we do this by only paying attention to items from this package - processdebugsrc += "egrep -z '%s' | " + processdebugsrc += "fgrep -z '%s' | " processdebugsrc += "(cd '%s' ; cpio -pd0mL '%s%s' 2>/dev/null)"
Quoted 8 lines
Quoted 6 lines
meta/classes/package.bbclass def splitfile2(debugsrcdir, d): · line 242
Quoted 4 lines
meta/classes/package.bbclass +1
-0+ bb.note(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) os.system(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)) # The copy by cpio may have resulted in some empty directories! Remove theseDid you mean to leave the
bb.note()in?No, that was supposed to be removed. Should I yank it and re-push the commit?
Since I'd looked through the rest and they were ok, I just tweaked this one.
Cheers,
Richard
PATCH 2/6 rootfs_rpm.bbclass: Add additional system configuration to RPM space
In reply to Mark HatleThe additional configuration should have been there from the beginning. The purpose of these config files is to have a consistent Berkeley DB configuration even if the underlying RPM version changes -- or the RPM macros change.
This likely would not cause any problems until we attempted an upgrade of either BDB or RPM.
--- meta/classes/rootfs_rpm.bbclass | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
meta/classes/rootfs_rpm.bbclass +26 -0
@@ -46,6 +46,32 @@ fakeroot rootfs_rpm_do_rootfs () { # Setup base system configuration mkdir -p ${IMAGE_ROOTFS}/etc/rpm/ + mkdir -p ${IMAGE_ROOTFS}${rpmlibdir} + mkdir -p ${IMAGE_ROOTFS}${rpmlibdir}/log + cat > ${IMAGE_ROOTFS}${rpmlibdir}/DB_CONFIG << EOF +# ================ Environment +set_data_dir . +set_create_dir . +set_lg_dir ./log +set_tmp_dir ./tmp + +# -- thread_count must be >= 8 +set_thread_count 64 + +# ================ Logging + +# ================ Memory Pool +set_mp_mmapsize 268435456 + +# ================ Locking +set_lk_max_locks 16384 +set_lk_max_lockers 16384 +set_lk_max_objects 16384 +mutex_set_max 163840 + +# ================ Replication +EOF + #install pacakges export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}" export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
Signature · 1 line
1.7.3.4
PATCH 3/6 libzypp: Fix release query
In reply to Mark HatleLibzypp is looking for the "redhat-release" file and using that version number to help adjust the system version. This ensures that there is something on the system that returns a correct value.
This patch is likely not necessary.
--- .../libzypp/libzypp/config-release.patch | 21 ++++++++++++++++++++ meta/recipes-extended/libzypp/libzypp_git.bb | 3 +- 2 files changed, 23 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-extended/libzypp/libzypp/config-release.patch
meta/recipes-extended/libzypp/libzypp/config-release.patch new file +21 -0
@@ -0,0 +1,21 @@ +Configure distro version package + +We need to configure a package that the system can use to determine the +system distribution version. + +Hack: for now set to task-poky-rpm. + +Signed-off-by: Mark Hatle <[email protected]> + +diff -ur git.orig/zypp/ZConfig.cc git/zypp/ZConfig.cc +--- git.orig/zypp/ZConfig.cc 2011-03-14 16:30:07.492786134 -0500 ++++ git/zypp/ZConfig.cc 2011-03-15 11:39:15.396801927 -0500 +@@ -821,7 +821,7 @@ + /////////////////////////////////////////////////////////////////// + + std::string ZConfig::distroverpkg() const +- { return "redhat-release"; } ++ { return "task-poky-rpm"; } + + /////////////////////////////////////////////////////////////////// +
meta/recipes-extended/libzypp/libzypp_git.bb +2 -1
@@ -13,7 +13,7 @@ RDEPENDS_${PN} = "sat-solver" S = "${WORKDIR}/git" PV = "0.0-git${SRCPV}" -PR = "r7" +PR = "r8" SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \ file://no-doc.patch \
@@ -22,6 +22,7 @@ SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \ file://builtin-arch.patch;apply=no \ file://no-builtin-arch.patch;apply=no \ file://archconf.patch;apply=no \ + file://config-release.patch \ " SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"
Signature · 1 line
1.7.3.4
PATCH 4/6 sat-solver: uprev to the latest version
In reply to Mark HatleUpgrade to the latest git version. Also update the cmake.patch to enable debugging in all configurations.
--- .../conf/distro/include/poky-default-revisions.inc | 2 +- .../sat-solver/sat-solver/cmake.patch | 38 +++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-)
meta/conf/distro/include/poky-default-revisions.inc +1 -1
@@ -165,7 +165,7 @@ SRCREV_pn-qemu-nativesdk ??= "${QEMUSRCREV}" SRCREV_pn-qemu ??= "${QEMUSRCREV}" SRCREV_pn-qemugl ??= "d888bbc723c00d197d34a39b5b7448660ec1b1c0" SRCREV_pn-qemugl-nativesdk ??= "d888bbc723c00d197d34a39b5b7448660ec1b1c0" -SRCREV_pn-sat-solver = "9e1f2a097965debebc69cebf8ed73c6ff31a5220" +SRCREV_pn-sat-solver = "20212ccd92c6b3a5a93a83da5d7d60e9c305e75c" SRCREV_pn-screenshot ??= "292" SRCREV_pn-settings-daemon ??= "0f174f463dfed500b65533e249cd22942e439c77" SRCREV_pn-swabber-native ??= "a0792390c5d6d5a5bade7ab155c80eef3f30fa52"
meta/recipes-extended/sat-solver/sat-solver/cmake.patch +17 -21
@@ -3,9 +3,11 @@ not building docs (need oxygen) 8/19/2010 - created by Qing He <[email protected]> 1/24/2011 - Disable Fedora/Debian checking/settings by Mark Hatle <[email protected]> +3/15/2011 - Updated to newer version of sat-solver by Mark Hatle <[email protected]> ---- a/CMakeLists.txt -+++ b/CMakeLists.txt +diff -ur git.orig/CMakeLists.txt git/CMakeLists.txt +--- git.orig/CMakeLists.txt 2011-03-15 17:14:22.000000000 -0500 ++++ git/CMakeLists.txt 2011-03-15 17:20:09.648880770 -0500 @@ -35,22 +35,15 @@ FIND_PACKAGE(Check REQUIRED) FIND_PACKAGE(ZLIB REQUIRED)
@@ -49,28 +51,22 @@ not building docs (need oxygen) -ENDIF ( FEDORA ) -ENDIF ( NOT DEBIAN ) - SET( PACKAGE "satsolver" ) - SET( VERSION "${LIBSATSOLVER_MAJOR}.${LIBSATSOLVER_MINOR}.${LIBSATSOLVER_PATCH}" ) -@@ -159,22 +153,7 @@ - ADD_SUBDIRECTORY(applayer) + INCLUDE ( CheckFunctionExists ) + INCLUDE ( TestBigEndian ) +@@ -164,7 +158,7 @@ + + MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}") + +-set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall" ) ++set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -g" ) + set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -g -O3" ) + set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0" ) + +@@ -173,7 +167,7 @@ + ADD_SUBDIRECTORY(tools) ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(examples) -ADD_SUBDIRECTORY(doc) -- --FIND_PACKAGE(SWIG) -- --IF ( SWIG_FOUND ) -- ADD_SUBDIRECTORY(bindings) --ELSE ( SWIG_FOUND ) -- # for older version of swig/cmake -- FIND_PROGRAM(SWIG_EXECUTABLE -- NAMES swig-1.3 swig -- PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin -- ) -- IF ( SWIG_EXECUTABLE ) -- ADD_SUBDIRECTORY(bindings) -- ENDIF ( SWIG_EXECUTABLE ) --ENDIF ( SWIG_FOUND ) +#ADD_SUBDIRECTORY(doc) MESSAGE(STATUS "version: ${VERSION}")
Signature · 1 line
1.7.3.4
PATCH 5/6 sat-solver: Add workaround for RPM 5 db construction
In reply to Mark HatleThe first time the database is created on an RPM5 system it works correctly. However any subsequent rebuilds cause an empty database to occur.
The following is from Michael Schroeder <[email protected]>:
Quoted 7 lines
rpmdb2solv contains a hack that makes it use the unchanged already converted packages. To do this, it needs to get the database id for every installed packages by reading the "Name" index. This somehow doesn't seem to work with rpm5.
As a workaround you can add a "ref = 0;" line at the top of the
repo_add_rpmdb()function inext/repo_rpmdb.c.
--- .../sat-solver/sat-solver/rpm5-solvdb.patch | 30 ++++++++++++++++++++ meta/recipes-extended/sat-solver/sat-solver_git.bb | 3 +- 2 files changed, 32 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch
meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch new file +30 -0
@@ -0,0 +1,30 @@ +sat-solver rpmdb based solv database construction + +The first time the database is created on an RPM5 system it works +correctly. However any subsequent rebuilds cause an empty database to +occur. + +The following is from Michael Schroeder <[email protected]>: +> rpmdb2solv contains a hack that makes it use the unchanged already +> converted packages. To do this, it needs to get the database id +> for every installed packages by reading the "Name" index. This +> somehow doesn't seem to work with rpm5. +> +> As a workaround you can add a "ref = 0;" line at the top of the +> repo_add_rpmdb() function in ext/repo_rpmdb.c. + +Signed-off-by: Mark Hatle <[email protected]> + +diff -ur git.orig/ext/repo_rpmdb.c git/ext/repo_rpmdb.c +--- git.orig/ext/repo_rpmdb.c 2011-03-16 09:43:50.470008215 -0500 ++++ git/ext/repo_rpmdb.c 2011-03-16 09:47:55.503989694 -0500 +@@ -1344,6 +1344,9 @@ + memset(&dbkey, 0, sizeof(dbkey)); + memset(&dbdata, 0, sizeof(dbdata)); + ++ /* Workaround for RPM 5 database construction */ ++ ref = 0; ++ + if (!rootdir) + rootdir = ""; +
meta/recipes-extended/sat-solver/sat-solver_git.bb +2 -1
@@ -7,11 +7,12 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" DEPENDS = "libcheck rpm zlib expat db" PV = "0.0-git${SRCPV}" -PR = "r4" +PR = "r5" SRC_URI = "git://gitorious.org/opensuse/sat-solver.git;protocol=git \ file://cmake.patch \ file://rpm5.patch \ + file://rpm5-solvdb.patch \ file://db5.patch \ file://builtin-arch.patch;apply=no \ file://no-builtin-arch.patch;apply=no \
Signature · 1 line
1.7.3.4
PATCH 6/6 rpm: Disable repackage on upgrade/erasure by default
In reply to Mark Hatle[YOCTO #787]
Disable the repackage on upgrade/erase by default. This removes the warning message:
error: cannot create %_repackage_dir /var/spool/repackage/1298783317
--- meta/recipes-devtools/rpm/rpm_5.4.0.bb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
meta/recipes-devtools/rpm/rpm_5.4.0.bb +2 -1
@@ -43,7 +43,7 @@ LICENSE = "LGPL 2.1" LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" DEPENDS = "bzip2 zlib python perl db openssl elfutils expat libpcre attr acl popt" -PR = "r14" +PR = "r15" # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed # in order to extract the distribution SRPM into a format we can extract...
@@ -343,6 +343,7 @@ do_install_append() { sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros + sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros # Enable Debian style arbitrary tags... sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
Signature · 1 line
1.7.3.4
Quoted 31 lines · Mark Hatle
This set of patches is believed for fix a number packaging, rpm and zypper related problems.
The first patch is necessary for debug information on packages with specific filenames embedded in them.
The second patch fixes a bug that is likely to affect a system only in the future if rpm, berkeley db or the way the DB is used changes significantly.
The third fix makes a minor change to the way zypper identifies the system release. I'm not 100% convinced this is necessary, we may choose to skip it as we don't have a file similar to "redhat-release" to scan for, for a system-wide version.
The fourth/fifth packages fix the sat-solver. Fourth uprevs the sat-solver to the latest version and enables gdb debugging info. The fifth adds a workaround suggested by the sat-solver maintainer for an RPM5 incompatibility as noted in the comments.
The sixth and final patch finally resolves the "repackage error" message generated by rpm when upgrades or package removals occur.
Pull URL:
git://git.pokylinux.org/poky-contrib.git
Branch: mhatle/bernard/fixes
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/bernard/fixesThanks,
Mark Hatle <[email protected]>
---
Quoted 7 lines
Mark Hatle (6):
package.bbclass: Fix missing debug src files rootfs_rpm.bbclass: Add additional system configuration to RPM space
libzypp: Fix release query
sat-solver: uprev to the latest version
sat-solver: Add workaround for RPM 5 db construction
rpm: Disable repackage on upgrade/erasure by default
I merged these with the debug line from the package.bbclass removed.
Hopefully this should get zypper working nicely, thanks for the work on this.
Cheers,
Richard