* How to extract an archive in a git repostry and copy it to a defined position in the rootfs?
@ 2016-09-13 7:08 S.Jaritz
2016-09-13 9:58 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: S.Jaritz @ 2016-09-13 7:08 UTC (permalink / raw)
To: Yocto Project
[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]
Hej
I like to build an package out of a git repro. This git repro contains
compressed files. One of these files I like to copy into my package. I
looked into the documentation, but it is only described how to use the
fetcher of bitbake. Think I need to add some extra lines of instruction
after fetching.
Maybe you have an idea how to solve that.
My example:
#Source:
-> gitsm:/myGitServer.com/UnpackExample;protocol=http;branch=master
-> Dir struct:
- UnpackExample
- win
- linux
- x86
- arm
- example.tar.gz
#Dest:
example.tar.gz -> opt/*.*
del opt/xyz.bin
#Pseudo recipe:
SUMMARY = "my test"
SECTION = "test"
LICENSE = "CLOSED"
PVBASE := "${PV}"
PV = "${PVBASE}.${SRCPV}"
SRCREV = "${AUTOREV}"
SRC_URI =
"gitsm:/myGitServer.com/UnpackExample;protocol=http;branch=master"
S = "${WORKDIR}/git/linux/arm"
??? do_fetch_append () {
??? extract ${S}/example.tar.gz
??? }
??? do_install () {
??? copy ${S}/ ${D}/opt/
??? }
FILES_${PN} += "/opt/*"
# skip QA that is checking for the GNU_HASH
INSANE_SKIP_${PN} += "ldflags"
########## end of recipe ####################
Regards!
Stefan
------------------------------------------------------------
ESA Elektroschaltanlagen Grimma GmbH
Broner Ring 30
04668 Grimma
Telefon: +49 3437 9211 176
Telefax: +49 3437 9211 26
E-Mail: s.jaritz@esa-grimma.de
Internet: www.esa-grimma.de
Geschäftsführer:
Dipl.-Ing. Jörg Gaitzsch
Jörg Reinker
Sitz der Gesellschaft: Grimma
Ust.-ID: DE 141784437
Amtsgericht: Leipzig, HRB 5159
Steuernummer: 238/108/00755
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
erhalten
haben, informieren Sie bitte sofort den Absender und löschen Sie diese
Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser
Mail
ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any unauthorized
copying, disclosure or distribution of the material in this e-mail is
strictly
forbidden.
[-- Attachment #2: Type: text/html, Size: 4473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to extract an archive in a git repostry and copy it to a defined position in the rootfs?
2016-09-13 7:08 How to extract an archive in a git repostry and copy it to a defined position in the rootfs? S.Jaritz
@ 2016-09-13 9:58 ` Burton, Ross
2016-09-13 14:29 ` Antwort: Re: How to extract an archive in a git repostry and copy it to a defined position in the rootfs? (Solved) S.Jaritz
0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2016-09-13 9:58 UTC (permalink / raw)
To: S.Jaritz; +Cc: Yocto Project
[-- Attachment #1: Type: text/plain, Size: 497 bytes --]
On 13 September 2016 at 08:08, <S.Jaritz@esa-grimma.de> wrote:
>
> ??? do_fetch_append () {
> ??? extract ${S}/example.tar.gz
> ??? }
> ??? do_install () {
> ??? copy ${S}/ ${D}/opt/
> ??? }
It's a tarball so use "tar" to extract, and you'll need to mkdir ${D}/opt
before copying. but that's barely just pseudocode.
The only gotcha is that do_fetch() is a Python function so you can't just
append shell code. Simply move the extract into do_install().
Ross
[-- Attachment #2: Type: text/html, Size: 1306 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Antwort: Re: How to extract an archive in a git repostry and copy it to a defined position in the rootfs? (Solved)
2016-09-13 9:58 ` Burton, Ross
@ 2016-09-13 14:29 ` S.Jaritz
0 siblings, 0 replies; 3+ messages in thread
From: S.Jaritz @ 2016-09-13 14:29 UTC (permalink / raw)
To: Burton, Ross; +Cc: Yocto Project
[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]
Thanks for the help! The solution is simple. As mentioned by Ross No
do_fetch extension is needed. The extract + copy goes into do_install.
#### part of the recipe ####
do_install () {
install -d ${D}/opt
tar -xzf example.tar.gz -C ${D}/opt/
}
FILES_${PN} += "/opt/*"
########
Regards
Stefan Jaritz
------------------------------------------------------------
ESA Elektroschaltanlagen Grimma GmbH
Broner Ring 30
04668 Grimma
Telefon: +49 3437 9211 176
Telefax: +49 3437 9211 26
E-Mail: s.jaritz@esa-grimma.de
Internet: www.esa-grimma.de
Geschäftsführer:
Dipl.-Ing. Jörg Gaitzsch
Jörg Reinker
Sitz der Gesellschaft: Grimma
Ust.-ID: DE 141784437
Amtsgericht: Leipzig, HRB 5159
Steuernummer: 238/108/00755
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
erhalten
haben, informieren Sie bitte sofort den Absender und löschen Sie diese
Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser
Mail
ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any unauthorized
copying, disclosure or distribution of the material in this e-mail is
strictly
forbidden.
Von: "Burton, Ross" <ross.burton@intel.com>
An: S.Jaritz@esa-grimma.de
Kopie: Yocto Project <yocto@yoctoproject.org>
Datum: 13.09.2016 11:59
Betreff: Re: [yocto] How to extract an archive in a git repostry
and copy it to a defined position in the rootfs?
On 13 September 2016 at 08:08, <S.Jaritz@esa-grimma.de> wrote:
??? do_fetch_append () {
??? extract ${S}/example.tar.gz
??? }
??? do_install () {
??? copy ${S}/ ${D}/opt/
??? }
It's a tarball so use "tar" to extract, and you'll need to mkdir ${D}/opt
before copying. but that's barely just pseudocode.
The only gotcha is that do_fetch() is a Python function so you can't just
append shell code. Simply move the extract into do_install().
Ross
[-- Attachment #2: Type: text/html, Size: 4238 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-13 14:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 7:08 How to extract an archive in a git repostry and copy it to a defined position in the rootfs? S.Jaritz
2016-09-13 9:58 ` Burton, Ross
2016-09-13 14:29 ` Antwort: Re: How to extract an archive in a git repostry and copy it to a defined position in the rootfs? (Solved) S.Jaritz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.