Bug 4595 - Invalid symbolic link file modules-arch.tgz in tmp/deploy/images directory
Summary: Invalid symbolic link file modules-arch.tgz in tmp/deploy/images directory
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5 M2
Assignee: Yi Zhao
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-06-03 09:11 UTC by Yi Zhao
Modified: 2013-06-09 09:01 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Zhao 2013-06-03 09:11:18 UTC
Branch: master
Git rev: 676fd3f394a0c0576b63c77ed2184bf5f42c29b6

When build an image, It will generate a symbolic link file named modules-arch.tgz in tmp/deploy/images directory. This file should link to the real modules tarball. But now it links to an invalid file. 

For example, If I build a qemux86-64 image and check the modules-qemux86-64.tgz: 
############
$ ls -l tmp/deploy/images/modules-*

-rw-rw-r--. 2 build build 32903617 May 29 20:13 tmp/deploy/images/modules--3.8.11+git8482dcdf68_0+dd089cb5ba-r4.1-qemux86-64-20130529090849.tgz

lrwxrwxrwx. 2 build build       81 May 29 20:13 tmp/deploy/images/modules-qemux86-64.tgz -> modules--3.8.11+git8482dcdf68_0+dd089cb5ba-r4.1-qemux86-64-20130529090849.tgz.bin
###########

The symbolic link file links to an invalid file which has an extra ".bin" suffix.
Comment 1 Darren Hart 2013-06-03 16:10:12 UTC
kernel.bbclass:

MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
...
MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
...
kernel_do_deploy() {
	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
	if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
		mkdir -p ${D}/lib
		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib
		ln -sf ${MODULE_TARBALL_BASE_NAME}.bin ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME}
	fi

The .bin suffix is clearly added here, but I'm not sure why. There is a lot of .bin throughout the code, I suspect something rooted in the history of the class/project. If you change just this one line above to not use .bin, does it work correctly?
Comment 2 Yi Zhao 2013-06-04 08:10:58 UTC
(In reply to comment #1)
> kernel.bbclass:
> 
> MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
> ...
> MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
> ...
> kernel_do_deploy() {
> 	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
> 	if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e
> '^CONFIG_MODULES=y$' .config); then
> 		mkdir -p ${D}/lib
> 		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib
> 		ln -sf ${MODULE_TARBALL_BASE_NAME}.bin
> ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME}
> 	fi
> 
> The .bin suffix is clearly added here, but I'm not sure why. There is a lot
> of .bin throughout the code, I suspect something rooted in the history of
> the class/project. If you change just this one line above to not use .bin,
> does it work correctly?

Yes, it works correctly. I think it is the right way to fix this issue. I will do more testing and send a patch later.