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
Linia 50: Linia 50:
</syntaxhighlight>
</syntaxhighlight>


Unde RPM_FILENAME e rezultatul comenzii de afișare a rpm-ului.
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.
 


===Pentru mai multe informații despre petalinux-build===
===Pentru mai multe informații despre petalinux-build===

Versiunea de la data 10 noiembrie 2026 16:25

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 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.

Pentru mai multe informații despre petalinux-build

petalinux-build --help
usage: Use petalinux-build [options]

Builds the project or the specified components

options:
  -D, --debug           Display the Debug prints.
  -h, --help            Show this help message and exit
  -p PROJECT_DIR, --project PROJECT_DIR
                        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:
    Build the project:
    $ petalinux-build
    The bootable images are in <PROJECT>/images/linux/.

    Build SDK:
    $ petalinux-build -s | --sdk
    The equivalent bitbake task is do_populate_sdk, Built sdk is deployed at <PROJECT>/images/linux/sdk.sh

    Build Minimal eSDK:
    $ 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:
    $ petalinux-build -a | --archiver

    Build SDK with archiver:
    $ petalinux-build --sdk --archiver

    Build kernel only:
    $ petalinux-build -c kernel

    Compile kernel forcefully:
    $ petalinux-build -c kernel -x compile -f

    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