Sintaxa comenzii petalinux-build: Diferență între versiuni

De la YO3ITI
Sari la navigare Sari la căutare
Fără descriere a modificării
Fără descriere a modificării
 
(Nu s-au afișat 4 versiuni intermediare efectuate de același utilizator)
Linia 1: Linia 1:
Documentația oficială Petalinux pe platforme AMD (Xilinx) se găsește la [https://docs.amd.com/r/2025.2-English/ug1144-petalinux-tools-reference-guide/Overview PetaLinux Tools Documentation: Reference Guide (UG1144)]
BitBake este un sistem de automatizare a procesului de compilare (build automation engine), utilizat în principal de Yocto Project, OpenEmbedded și AMD PetaLinux pentru construirea distribuțiilor Linux destinate sistemelor embedded.
BitBake este un sistem de automatizare a procesului de compilare (build automation engine), utilizat în principal de Yocto Project, OpenEmbedded și AMD PetaLinux pentru construirea distribuțiilor Linux destinate sistemelor embedded.


Pentru utilizarea <code>petalinux-build</code>:
Pentru rularea unei rutine de build pe petalinux, mai jos sunt pașii pentru utilizarea <code>petalinux-build</code>:


<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
Linia 22: Linia 24:
</syntaxhighlight>
</syntaxhighlight>


 
Check care e rpm-ul care conține fișierul
Apoi:


<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
petalinux-build --help
tom@tom-ThinkPad-T560:~$ cd /home/tom/petalinux/arty-z7-iq
usage: Use petalinux-build [options]
ls -lt build/tmp/deploy/rpm/cortexa9t2hf_neon/iq-udp-decimate8-native-[0-9]*.rpm
</syntaxhighlight>


Builds the project or the specified components
Apoi extrage executabilul cu:


options:
<syntaxhighlight lang="shell">
  -D, --debug          Display the Debug prints.
(
  -h, --help            Show this help message and exit
    set -e
  -p PROJECT_DIR, --project PROJECT_DIR
    set -o pipefail
                        path to PetaLinux SDK project.
                        Default is working project.
  -c COMPONENT, --component COMPONENT
                        Specify the component
                        it will build the specified component and its dependencies.
                        E.g. -c rootfs.
                        E.g. -c myapp.
  -x <tasks of BitBake>, --execute <tasks of BitBake>
                        Specify a bitbake task of the component
                        To know the list tasks for a component:
                        E.g. -x do_listtasks.
  -f, --force          Force run a specific task ignoring the stamps
                        Force run has to be for a component or its tasks
                        E.g. -c myapp -f
                        E.g. -c myapp -x compile -f.
  -s, --sdk            Build SDK ==> do_populate_sdk.
  -e, --esdk            Build Minimal eSDK ==> do_populate_sdk_ext.
  -a, --archiver        This will create archiver.tar.gz in the images/linux folder
                        which contains sources and licenses.


Examples:
     rpm="$PWD/build/tmp/deploy/rpm/cortexa9t2hf_neon/RPM_FILENAME"
     Build the project:
     stage=$(mktemp -d)
     $ petalinux-build
     cd "$stage"
     The bootable images are in <PROJECT>/images/linux/.


     Build SDK:
     rpm2cpio "$rpm" | cpio -id './usr/bin/iq-udp-decimate8-native'
    $ petalinux-build -s | --sdk
     binary=./usr/bin/iq-udp-decimate8-native
     The equivalent bitbake task is do_populate_sdk, Built sdk is deployed at <PROJECT>/images/linux/sdk.sh
    file "$binary"
    grep -aFo -- '--chirp' "$binary"


     Build Minimal eSDK:
     scp "$binary" \
    $ petalinux-build -e | --esdk
        tom@192.168.10.70:/home/tom/iq/active/iq_udp_decimate8_chirp
    The equivalent bitbake task is do_populate_sdk_ext, Built esdk is deployed at <PROJECT>/images/linux/esdk.sh
)
    This can be imported to petalinux tool with user source changes
</syntaxhighlight>
 
    Build project with archiver:
    $ petalinux-build -a | --archiver
 
    Build SDK with archiver:
    $ petalinux-build --sdk --archiver


    Build kernel only:
Unde RPM_FILENAME e rezultatul comenzii de afișare a rpm-ului. <code>grep -aFo -- '--chirp' "$binary"</code> poate fi schimbat pentru a afișa informații legate de tipul aplicației.
    $ petalinux-build -c kernel


    Compile kernel forcefully:
=Link-uri externe=
    $ petalinux-build -c kernel -x compile -f
* [https://docs.amd.com/r/2025.2-English/ug1144-petalinux-tools-reference-guide/Overview PetaLinux Tools Documentation: Reference Guide (UG1144)]
 
    Deploy kernel forcefully:
    $ petalinux-build -c kernel -x deploy -f
 
    Build rootfs only:
    $ petalinux-build -c rootfs
 
    Build myapp of rootfs only:
    $ petalinux-build -c myapp
 
    List all rootfs sub-components:
    $ petalinux-build -c rootfs -h
 
    Clean up u-boot and build again:
    $ petalinux-build -c u-boot -x distclean
    Above command will remove tmp files and sstate cache of u-boot.
 
    $ petalinux-build -x distclean
    Above command will remove tmp files and sstate cache files.
 
    Clean up the project build and the generated bootable images:
    $ petalinux-build -x mrproper
    Above command will remove tmp files, <PROJECT>/images/,  <PROJECT>/build/
                and <PROJECT>/components/plnx_workspace directories
</syntaxhighlight>


[[category:FPGA]]
[[category:FPGA]]
[[category:petalinux]]
[[category:Doppler IQ App]]
[[category:bitbake]]
[[category:Petalinux]]
[[category:Arty Z7-20]]
[[category:Bitbake]]

Versiunea curentă din 17 noiembrie 2026 16:13

Documentația oficială Petalinux pe platforme AMD (Xilinx) se găsește la PetaLinux Tools Documentation: Reference Guide (UG1144)

BitBake este un sistem de automatizare a procesului de compilare (build automation engine), utilizat în principal de Yocto Project, OpenEmbedded și AMD PetaLinux pentru construirea distribuțiilor Linux destinate sistemelor embedded.

Pentru rularea unei rutine de build pe petalinux, mai jos sunt pașii pentru utilizarea petalinux-build:

# Allow the user namespaces required by BitBake during the build.
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

Copiere sursă listener în Ubuntu:

scp "C:/Users/mianc/Documents/ChatGPT/AAA/iq_udp_decimate8_listener.c" `
    "tom@192.168.10.40:/home/tom/petalinux/arty-z7-iq/project-spec/meta-user/recipes-apps/iq-udp-decimate8-native/files/iq-udp-decimate8-native.c"

Apoi build:

cd /home/tom/petalinux/arty-z7-iq
petalinux-build -c iq-udp-decimate8-native

Check care e rpm-ul care conține fișierul

tom@tom-ThinkPad-T560:~$ cd /home/tom/petalinux/arty-z7-iq
ls -lt build/tmp/deploy/rpm/cortexa9t2hf_neon/iq-udp-decimate8-native-[0-9]*.rpm

Apoi extrage executabilul cu:

(
    set -e
    set -o pipefail

    rpm="$PWD/build/tmp/deploy/rpm/cortexa9t2hf_neon/RPM_FILENAME"
    stage=$(mktemp -d)
    cd "$stage"

    rpm2cpio "$rpm" | cpio -id './usr/bin/iq-udp-decimate8-native'
    binary=./usr/bin/iq-udp-decimate8-native
    file "$binary"
    grep -aFo -- '--chirp' "$binary"

    scp "$binary" \
        tom@192.168.10.70:/home/tom/iq/active/iq_udp_decimate8_chirp
)

Unde RPM_FILENAME e rezultatul comenzii de afișare a rpm-ului. grep -aFo -- '--chirp' "$binary" poate fi schimbat pentru a afișa informații legate de tipul aplicației.

Link-uri externe