Patchwork image_types.bbclass: fix link creation failure if the target already exists

login
register
mail settings
Submitter Petr Štetiar
Date Feb. 29, 2012, 8:33 p.m.
Message ID <1330547595-11631-1-git-send-email-ynezz@true.cz>
Download mbox | patch
Permalink /patch/22487/
State New
Headers show

Comments

Petr Štetiar - Feb. 29, 2012, 8:33 p.m.
| ln: failed to create symbolic link `beagleboard/systemd-image-beagleboard.tar.bz2': File exists
NOTE: package systemd-image-1.0-r0: task do_rootfs: Failed

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 meta/classes/image_types.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Richard Purdie - March 1, 2012, 3:50 p.m.
On Wed, 2012-02-29 at 21:33 +0100, Petr Štetiar wrote:
> | ln: failed to create symbolic link `beagleboard/systemd-image-beagleboard.tar.bz2': File exists
> NOTE: package systemd-image-1.0-r0: task do_rootfs: Failed
> 
> Signed-off-by: Petr Štetiar <ynezz@true.cz>
> ---
>  meta/classes/image_types.bbclass |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Is this still necessary after the recent image_types.bbclass fixes?

Cheers,

Richard
Andreas Müller - March 2, 2012, 12:29 p.m.
On Thu, Mar 1, 2012 at 4:50 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2012-02-29 at 21:33 +0100, Petr Štetiar wrote:
>> | ln: failed to create symbolic link `beagleboard/systemd-image-beagleboard.tar.bz2': File exists
>> NOTE: package systemd-image-1.0-r0: task do_rootfs: Failed
>>
>> Signed-off-by: Petr Štetiar <ynezz@true.cz>
>> ---
>>  meta/classes/image_types.bbclass |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> Is this still necessary after the recent image_types.bbclass fixes?
>
I pulled ~3-4 hours ago and the error persists. I don't know if it is
important for this problem but I am using opkg and get:

| ln: failed to create symbolic link
`/home/andreas/tmp/oe-core-eglibc/deploy/images/overo/xfce-base-image-overo.tar.bz2':
File exists
NOTE: package xfce-base-image-1.0-r0: task do_rootfs: Failed

Cheers

Andreas
Richard Purdie - March 2, 2012, 12:38 p.m.
On Fri, 2012-03-02 at 13:29 +0100, Andreas Müller wrote:
> On Thu, Mar 1, 2012 at 4:50 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Wed, 2012-02-29 at 21:33 +0100, Petr Štetiar wrote:
> >> | ln: failed to create symbolic link `beagleboard/systemd-image-beagleboard.tar.bz2': File exists
> >> NOTE: package systemd-image-1.0-r0: task do_rootfs: Failed
> >>
> >> Signed-off-by: Petr Štetiar <ynezz@true.cz>
> >> ---
> >>  meta/classes/image_types.bbclass |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > Is this still necessary after the recent image_types.bbclass fixes?
> >
> I pulled ~3-4 hours ago and the error persists. I don't know if it is
> important for this problem but I am using opkg and get:
> 
> | ln: failed to create symbolic link
> `/home/andreas/tmp/oe-core-eglibc/deploy/images/overo/xfce-base-image-overo.tar.bz2':
> File exists
> NOTE: package xfce-base-image-1.0-r0: task do_rootfs: Failed

Could you see what the IMAGE_FSTYPES variable contains please?

(bitbake xfce-base-image -e | grep ^IMAGE_FSTYPES)

The code shouldn't be trying to create this symlink more than once so
whilst I understand the intent of the patch adding -f, I'd like to
understand the root cause of the problem to ensure there isn't some
other issue.

Cheers,

Richard
Andreas Müller - March 2, 2012, 12:48 p.m.
On Fri, Mar 2, 2012 at 1:38 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Fri, 2012-03-02 at 13:29 +0100, Andreas Müller wrote:
>> On Thu, Mar 1, 2012 at 4:50 PM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>> > On Wed, 2012-02-29 at 21:33 +0100, Petr Štetiar wrote:
>> >> | ln: failed to create symbolic link `beagleboard/systemd-image-beagleboard.tar.bz2': File exists
>> >> NOTE: package systemd-image-1.0-r0: task do_rootfs: Failed
>> >>
>> >> Signed-off-by: Petr Štetiar <ynezz@true.cz>
>> >> ---
>> >>  meta/classes/image_types.bbclass |    2 +-
>> >>  1 files changed, 1 insertions(+), 1 deletions(-)
>> >
>> > Is this still necessary after the recent image_types.bbclass fixes?
>> >
>> I pulled ~3-4 hours ago and the error persists. I don't know if it is
>> important for this problem but I am using opkg and get:
>>
>> | ln: failed to create symbolic link
>> `/home/andreas/tmp/oe-core-eglibc/deploy/images/overo/xfce-base-image-overo.tar.bz2':
>> File exists
>> NOTE: package xfce-base-image-1.0-r0: task do_rootfs: Failed
>
> Could you see what the IMAGE_FSTYPES variable contains please?
>
> (bitbake xfce-base-image -e | grep ^IMAGE_FSTYPES)
>
> The code shouldn't be trying to create this symlink more than once so
> whilst I understand the intent of the patch adding -f, I'd like to
> understand the root cause of the problem to ensure there isn't some
> other issue.
>
Agreed:

IMAGE_FSTYPES="tar.bz2 tar.bz2"

Seems a 'sum' of local.conf

IMAGE_FSTYPES = "tar.bz2"

and machine.conf

IMAGE_FSTYPES += "tar.bz2"

Andreas

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 5b48a09..adab573 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -61,7 +61,7 @@  runimagecmd () {
         # And create the symlinks
         if [ -n "${IMAGE_LINK_NAME}" ]; then
             for type in ${subimages}; do
-                ln -s ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
+                ln -fs ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
             done
         fi
 }