Skip to contentSkip to conversation

Recipe to Copy JAR files, not extract it

DISCUSSION Laurent d'Havé 3 participants 8 messages Jun 18, 2014 – Jun 19, 2014

lore
Share & tools
lore
#0 lore raw

Hello
In a recipe i'm writing, i need to simply copy a .jar file.
Since it's specified in SRC_URI , bitbake extracts it, making WORKDIR a complete mess, and makes it impossible to copy the .jar file to destination.

How would i go about simply copying it ? Anyway to tell bitbake NOT to extract content of it ?

#1 lore raw

Hi Laurent,

Quoted 8 lines · On Wednesday 18 June 2014 15:32:17 Laurent d'Havé wrote:

Hello
In a recipe i'm writing, i need to simply copy a .jar file. Since it's specified in SRC_URI , bitbake extracts it, making WORKDIR a complete mess, and makes it impossible to copy the .jar file to destination.

How would i go about simply copying it ? Anyway to tell bitbake NOT to extract content of it ?

if you add ;unpack=0 to the end of the entry for the jar file within SRC_URI, it should prevent it from being unpacked.

(I see we don't have this documented anywhere, I will add it to the documentation todo list.)

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#2 lore raw
Quoted 10 lines · On Wednesday 18 June 2014 17:06:31 Paul Eggleton wrote:

Hi Laurent,

Quoted 7 lines · On Wednesday 18 June 2014 15:32:17 Laurent d'Havé wrote:

Hello
In a recipe i'm writing, i need to simply copy a .jar file. Since it's specified in SRC_URI , bitbake extracts it, making WORKDIR a complete mess, and makes it impossible to copy the .jar file to destination.

Quoted 8 lines
Quoted 2 lines

How would i go about simply copying it ? Anyway to tell bitbake NOT to extract content of it ?

if you add ;unpack=0 to the end of the entry for the jar file within SRC_URI, it should prevent it from being unpacked.

(I see we don't have this documented anywhere, I will add it to the documentation todo list.)

Actually, I was mistaken - it is mentioned in the reference manual:

http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-SRC_URI

(FWIW, I'm happy to answer questions even if they are covered by the manual, this is just an aside ;)

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw

Damn , i did RTFM, but that's not the version i was reading. That'll teach me !

Thanks for quick response, really sorry , for not reading the latest version of the manual.

Take care
Laurent

Quoted 34 lines

Paul Eggleton <mailto:[email protected]> 18 June 2014 18:09

Actually, I was mistaken - it is mentioned in the reference manual:

http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-SRC_URI

(FWIW, I'm happy to answer questions even if they are covered by the manual, this is just an aside ;)

Cheers,
Paul

Paul Eggleton <mailto:[email protected]> 18 June 2014 18:06
Hi Laurent,

if you add ;unpack=0 to the end of the entry for the jar file within SRC_URI, it should prevent it from being unpacked.

(I see we don't have this documented anywhere, I will add it to the documentation todo list.)

Cheers,
Paul

Laurent d'Havé <mailto:[email protected]>
18 June 2014 15:32
Hello
In a recipe i'm writing, i need to simply copy a .jar file.
Since it's specified in SRC_URI , bitbake extracts it, making WORKDIR a complete mess, and makes it impossible to copy the .jar file to destination.

How would i go about simply copying it ? Anyway to tell bitbake NOT to extract content of it ?

#4 lore raw
Quoted 5 lines · On Wednesday 18 June 2014 18:19:23 Laurent d'Havé wrote:

Damn , i did RTFM, but that's not the version i was reading. That'll teach me !

Thanks for quick response, really sorry , for not reading the latest version of the manual.

No problem; please feel free to ask any questions you have. I never tell people to RTFM, although I may point to sections of the manual if they exist to save me some typing :)

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#5 lore raw

That worked great.

Except i'm now having a strange issue, been pulling hair's out for a couple of hours ...

WARNING: QA Issue: taxi: Files/directories were installed but not shipped
/usr/share
/usr/share/java
/usr/share/java/headless.jar

And indeed, my jar file will not be bundled in the rootfs !!

Some copy-paste from my recipe :

SRC_URI = " \
file://headless .jar;unpack=0 \
"
do_install() {
install -m 0755 -d ${D}/usr/share/java
install -m 0755 ${WORKDIR}/headless .jar ${D}/usr/share/java }

Any clues ? If i change the path /usr/bin it works. Is it because i'm putting it in /usr/share/java ? But that's where all the other JAR's go ...

h e l p

Quoted 43 lines

Paul Eggleton <mailto:[email protected]> 18 June 2014 18:31

No problem; please feel free to ask any questions you have. I never tell people to RTFM, although I may point to sections of the manual if they exist to save me some typing :)

Cheers,
Paul

Laurent d'Havé <mailto:[email protected]>
18 June 2014 18:19
Damn , i did RTFM, but that's not the version i was reading. That'll teach me !

Thanks for quick response, really sorry , for not reading the latest version of the manual.

Take care
Laurent

Paul Eggleton <mailto:[email protected]> 18 June 2014 18:09

Actually, I was mistaken - it is mentioned in the reference manual:

http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-SRC_URI

(FWIW, I'm happy to answer questions even if they are covered by the manual, this is just an aside ;)

Cheers,
Paul

Laurent d'Havé <mailto:[email protected]>
18 June 2014 15:32
Hello
In a recipe i'm writing, i need to simply copy a .jar file.
Since it's specified in SRC_URI , bitbake extracts it, making WORKDIR a complete mess, and makes it impossible to copy the .jar file to destination.

How would i go about simply copying it ? Anyway to tell bitbake NOT to extract content of it ?

#6 lore raw
Quoted 24 lines · On Thursday 19 June 2014 15:40:59 Laurent d'Havé wrote:

That worked great.

Except i'm now having a strange issue, been pulling hair's out for a couple of hours ...

WARNING: QA Issue: taxi: Files/directories were installed but not shipped
/usr/share
/usr/share/java
/usr/share/java/headless.jar

And indeed, my jar file will not be bundled in the rootfs !!

Some copy-paste from my recipe :

SRC_URI = " \
file://headless .jar;unpack=0 \
"
do_install() {
install -m 0755 -d ${D}/usr/share/java
install -m 0755 ${WORKDIR}/headless .jar ${D}/usr/share/java }

Quoted 3 lines

Any clues ? If i change the path /usr/bin it works. Is it because i'm putting it in /usr/share/java ? But that's where all the other JAR's go ...

The key is "installed but not shipped" - you've installed the files, but they aren't being shipped in any package. The files in each package are specified using FILES, and /usr/share is ${datadir}, so I'd suggest something like the following:

FILES_${PN} += "${datadir}/java"

(Moving the files to /usr/bin works because that is already in the default value of FILES_${PN}, whereas /usr/share/java isn't).

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#7 lore raw
In reply to Paul Eggleton
Quoted 9 lines · Paul Eggleton

Hi Laurent,

Quoted 6 lines · On Wednesday 18 June 2014 15:32:17 Laurent d'Havé wrote:

Hello
In a recipe i'm writing, i need to simply copy a .jar file. Since it's specified in SRC_URI , bitbake extracts it, making WORKDIR a complete mess, and makes it impossible to copy the .jar file to destination.

Quoted 8 lines
Quoted 2 lines

How would i go about simply copying it ? Anyway to tell bitbake NOT to extract content of it ?

if you add ;unpack=0 to the end of the entry for the jar file within SRC_URI, it should prevent it from being unpacked.

(I see we don't have this documented anywhere, I will add it to the documentation todo list.)

it's mentioned in Section 4.2 of the bitbake user manual.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================