### PTXdist Menuconfig and Target Install Commands Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_advanced_rule_files.rst These are example commands used within the PTXdist build system. 'ptxdist menuconfig' is used to interactively configure build options, and 'ptxdist targetinstall foo' is used to install the package 'foo' to the target system. ```text $ ptxdist menuconfig $ ptxdist targetinstall foo ``` -------------------------------- ### PTXdist Target Install Command and Output Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_add_new_pkgs.rst This demonstrates the command to install a package to the target system and the expected output. The output provides detailed information about the installation process, including file copying, package creation, and metadata. It confirms that the executable is correctly placed and permissions are set. ```text $ ptxdist targetinstall foo ----------------------------- target: foo.targetinstall ----------------------------- install_init: preparing for image creation... install_init: @ARCH@ -> i386 ... done install_init: preinst not available install_init: postinst not available install_init: prerm not available install_init: postrm not available install_fixup: @PACKAGE@ -> foo ... done. install_fixup: @PRIORITY@ -> optional ... done. install_fixup: @VERSION@ -> 1.1.0 ... done. install_fixup: @SECTION@ -> base ... done. install_fixup: @AUTHOR@ -> "My Name " ... done. install_fixup: @DESCRIPTION@ -> missing ... done. install_copy: src=/home/jbe/my_new_prj/build-target/foo-1.1.0/foo dst=/usr/bin/foo owner=0 group=0 permissions=0755 xpkg_finish: collecting license (unknown) ... done. xpkg_finish: creating ipkg package ... done. finished target foo.targetinstall ---------------------------------- target: foo.targetinstall.post ---------------------------------- finished target foo.targetinstall.post ``` -------------------------------- ### Makefile for Installing Libraries Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt This Makefile snippet illustrates the use of the `install_lib` macro for installing shared libraries and managing their symbolic links. It shows how to install single or multiple libraries and specifies permissions. ```makefile $(STATEDIR)/mylib.targetinstall: @$(call targetinfo) @$(call install_init, mylib) @$(call install_fixup, mylib,PRIORITY,optional) @$(call install_fixup, mylib,SECTION,base) @$(call install_fixup, mylib,AUTHOR,"Developer ") @$(call install_fixup, mylib,DESCRIPTION,My shared library) # Install libfoo.so.1.0.0 and create required symlinks # Searches in /lib and /usr/lib automatically @$(call install_lib, mylib, 0, 0, 0644, libfoo) # Install multiple libraries @$(call install_lib, mylib, 0, 0, 0644, libbar) @$(call install_lib, mylib, 0, 0, 0644, libbaz) @$(call install_finish, mylib) @$(call touch) ``` -------------------------------- ### Makefile for Installing Files Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt This Makefile snippet demonstrates the use of the `install_copy` macro for installing individual files to the target filesystem. It covers various scenarios like creating directories, installing binaries, and handling different source locations. ```makefile $(STATEDIR)/mypackage.targetinstall: @$(call targetinfo) @$(call install_init, mypackage) @$(call install_fixup, mypackage,PRIORITY,optional) @$(call install_fixup, mypackage,SECTION,base) @$(call install_fixup, mypackage,AUTHOR,"Developer ") @$(call install_fixup, mypackage,DESCRIPTION,My package description) # Create a directory @$(call install_copy, mypackage, 0, 0, 0755, /home/user) # Install binary from build directory @$(call install_copy, mypackage, 0, 0, 0755, \ $(MYPACKAGE_DIR)/src/myapp, /usr/bin/myapp) # Install from package install directory (uses -) @$(call install_copy, mypackage, 0, 0, 0755, -, /usr/bin/myapp) # Install with different destination name @$(call install_copy, mypackage, 0, 0, 0644, \ $(MYPACKAGE_DIR)/config.sample, /etc/myapp.conf) # Install without stripping (for kernel modules use 'k') @$(call install_copy, mypackage, 0, 0, 0644, \ $(MYPACKAGE_DIR)/mymodule.ko, /lib/modules/mymodule.ko, k) @$(call install_finish, mypackage) @$(call touch) ``` -------------------------------- ### Install Package Components with PTXdist Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_add_new_pkgs.rst This command executes the 'install' stage for a package ('foo') in PTXdist. It typically handles the installation of libraries and header files required by other programs. The output shows the process of creating directories and copying files, preparing for subsequent stages. Failures might relate to build system issues or incorrect path configurations. ```text $ ptxdist install foo ----------------------- target: foo.install ----------------------- make[1]: Entering directory `/home/jbe/my_new_prj/build-target/foo-1.1.0' make[2]: Entering directory `/home/jbe/my_new_prj/build-target/foo-1.1.0' make[3]: Entering directory `/home/jbe/my_new_prj/build-target/foo-1.1.0' test -z "/usr/bin" || /bin/mkdir -p "/home/jbe/my_new_prj/build-target/foo-1.1.0/usr/bin" /usr/bin/install -c 'foo' '/home/jbe/my_new_prj/build-target/foo-1.1.0/usr/bin/foo' make[3]: Leaving directory `/home/jbe/my_new_prj/build-target/foo-1.1.0' make[2]: Leaving directory `/home/jbe/my_new_prj/build-target/foo-1.1.0' make[1]: Leaving directory `/home/jbe/my_new_prj/build-target/foo-1.1.0' finished target foo.install ---------------------------- target: foo.install.post ---------------------------- finished target foo.install.post ``` -------------------------------- ### PTXdist Target Install Stage Example Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_advanced_rule_files.rst This makefile snippet demonstrates the target install stage in PTXdist. It uses the install_copy macro to copy files to the target's sysroot and install_finish to finalize the installation. Conditional installation based on PTXCONF_FOO_BAR is also shown. ```make @$(call install_copy, foo, 0, 0, 0755, $(FOO_DIR)/foo, /usr/bin/foo) ifdef PTXCONF_FOO_BAR @$(call install_copy, foo, 0, 0, 0755, $(FOO_DIR)/bar, /usr/bin/bar) endif @$(call install_finish, foo) @$(call touch) ``` -------------------------------- ### Makefile for Installing Directory Trees Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt This Makefile snippet demonstrates the `install_tree` macro for installing entire directory structures while preserving permissions. It shows how to copy directories from source to destination, use the package directory, and maintain original UID/GID. ```makefile $(STATEDIR)/webapp.targetinstall: @$(call targetinfo) @$(call install_init, webapp) @$(call install_fixup, webapp,PRIORITY,optional) @$(call install_fixup, webapp,SECTION,base) @$(call install_fixup, webapp,AUTHOR,"Developer ") @$(call install_fixup, webapp,DESCRIPTION,Web application files) # Install entire directory tree from source to destination @$(call install_tree, webapp, 0, 0, \ $(WEBAPP_DIR)/html, /var/www/html) # Install from package directory (use - as source) @$(call install_tree, webapp, 0, 0, -, /usr/share/webapp) # Keep original UID/GID from source (use - for UID and GID) @$(call install_tree, webapp, -, -, \ $(WEBAPP_DIR)/data, /var/lib/webapp) @$(call install_finish, webapp) @$(call touch) ``` -------------------------------- ### Target Installation for Foo Package Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt This Makefile target defines the installation process for the 'foo' package on the target system. It uses PTXdist installation macros to set metadata, copy files, and install libraries. ```makefile $(STATEDIR)/foo.targetinstall: @$(call targetinfo) @$(call install_init, foo) @$(call install_fixup, foo,PRIORITY,optional) @$(call install_fixup, foo,SECTION,base) @$(call install_fixup, foo,AUTHOR,"My Name ") @$(call install_fixup, foo,DESCRIPTION,missing) @$(call install_copy, foo, 0, 0, 0755, -, /usr/bin/foo) @$(call install_lib, foo, 0, 0, 0644, libfoo) @$(call install_finish, foo) @$(call touch) ``` -------------------------------- ### Install OSELAS.Toolchain Directly to /opt Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst This command installs the OSELAS.Toolchain directly into the '/opt' directory. Unlike the 'images' command, the toolchain is not stripped, resulting in a larger disk space requirement but allowing for debugging of the toolchain itself. The DESTDIR variable can be used to specify an alternative installation path. ```bash ptxdist-|oselasTCNVendorptxdistversion| make install ``` -------------------------------- ### Install Executable in PTXdist Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_add_new_pkgs.rst This snippet shows how to install an executable to the target system's /usr/bin directory using PTXdist's install_copy function. It specifies the executable name, ownership, permissions, source location, and destination path. This is a crucial step for making your package's binaries available on the target. ```none @$(call install_copy, foo, 0, 0, 0755, $(FOO_DIR)/foo, /usr/bin/foo) ``` -------------------------------- ### Install OSELAS Toolchain (Debian/Ubuntu) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst Installs the binary OSELAS toolchain for the board support package using apt-get. The package name includes placeholders for vendor version, compiler name, and compiler version, which need to be replaced with actual values. ```shell $ apt-get install oselas.toolchain-|oselasTCNVendorVersion|-|ptxdistCompilerName|- ``` -------------------------------- ### Install Alternative File/Directory (make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Installs given files or directories into the project's root filesystem and creates an ipkg/opkg packet. It supports searching for the source in multiple locations. Parameters include package, UID, GID, permissions, and destination. ```make $(call install_alternative, , , , , ) ``` -------------------------------- ### Cross-Compilation for ARM Example Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst Illustrates how to compile a C program for the ARM architecture using a cross-compiler. This highlights the prefix convention used for target-specific toolchains. ```bash $ arm-softfloat-linux-gnu-gcc test.c -o test ``` -------------------------------- ### Build Executable and Install - CMake Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/rules/templates/src-cmake-prog/CMakeLists.txt This snippet defines a C executable target and specifies its installation path. It requires CMake version 3.1 or higher. The executable is built from a C source file named after the project, and it is installed to the 'bin' directory at runtime. ```cmake cmake_minimum_required(VERSION 3.1) project(@name@) add_executable(@name@ @name@.c ) install(TARGETS @name@ RUNTIME DESTINATION bin) ``` -------------------------------- ### Native C Compilation Example Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst Demonstrates the standard command to compile a C program for the native host system using the 'gcc' compiler. This is the baseline for understanding cross-compilation. ```bash $ gcc test.c -o test ``` -------------------------------- ### Install Pengutronix Archive Keyring Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst Installs the Pengutronix archive keyring to avoid warnings about untrusted package sources. This command ensures the authenticity of packages downloaded from the Pengutronix repository. ```shell $ apt-get install pengutronix-archive-keyring ``` -------------------------------- ### Install Directory Tree (make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Installs an entire directory tree from a source directory to the target's root filesystem and creates an ipkg packet. It takes package name, UID, GID, source directory, destination directory, and an optional strip parameter. ```make $(call install_tree, , , , , [, ]) ``` ```make $(call install_tree, foo, 0, 0, /home/jbe/foo, /usr/share/bar) ``` ```make $(call install_tree, foo, 0, 0, -, /usr/share/bar) ``` -------------------------------- ### QMake Package 'prepare' Stage Configuration (Shell) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_rule_file_layout.rst Example of how the 'world/prepare' function expands for a qmake-based package. It navigates to the package directory and executes qmake with the provided options. ```sh cd ${_DIR} && \ ${_PATH} ${_CONF_ENV} \ qmake ${_CONF_OPT} ``` -------------------------------- ### Install Alternative Directory Tree (make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Installs a directory tree using an alternative search path for the source. It copies files to the project's root and creates an ipkg packet. Parameters include package name, UID, GID, and destination directory. ```make $(call install_alternative_tree, , , , ) ``` ```make $(call install_alternative_tree, foo, 0, 0, /usr/share/bar) ``` -------------------------------- ### Install Files with BSP Override - Makefile Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt Installs files into the target filesystem with support for project-specific overrides. It uses the `install_alternative` macro, which handles file placement and permissions. This macro is crucial for managing configuration files and startup scripts across different platforms. ```makefile $(STATEDIR)/myconfig.targetinstall: @$(call targetinfo) @$(call install_init, myconfig) @$(call install_fixup, myconfig,PRIORITY,optional) @$(call install_fixup, myconfig,SECTION,base) @$(call install_fixup, myconfig,AUTHOR,"Developer ") @$(call install_fixup, myconfig,DESCRIPTION,Configuration files) # PTXdist searches for /etc/myapp.conf in this order: # 1. projectroot./etc/myapp.conf # 2. projectroot/etc/myapp.conf. # 3. platform's projectroot/etc/myapp.conf. # 4. projectroot/etc/myapp.conf # 5. platform's projectroot/etc/myapp.conf # 6. PTXdist's projectroot/etc/myapp.conf # 7. $(MYCONFIG_PKGDIR)/etc/myapp.conf @$(call install_alternative, myconfig, 0, 0, 0644, /etc/myapp.conf) # Install startup script @$(call install_alternative, myconfig, 0, 0, 0755, /etc/init.d/myapp) @$(call install_finish, myconfig) @$(call touch) ``` -------------------------------- ### Install Shared Library with install_lib (make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Installs a shared library and its runtime links into the root filesystem and package structure. It searches common library directories and handles necessary symlinks. ```make $(call install_lib, , , , , ) ``` ```make $(call install_lib, foo, 0, 0, 0644, libfoo1) ``` -------------------------------- ### PTXdist Setup and Project Actions Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_parameter.rst Details various actions for configuring and managing PTXdist projects, including selecting userland, platform, and toolchain configurations. Some actions like 'menu' provide interactive dialogs. ```bash ptxdist menu ptxdist select ptxdist platform ptxdist toolchain [] ptxdist collection ptxdist setup ptxdist localsetup ptxdist boardsetup ptxdist menuconfig ptxdist menuconfig platform ptxdist platformconfig ptxdist menuconfig kernel ptxdist kernelconfig ptxdist menuconfig barebox ptxdist nconfig [] ptxdist oldconfig [] ptxdist allmodconfig [] ptxdist allyesconfig [] ptxdist allnoconfig [] ptxdist alldefconfig [] ptxdist randconfig [] ptxdist migrate ``` -------------------------------- ### Install OSELAS Toolchain from Extracted Data Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst Installs the OSELAS toolchain by unpacking the 'data.tar.xz' archive into the root file system. This command requires root privileges and places the toolchain files in the /opt directory. ```shell $ sudo tar xf data.tar.xz -C / ``` -------------------------------- ### PTXdist Package Information Prompt Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_add_new_pkgs.rst This is an example of the interactive prompts PTXdist presents when creating a new 'target' package. It requests information such as package name, version, download URL, suffix, author, and section. ```text ptxdist: creating a new 'target' package: ptxdist: enter package name.......: foo ptxdist: enter version number.....: 1.1.0 ptxdist: enter URL of basedir.....: http://www.foo.com/download/src ptxdist: enter suffix.............: tar.gz ptxdist: enter package author.....: My Name ptxdist: enter package section....: project_specific ``` -------------------------------- ### Add Pengutronix Debian Repository Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst Instructions for adding the Pengutronix Debian package repository to the system's APT sources. This enables the installation of pre-built OSELAS binary toolchains. ```bash echo "deb http://www.pengutronix.de/debian/ lenny main" > /etc/apt/sources.list.d/pengutronix.list ``` -------------------------------- ### Install File or Directory using install_copy Macro Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst The `install_copy` macro installs a file or directory into the project's root filesystem or an ipkg/opkg package. It requires package name, UID, GID, permissions, and source path. An optional destination path and strip parameter are available. The source can be a directory, an absolute file path, or a special '-' character to use the destination path for locating the source. ```make $(call install_copy, , , , , [, [, ]]) ``` ```make $(call install_copy, foo, 0, 0, 0755, /home/user-foo) ``` -------------------------------- ### Generating MD5 Checksum for License File Lines Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_licenses.rst Provides an example of how to generate an MD5 checksum for a specific range of lines within a file using `sed` and `md5sum`. This is useful for creating the checksums required for the `_LICENSE_FILES` variable in PTXdist. ```bash $ sed -n 1,16p main.cc | md5sum - a01d61d3293ce28b883d8ba0c497e968 ``` -------------------------------- ### Example of a Broken Toolchain Symlink Structure Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/faq.rst This example demonstrates a broken symlink structure within a copied OSELAS toolchain. It shows how symlinks might be converted to regular files, leading to missing libraries on the target system. This typically occurs when using archive tools that do not preserve symlinks. ```bash $ ll `find . -name "libcrypt*"` -rwxr-xr-x 1 mkl ptx 55K 2007-07-25 14:54 ./lib/libcrypt-2.5.so* -rwxr-xr-x 1 mkl ptx 55K 2007-07-25 14:54 ./lib/libcrypt.so.1* -rw-r--r-- 1 mkl ptx 63K 2007-07-25 14:54 ./usr/lib/libcrypt.a -rw-r--r-- 1 mkl ptx 64K 2007-07-25 14:54 ./usr/lib/libcrypt_p.a -rwxr-xr-x 1 mkl ptx 55K 2007-07-25 14:54 ./usr/lib/libcrypt.so* ``` -------------------------------- ### Basic PTXdist Package Rule File Structure Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt Example of a basic package rule file (`rules/foo.make`) in PTXdist, defining package information and build stages. ```makefile # -*- makefile -*- # # Rules for package foo # PACKAGES-$(PTXCONF_FOO) += foo # # Paths and names ``` -------------------------------- ### PTXdist Project Setup and Configuration Commands Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt Commands to initialize and configure a PTXdist project, including main menus, software packages, hardware platforms, kernel, and bootloader. Also includes commands for migrating configurations. ```bash # Start the main interactive menu ptxdist menu # Configure the software packages (userland) ptxdist menuconfig # Configure the hardware platform settings ptxdist platformconfig # or ptxdist menuconfig platform # Configure the kernel ptxdist kernelconfig # or ptxdist menuconfig kernel # Configure barebox bootloader ptxdist menuconfig barebox # Run oldconfig to migrate configuration from previous version ptxdist oldconfig ptxdist oldconfig platform # Migrate all configuration files from a previous PTXdist release ptxdist migrate ``` -------------------------------- ### Install Stage Default Rule (Make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_rule_file_layout.rst The default install stage rule for PTXdist, invoked when the 'install' stage is omitted. It calls the 'world/install' macro to handle the installation process. The outcome is a timestamp file indicating successful completion. ```make $(STATEDIR)/.install: @$(call targetinfo) @$(call world/install, ) @$(call touch) ``` -------------------------------- ### Execute Arbitrary Commands during Build with execute Macros Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst The `execute` and `world/execute` macros allow running custom commands within the build environment, identical to default build commands. `world/execute` handles generic stage setup like cleaning build directories for 'prepare' and 'install' stages. Verbose mode logs the full command, while quiet mode redirects output. ```make $(call execute, , ) $(call world/execute, , ) ``` -------------------------------- ### Install Stage Default Rule (Shell) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_rule_file_layout.rst The default rule for the 'install' stage in PTXdist, executed within the package's source directory. It uses environment variables for paths, make, and install-specific options. All relevant files must be installed in the package's install directory after this stage. ```sh cd ${_DIR} && \ ${_PATH} ${_MAKE_ENV} \ ${MAKE} ${_INSTALL_OPT} ``` -------------------------------- ### Install Files with Glob Patterns (make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Installs files matching a positive glob pattern and excluding files matching a negative glob pattern. This is useful for selectively installing files from a directory. ```make $(call install_glob, foo, 0, 0, -, /usr/lib/foo, *.so, */libbar.so) ``` -------------------------------- ### Copy File from Install Directory to Root Filesystem (make) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Copies a file from the package install directory to the root filesystem. It uses '-' for the source path to indicate the package's install directory and specifies the destination. ```make $(call install_copy, foo, 0, 0, 0755, -, /usr/bin/foo) ``` -------------------------------- ### Install Symbolic Link using install_link Macro Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Illustrates the usage of the 'install_link' Make macro to create symbolic links. It specifies the package name, the target the link should point to (relative paths are preferred), and the desired location and name of the link. ```make $(call install_link, , , ) # Example 1: Create a symbolic link as /usr/lib/libfoo.so pointing to libfoo.so.1.1.0 $(call install_link, foo, libfoo.so.1.1.0, /usr/lib/libfoo.so) # Example 2: Create a symbolic link as /usr/bin/foo pointing to /bin/bar $(call install_link, foo, ../../bin/bar, /usr/bin/foo) ``` -------------------------------- ### Download All Required Packages at Once Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/faq.rst This command initiates the download of all necessary source packages for a PTXdist project in a single operation. It checks if packages are already present in the source path and downloads them if not. Ensure 'ptxdist setup' has been run first to define the source directory. ```bash $ ptxdist make get ``` -------------------------------- ### Install Images with ptx/image-* Macros Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst These macros (`ptx/image-install`, `ptx/image-install-link`, `world/image-clean`) are used exclusively in the `targetinstall` stage for installing files into `|ptxdistPlatformDir|/images` that are not part of a filesystem, such as bootloaders. ```make @$(call ptx/image-install, , $(_BUILD_DIR)/[, ]) @$(call ptx/image-install-link, , , ) @$(call world/image-clean, ) ``` -------------------------------- ### Install Binary Files via Tar Archive with install_archive Macro Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_add_bin_only_files.rst This snippet shows how to use the `install_archive` macro to install a directory tree of binary files from a tar archive. The macro extracts the archive to a specified destination directory on the target filesystem, preserving file structure, ownership, and permissions. This is efficient for installing multiple files or entire directory structures. ```make @$(call install_archive, binary_example, -, -, \ archive.tgz, /) ``` -------------------------------- ### Completing Target Install Stage in PTXdist Rule Files Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/faq.rst For custom rule files in PTXdist, ensure that the `install_finish` function is called at the end of the `targetinstall` stage. Without this call, PTXdist will not properly complete the installation of files to the target filesystem. ```makefile targetinstall: @echo "Installing custom files..." # ... your installation commands ... @$(call install_finish, [...]) ``` -------------------------------- ### Execute Default Build Commands with world/* Macros Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Macros like `world/get`, `world/extract`, `world/prepare`, `world/compile`, and `world/install` represent the default build commands for their respective stages. They are used to manage the build process for packages. ```make $(call world/get, ) ``` -------------------------------- ### Install CA Certificate to Root Filesystem Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_code_signing.rst This snippet demonstrates how to install a Certificate Authority (CA) certificate to the root filesystem using the 'install_copy' function and the 'cs_get_ca update' helper. It ensures the CA certificate is available for code signing operations on the target system. ```makefile $(call install_copy, rauc, 0, 0, 0644, \ $(shell cs_get_ca update), \ /etc/rauc/ca.cert.pem) ``` -------------------------------- ### Compile and Build OSELAS.Toolchain Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst This snippet shows the standard procedure to compile and build an OSELAS.Toolchain. It involves extracting the archive, navigating to the directory, selecting the appropriate configuration, and initiating the build process using ptxdist commands. ```bash tar xf OSELAS.Toolchain-|oselasTCNVendorVersion|.tar.bz2 cd OSELAS.Toolchain-|oselasTCNVendorVersion| ptxdist-|oselasTCNVendorptxdistversion| select ptxconfigs/|oselasToolchainName|.ptxconfig ptxdist-|oselasTCNVendorptxdistversion| go ``` -------------------------------- ### PTXdist Default 'get' Stage Rule (Makefile) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_rule_file_layout.rst This is the default rule executed by PTXdist for the 'get' stage if no specific rule is provided in the package's rule file. It typically signifies that this stage is skipped or handled by a default mechanism. ```makefile $(STATEDIR)/.get: @$(call targetinfo) @$(call touch) ``` -------------------------------- ### Create and Navigate to Local Directory (Bash) Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst This snippet shows how to create a 'local' directory in the home directory and then navigate into it. This is often a preliminary step before extracting PTXdist. ```bash cd mkdir local cd local ``` -------------------------------- ### Install Directory Tree using install_glob Macro Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/ref_make_macros.rst Details the 'install_glob' Make macro for selectively installing files and directories from a source tree. It allows specifying user/group IDs, source/destination directories, and glob patterns for inclusion ('yglob') and exclusion ('nglob'). ```make $(call install_glob, , , , , , , [, ]) ``` -------------------------------- ### Compare Configure Output with PTXdist Settings Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/dev_advanced_rule_files.rst The configure-helper.py script compares the output of a package's configure script with the settings defined in PTXdist's FOO_CONF_OPT. It highlights differences, indicating options that need to be added to the package definition. This helps in ensuring consistency between build configurations. ```text $ /opt/ptxdist-2017.06.0/scripts/configure-helper.py -p libsigrok --- rules/libsigrok.make ++++ libsigrok-0.5.0 @@ -4,3 +4,74 @@ --libdir=/usr/lib --build=x86_64-host-linux-gnu --host=arm-v7a-linux-gnueabihf + --enable-warnings=min|max|fatal|no + --disable-largefile + --enable-all-drivers + --enable-agilent-dmm [...] + --enable-ruby + --enable-java + --without-libserialport + --without-libftdi + --without-libusb + --without-librevisa + --without-libgpib + --without-libieee1284 + --with-jni-include-path=DIR-LIST ``` -------------------------------- ### Build Additional OSELAS.Toolchains Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/environment.rst This sequence of commands allows for building different OSELAS.Toolchains. It involves cleaning the current project, removing the existing configuration link, selecting a new toolchain definition from the 'ptxconfigs/' folder, and then starting the build process. ```bash ptxdist clean rm selected_ptxconfig ptxdist select ptxconfigs/any_other_toolchain_def.ptxconfig ptxdist go ``` -------------------------------- ### Example of an Intact Toolchain Symlink Structure Source: https://github.com/rac-mar-vys/ptxdist-mirror/blob/master/doc/faq.rst This example illustrates a correctly preserved symlink structure within an OSELAS toolchain. It shows how symlinks should point to their target files, ensuring that libraries are correctly resolved on the target system. This is achieved by using archive tools that retain symlinks, such as 'tar'. ```bash $ ll `find . -name "libcrypt*"` -rwxr-xr-x 1 mkl ptx 55K 2007-11-03 13:30 ./lib/libcrypt-2.5.so* lrwxrwxrwx 1 mkl ptx 15 2008-02-20 14:52 ./lib/libcrypt.so.1 -> libcrypt-2.5.so* -rw-r--r-- 1 mkl ptx 63K 2007-11-03 13:30 ./usr/lib/libcrypt.a -rw-r--r-- 1 mkl ptx 64K 2007-11-03 13:30 ./usr/lib/libcrypt_p.a lrwxrwxrwx 1 mkl ptx 23 2008-02-20 14:52 ./usr/lib/libcrypt.so -> ../../lib/libcrypt.so.1* ``` -------------------------------- ### Template Substitution for Configuration Files - Makefile Source: https://context7.com/rac-mar-vys/ptxdist-mirror/llms.txt Replaces placeholders within installed files using the `install_replace` macro. This is commonly used for configuration files where values like version numbers, hostnames, or feature flags need to be dynamically inserted during the build process. It requires the file to be installed first using `install_alternative`. ```makefile $(STATEDIR)/mypackage.targetinstall: @$(call targetinfo) @$(call install_init, mypackage) @$(call install_fixup, mypackage,PRIORITY,optional) @$(call install_fixup, mypackage,SECTION,base) @$(call install_fixup, mypackage,AUTHOR,"Developer ") @$(call install_fixup, mypackage,DESCRIPTION,Package with templates) # First install the template file @$(call install_alternative, mypackage, 0, 0, 0644, /etc/myapp.conf) # Replace placeholders in the installed file @$(call install_replace, mypackage, /etc/myapp.conf, \ @VERSION@, $(MYPACKAGE_VERSION)) @$(call install_replace, mypackage, /etc/myapp.conf, \ @HOSTNAME@, $(call ptx/ifdef,PTXCONF_HOSTNAME,$(PTXCONF_HOSTNAME),localhost)) @$(call install_replace, mypackage, /etc/myapp.conf, \ @FEATURE_ENABLED@, $(call ptx/yesno,PTXCONF_MYPACKAGE_FEATURE)) @$(call install_finish, mypackage) @$(call touch) ```