Skip to contentSkip to conversation

fix deb image creation issues

PATCH New Hongxu Jia 1 participant 3 messages Mar 2, 2013

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover fix deb image creation issues

[YOCTO #3721]
[YOCTO #3720]

The following changes since commit 0bedc0b80d9b46cbbf4a2c5e120a6aa52cbc7c2e:

sudo : upgrade to 1.8.6p6 (2013-02-28 23:15:52 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-deb-image
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-deb-image

Hongxu Jia (2):
package_deb.bbclass:fix the arch (replace "_" with "-") in deb
package control
package_deb.bbclass:fix meta-toolchain-sdk fail on do_populate_sdk

 meta/classes/package_deb.bbclass |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 1/2 package_deb.bbclass:fix the arch (replace "_" with "-") in deb package control

when build deb image, such as building meta-toolchain-sdk in x86_64 host, there is warning like that:
...
'x86_64' is not a valid architecture name: character _' not allowed (only letters, digits and characters -')
...

The params in deb package control file don't allow character _', only letters, digits and characters -' allowed. Change the arch's "_" to "-" in the deb package's control file at the control file creation time. Such as x86_64'-->x86-64'

[YOCTO #3721]

---
 meta/classes/package_deb.bbclass |    8 ++++++++
 1 file changed, 8 insertions(+)
meta/classes/package_deb.bbclass +8 -0
index eea15e7..309c48d 100644
@@ -82,6 +82,9 @@ package_install_internal_deb () {
 
 	tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list
 
+	# The params in deb package control don't allow character `_', so
+	# change the arch's `_' to `-' in it.
+	dpkg_arch=`echo ${dpkg_arch} | sed 's/_/-/g'`
 	cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \
 		| sed -e "s#Architecture \".*\";#Architecture \"${dpkg_arch}\";#" \
 		| sed -e "s:#ROOTFS#:${target_rootfs}:g" \
@@ -259,6 +262,11 @@ python do_package_deb () {
                     raise KeyError(f)
                 if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == 'all':
                     data = 'all'
+                elif i == 'PACKAGE_ARCH' or i == 'DPKG_ARCH':
+                   # The params in deb package control don't allow character
+                   # `_', so change the arch's `_' to `-'. Such as `x86_64'
+                   # -->`x86-64'
+                   data = data.replace('_', '-')
                 l2.append(data)
             return l2
 
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/2 package_deb.bbclass:fix meta-toolchain-sdk fail on do_populate_sdk

In reply to Hongxu Jia

When build meta-toolchain-sdk in a newly created environment, there is an error:
...
packagegroup-core-standalone-gmae-sdk-target set to manually installed. You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
avahi-dev: Depends: avahi (= 0.6.31-r6.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
...
In this case, avahi was installed and then removed by dpkg (the reason is unknown, only with log `Noting disappearance of avahi, which has been completely replaced'), the uninstall was done by dpkg rather than apt, and apt detected the package dependency was broken, so apt-get install failed.

Use `apt-get install -f' to correct the upper broken dependencies in place. The removed avahi will be reinstalled.

[YOCTO #3720]

---
 meta/classes/package_deb.bbclass |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
meta/classes/package_deb.bbclass +9 -3
index 309c48d..2f27800 100644
@@ -117,12 +117,18 @@ package_install_internal_deb () {
 	fi
 
 	# normal install
-	for i in ${package_to_install}; do
-		apt-get install $i --force-yes --allow-unauthenticated
+	if [ ! -z "${package_to_install}" ]; then
+		apt-get install ${package_to_install} --force-yes --allow-unauthenticated
 		if [ $? -ne 0 ]; then
 			exit 1
 		fi
-	done
+
+		# Attempt to correct the probable broken dependencies in place.
+		apt-get -f install
+		if [ $? -ne 0 ]; then
+			exit 1
+		fi
+	fi
 
 	rm -f `dirname ${BB_LOGFILE}`/log.do_${task}-attemptonly.${PID}
 	if [ ! -z "${package_attemptonly}" ]; then
Signature · 1 line
1.7.10.4