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 8 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">
petalinux-build --help
# Allow the user namespaces required by BitBake during the build.
usage: Use petalinux-build [options]
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
</syntaxhighlight>


Builds the project or the specified components
Copiere sursă listener în Ubuntu:


options:
<syntaxhighlight lang="shell">
  -D, --debug          Display the Debug prints.
scp "C:/Users/mianc/Documents/ChatGPT/AAA/iq_udp_decimate8_listener.c" `
  -h, --help            Show this help message and exit
    "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"
  -p PROJECT_DIR, --project PROJECT_DIR
</syntaxhighlight>
                        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:
Apoi build:
    Build the project:
    $ petalinux-build
    The bootable images are in <PROJECT>/images/linux/.


    Build SDK:
<syntaxhighlight lang="shell">
    $ petalinux-build -s | --sdk
cd /home/tom/petalinux/arty-z7-iq
    The equivalent bitbake task is do_populate_sdk, Built sdk is deployed at <PROJECT>/images/linux/sdk.sh
petalinux-build -c iq-udp-decimate8-native
</syntaxhighlight>


    Build Minimal eSDK:
Check care e rpm-ul care conține fișierul
    $ petalinux-build -e | --esdk
    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


    Build project with archiver:
<syntaxhighlight lang="shell">
    $ petalinux-build -a | --archiver
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
</syntaxhighlight>


    Build SDK with archiver:
Apoi extrage executabilul cu:
    $ petalinux-build --sdk --archiver


     Build kernel only:
<syntaxhighlight lang="shell">
     $ petalinux-build -c kernel
(
     set -e
     set -o pipefail


     Compile kernel forcefully:
     rpm="$PWD/build/tmp/deploy/rpm/cortexa9t2hf_neon/RPM_FILENAME"
     $ petalinux-build -c kernel -x compile -f
     stage=$(mktemp -d)
    cd "$stage"


     Deploy kernel forcefully:
     rpm2cpio "$rpm" | cpio -id './usr/bin/iq-udp-decimate8-native'
     $ petalinux-build -c kernel -x deploy -f
    binary=./usr/bin/iq-udp-decimate8-native
     file "$binary"
    grep -aFo -- '--chirp' "$binary"


     Build rootfs only:
     scp "$binary" \
    $ petalinux-build -c rootfs
        tom@192.168.10.70:/home/tom/iq/active/iq_udp_decimate8_chirp
)
</syntaxhighlight>


    Build myapp of rootfs 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 myapp


    List all rootfs sub-components:
=Link-uri externe=
    $ petalinux-build -c rootfs -h
* [https://docs.amd.com/r/2025.2-English/ug1144-petalinux-tools-reference-guide/Overview PetaLinux Tools Documentation: Reference Guide (UG1144)]
 
    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]]
[[tag:bitbake]]
[[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