diff --git a/.bazelrc b/.bazelrc index a86da27..09b59b6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -4,8 +4,11 @@ common --registry=https://bcr.bazel.build test --test_output=errors build:x86_64-qnx --incompatible_strict_action_env -build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx8_0 +build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix build:x86_64-qnx --sandbox_writable_path=/var/tmp +build:x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0 +build:x86_64-qnx --extra_toolchains=@score_qnx_x86_64_ifs_toolchain//:ifs-x86_64-qnx-sdp_8.0.0 +build:x86_64-qnx --credential_helper=*.qnx.com=%workspace%/tools/qnx_credential_helper.py test:qemu-integration --config=x86_64-qnx test:qemu-integration --run_under=//scripts:run_under_qemu diff --git a/MODULE.bazel b/MODULE.bazel index 185499f..8ac4f45 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -114,7 +114,7 @@ bazel_dep(name = "bazel_skylib", version = "1.9.0") # ############################################################################### bazel_dep(name = "score_tooling", version = "1.1.2") -bazel_dep(name = "score_bazel_platforms", version = "0.0.3") +bazel_dep(name = "score_bazel_platforms", version = "0.1.2") bazel_dep(name = "platforms", version = "1.0.0") ################################################################################ @@ -177,18 +177,32 @@ http_archive( # Load QNX dependencies # ################################################################################ -bazel_dep(name = "score_toolchains_qnx", version = "0.0.7", dev_dependency = True) - -toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency = True) -toolchains_qnx.sdp( - sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", - strip_prefix = "installation", - url = "https://www.qnx.com/download/download/79858/installation.tgz", +bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.5.0", dev_dependency = True) + +gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True) +gcc.toolchain( + name = "score_qcc_x86_64_toolchain", + sdp_version = "8.0.3", + target_cpu = "x86_64", + target_os = "qnx", + use_default_package = True, + version = "12.2.0", +) +use_repo( + gcc, + "score_qcc_x86_64_toolchain", + "score_qcc_x86_64_toolchain_pkg", ) -use_repo(toolchains_qnx, "toolchains_qnx_sdp") -use_repo(toolchains_qnx, "toolchains_qnx_ifs") -register_toolchains( - "@toolchains_qnx_ifs//:ifs_x86_64", - dev_dependency = True, +bazel_dep(name = "score_rules_imagefs", version = "0.0.3", dev_dependency = True) + +imagefs = use_extension("@score_rules_imagefs//extensions:imagefs.bzl", "imagefs", dev_dependency = True) +imagefs.toolchain( + name = "score_qnx_x86_64_ifs_toolchain", + sdp_to_import = "@score_qcc_x86_64_toolchain_pkg", + sdp_version = "8.0.0", + target_cpu = "x86_64", + target_os = "qnx", + type = "ifs", ) +use_repo(imagefs, "score_qnx_x86_64_ifs_toolchain") diff --git a/examples/.bazelrc b/examples/.bazelrc index ad3d1e1..b532754 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -10,5 +10,8 @@ test --test_output=errors test:qemu-integration --run_under=@score_itf//scripts:run_under_qemu build:x86_64-qnx --incompatible_strict_action_env -build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx8_0 +build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix build:x86_64-qnx --sandbox_writable_path=/var/tmp +build:x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0 +build:x86_64-qnx --extra_toolchains=@score_qnx_x86_64_ifs_toolchain//:ifs-x86_64-qnx-sdp_8.0.0 +build:x86_64-qnx --credential_helper=*.qnx.com=%workspace%/tools/qnx_credential_helper.py diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index f481cf9..4ebbfad 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -104,19 +104,36 @@ bazel_dep(name = "googletest", version = "1.17.0") # Load QNX dependencies # ################################################################################ -bazel_dep(name = "score_toolchains_qnx", version = "0.0.7") -bazel_dep(name = "score_bazel_platforms", version = "0.0.3") - -toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx") -toolchains_qnx.sdp( - sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", - strip_prefix = "installation", - url = "https://www.qnx.com/download/download/79858/installation.tgz", +bazel_dep(name = "score_bazel_platforms", version = "0.1.2") +bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.5.0") + +gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc") +gcc.toolchain( + name = "score_qcc_x86_64_toolchain", + sdp_version = "8.0.3", + target_cpu = "x86_64", + target_os = "qnx", + use_default_package = True, + version = "12.2.0", ) -use_repo(toolchains_qnx, "toolchains_qnx_sdp") -use_repo(toolchains_qnx, "toolchains_qnx_ifs") +use_repo( + gcc, + "score_qcc_x86_64_toolchain", + "score_qcc_x86_64_toolchain_pkg", +) + +bazel_dep(name = "score_rules_imagefs", version = "0.0.3") -register_toolchains("@toolchains_qnx_ifs//:ifs_x86_64") +imagefs = use_extension("@score_rules_imagefs//extensions:imagefs.bzl", "imagefs") +imagefs.toolchain( + name = "score_qnx_x86_64_ifs_toolchain", + sdp_to_import = "@score_qcc_x86_64_toolchain_pkg", + sdp_version = "8.0.0", + target_cpu = "x86_64", + target_os = "qnx", + type = "ifs", +) +use_repo(imagefs, "score_qnx_x86_64_ifs_toolchain") ############################################################################### # diff --git a/score/itf/plugins/qemu/qemu_target.py b/score/itf/plugins/qemu/qemu_target.py index e075151..69874c3 100644 --- a/score/itf/plugins/qemu/qemu_target.py +++ b/score/itf/plugins/qemu/qemu_target.py @@ -89,6 +89,8 @@ def stop(self) -> int: self._logger.error(f"Process with PID [{self._pid}] did not terminate properly, sending SIGKILL.") self._kill() self.wait() + # Allow sshd-session to clean up after SIGKILL (SDP 8.0.3 / OpenSSH 9.9) + time.sleep(1) self._output_thread.join() exit_code = self.get_exit_code() self._close_ssh() diff --git a/test/resources/qnx/BUILD b/test/resources/qnx/BUILD index 888611e..5ff3b96 100644 --- a/test/resources/qnx/BUILD +++ b/test/resources/qnx/BUILD @@ -11,11 +11,14 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@score_toolchains_qnx//rules/fs:ifs.bzl", "qnx_ifs") +load("@score_rules_imagefs//rules/qnx:ifs.bzl", "qnx_ifs") qnx_ifs( name = "init", + srcs = [], build_file = "init.build", + extra_build_files = ["tools.build"], tags = ["manual"], + target_compatible_with = ["@platforms//os:qnx"], visibility = ["//visibility:public"], ) diff --git a/test/resources/qnx/init.build b/test/resources/qnx/init.build index 50f972a..3d4e93e 100644 --- a/test/resources/qnx/init.build +++ b/test/resources/qnx/init.build @@ -17,7 +17,7 @@ [virtual=x86_64,multiboot] boot = { # Configure for x86_64 architecture with multiboot support startup-x86 -v -D8250..115200 -zz # Start x86 kernel with verbose output, serial console at 115200 baud PATH=/proc/boot # Set executable search path to boot directory - LD_LIBRARY_PATH=/proc/boot # Set library search path to boot directory + LD_LIBRARY_PATH=/proc/boot # Set library search path to boot directory [+keeplinked] procnto-smp-instr # Keep process manager linked and instrumented for SMP } @@ -102,376 +102,3 @@ /proc/boot/sshd -f /var/ssh/sshd_config # Start SSH daemon with specified configuration file } - - -############################################# -### SHARED LIBRARIES ### -############################################# -/usr/lib/ldqnx-64.so.2=ldqnx-64.so.2 # 64-bit QNX dynamic linker (loads shared libraries) - -cam-cdrom.so # CAM (Common Access Method) CD-ROM driver -cam-disk.so # CAM disk driver for storage devices -fs-dos.so # DOS file system support -fs-qnx6.so # QNX6 file system support -io-blk.so # Block I/O manager -libbz2.so.1 # BZip2 compression library -libc++.so.2 # C++ standard library -libc.so # C standard library (essential) -libc.so.6 # Main C library (malloc, printf, file I/O, etc.) -libcam.so.2 # CAM library for device access -libcatalog.so.1 # Message catalog support -libcrypto.so.3 # OpenSSL crypto library (disabled) -libexpat.so.2 # Expat XML parser library -libfscrypto.so.1 # File system encryption support -libfsnotify.so.1 # File system notification library -libgcc_s.so.1 # GCC runtime support library -libiconv.so.1 # Character encoding conversion -libjail.so.1 # QNX jail library for process containment -liblzma.so.5 # LZMA compression library -libm.so # Math library -libpam.so.2 # Pluggable Authentication Modules library -libpci.so.3.0 # PCI library v3.0 for hardware access -libqcrypto.so.1.0 # QNX cryptographic library -libqh.so # QNX helper library -libregex.so.1 # Regular expression library -libsecpol.so.1 # Security policy library -libslog2.so.1 # System logging library (slog2_* functions) -libslog2parse.so.1 # System log parsing library -libsocket.so.4 # Socket library (TCP/IP, UDP, network I/O functions) -libssl.so.3 # OpenSSL SSL/TLS library (disabled) -libtracelog.so.1 # Trace logging library -libxml2.so.2 # XML parsing library -libz.so # Zlib compression library -qcrypto-openssl-3.so # QNX cryptographic library with OpenSSL 3 support - -[type=link] libslog2.so=libslog2.so.1 # Create version-neutral symbolic link -[type=link] libsocket.so=libsocket.so.4 # Create version-neutral symbolic link -[type=link] qcrypto-openssl.so=qcrypto-openssl-3.so - - -############################################# -### Tools ### -############################################# -[type=link] /bin/ls=/proc/boot/ls # Link ls to IFS version for compatibility -toybox # Minimal Unix utilities collection (replaces many GNU tools) -[type=link] cp=toybox # Copy files and directories -[type=link] ls=toybox # List directory contents -[type=link] cat=toybox # Display file contents -[type=link] chmod=toybox # Change file permissions -[type=link] rm=toybox # Remove files and directories -[type=link] dd=toybox # Convert and copy files with specified I/O block size -[type=link] echo=toybox # Display text -[type=link] grep=toybox # Search text patterns in files -[type=link] mkdir=toybox # Create directories -[type=link] ascii=toybox # Display ASCII character set -[type=link] base64=toybox # Base64 encoding/decoding utility -[type=link] basename=toybox # Extract filename from path -[type=link] bc=toybox # Basic calculator -[type=link] bunzip2=toybox # Decompress bzip2 files -[type=link] bzcat=toybox # Display contents of bzip2 files -[type=link] cal=toybox # Display calendar -[type=link] chgrp=toybox # Change group ownership -[type=link] chown=toybox # Change file ownership -[type=link] cksum=toybox # Calculate checksums -[type=link] clear=toybox # Clear terminal screen -[type=link] cmp=toybox # Compare files byte by byte -[type=link] comm=toybox # Compare sorted files line by line -[type=link] cpio=toybox # Copy files to/from archives -[type=link] crc32=toybox # Calculate CRC32 checksums -[type=link] cut=toybox # Extract columns from files -[type=link] date=toybox # Display or set system date -[type=link] diff=toybox # Compare files line by line -[type=link] dirname=toybox # Extract directory from path -[type=link] dos2unix=toybox # Convert DOS line endings to Unix -[type=link] du=toybox # Display disk usage -[type=link] egrep=toybox # Extended grep with regular expressions -[type=link] env=toybox # Display or set environment variables -[type=link] expand=toybox # Convert tabs to spaces -[type=link] expr=toybox # Evaluate expressions -[type=link] false=toybox # Return false status -[type=link] fgrep=toybox # Fast grep for fixed strings -[type=link] file=toybox # Determine file type -[type=link] find=toybox # Search for files and directories -[type=link] fmt=toybox # Format text paragraphs -[type=link] groups=toybox # Display user group membership -[type=link] gunzip=toybox # Decompress gzip files -[type=link] gzip=toybox # Compress files with gzip -[type=link] hd=toybox # Hexadecimal dump (alias for hexdump) -[type=link] head=toybox # Display first lines of files -[type=link] hexdump=toybox # Display files in hexadecimal format -[type=link] id=toybox # Display user and group IDs -[type=link] install=toybox # Copy files and set attributes -[type=link] link=toybox # Create hard links -[type=link] logname=toybox # Display login name -[type=link] md5sum=toybox # Calculate MD5 checksums -[type=link] mkfifo=toybox # Create named pipes (FIFOs) -[type=link] mktemp=toybox # Create temporary files/directories -[type=link] more=toybox # Display files page by page -[type=link] mv=toybox # Move/rename files and directories -[type=link] nl=toybox # Number lines in files -[type=link] nohup=toybox # Run commands immune to hangups -[type=link] od=toybox # Dump files in octal format -[type=link] paste=toybox # Merge lines from files -[type=link] patch=toybox # Apply patches to files -[type=link] printenv=toybox # Print environment variables -[type=link] printf=toybox # Format and print data -[type=link] pwd=toybox # Print working directory -[type=link] readlink=toybox # Display target of symbolic links -[type=link] realpath=toybox # Display absolute path -[type=link] rmdir=toybox # Remove empty directories -[type=link] sed=toybox # Stream editor for filtering/transforming text -[type=link] seq=toybox # Generate sequences of numbers -[type=link] sha1sum=toybox # Calculate SHA1 checksums -[type=link] sleep=toybox # Suspend execution for specified time -[type=link] sort=toybox # Sort lines in text files -[type=link] split=toybox # Split files into pieces -[type=link] stat=toybox # Display file/filesystem status -[type=link] strings=toybox # Extract printable strings from files -[type=link] tail=toybox # Display last lines of files -[type=link] tee=toybox # Copy input to files and stdout -[type=link] test=toybox # Evaluate conditional expressions -[type=link] time=toybox # Time command execution -[type=link] timeout=toybox # Run command with time limit -[type=link] touch=toybox # Update file timestamps -[type=link] tr=toybox # Translate or delete characters -[type=link] true=toybox # Return true status -[type=link] truncate=toybox # Truncate files to specified size -[type=link] tty=toybox # Display terminal name -[type=link] uname=toybox # Display system information -[type=link] uniq=toybox # Remove duplicate lines -[type=link] unix2dos=toybox # Convert Unix line endings to DOS -[type=link] unlink=toybox # Remove files (system call interface) -[type=link] uudecode=toybox # Decode uuencoded files -[type=link] uuencode=toybox # Encode files using uuencoding -[type=link] uuidgen=toybox # Generate UUIDs -[type=link] wc=toybox # Count lines, words, and characters -[type=link] which=toybox # Locate commands in PATH -[type=link] whoami=toybox # Display current username -[type=link] xargs=toybox # Execute commands from standard input -[type=link] xxd=toybox # Make hexdump or reverse -[type=link] yes=toybox # Output string repeatedly -[type=link] zcat=toybox # Display contents of compressed files -[type=link] nc=toybox # Netcat for network connections and packet streaming -[type=link] netcat=toybox # Netcat alias for network connections -[type=link] pkill=slay # Process killer Linux compatibility layer - -[type=link] waitfor=on # Create symbolic link: waitfor -> on (waits for resources to become available) -[type=link] ability=on # Create symbolic link: ability -> on (manages process abilities/privileges) -[type=link] /bin/sh=/proc/boot/ksh # Create symbolic link: sh -> ksh (standard shell link) -[type=link] setconf=getconf # Create symbolic link: setconf -> getconf (sets configuration parameters) - -awk # Text processing and pattern scanning -devb-eide # Block device driver for IDE/SATA hard drives and SSDs -devb-ram # RAM disk block device manager -devc-pty # Pseudo-terminal device manager -devc-ser8250 # Serial port driver for 8250/16550 UART controllers (console access) -dhcpcd # DHCP client daemon for automatic network configuration -fsencrypt # File system encryption utility -fsevmgr # File system event manager -getconf # System configuration query utility - retrieves system parameters -hostname # Set or display system hostname -if_up # Network interface configuration -ifconfig # Network interface configuration tool -ksh # Korn shell - provides command-line interface and scripting -ln # Create file links -mkqnx6fs # Create QNX6 file systems -mount # File system mount utility - mounts/unmounts file systems -mount_ifs # Mount Image File System (IFS) -mqueue # POSIX message queue manager -on # Command execution utility - runs commands with specific options -openssl # SSL/TLS cryptographic toolkit -pci-server # PCI bus server -pdebug # Process debugger -pfctl # Packet filter control utility -pidin # Process information display - shows running processes (like 'ps' on Linux) -pipe # Named pipe manager -random # Random number generator service -route # Network routing table management utility -shutdown # System shutdown utility -slay # Process termination utility -slog2info # System log viewer - displays logged messages -slogger2 # System logging daemon - collects and manages log messages -ssh # SSH client for remote connections -ssh-keygen # SSH key generation utility -sshd # SSH daemon for remote access -sync # Synchronize file system buffers to disk -sysctl # Configure kernel parameters at runtime -tar # Archive utility for creating/extracting tar files -tcpdump # Network packet capture tool for Wireshark analysis -umount # Unmount file systems - -/usr/lib/ssh/sftp-server=${QNX_TARGET}/${PROCESSOR}/usr/libexec/sftp-server # File transfer server to enable scp - - -############################################# -### NETWORKING COMPONENTS ### -############################################# -io-sock # Network socket manager -mods-pci.so # PCI module support for network hardware -mods-phy.so # Physical layer module for network interfaces -mods-usb.so # USB module support -libfdt.so.1 # Flattened Device Tree library -libusbdci.so.2 # USB device controller interface library -devs-vtnet_pci.so # VirtIO network device driver for QEMU/KVM -librpc.so.2 # For TCP dump - - -############################################# -### PCI COMPONENTS ### -############################################# -# PCI-related shared libraries and modules -pci/pci_hw-Intel_x86.so # Intel x86 PCI hardware support -pci/pci_slog2.so # PCI system logging support -pci/pci_cap-0x05.so # PCI capability handler for MSI -pci/pci_cap-0x10.so # PCI Express capability handler -pci/pci_cap-0x11.so # MSI-X capability handler -pci/pci_strings.so # PCI device string database -pci/pci_bkwd_compat.so # Backward compatibility support -pci/pci_debug2.so # Enhanced PCI debugging support - - -############################################# -### SYSTEM DIRECTORIES ### -############################################# -# Create SSH and system directories with appropriate permissions -[gid=0 uid=0 dperms=755 type=dir] /var/chroot/sshd # SSH chroot directory for privilege separation -[gid=0 uid=0 dperms=700 type=dir] /var/ssh # SSH configuration and key storage directory - -[perms=0444] pci_server.cfg = { -[buscfg] -DO_BUS_CONFIG=no - -[envars] -PCI_DEBUG_MODULE=pci_debug2.so -PCI_HW_MODULE=pci_hw-Intel_x86.so -PCI_HW_CONFIG_FILE=/proc/boot/pci_hw.cfg -} - -[perms=0444] pci_hw.cfg = { -[interrupts] -B0:D17:F0 A 18 -B0:D17:F0 B 19 -B0:D17:F0 C 16 -B0:D17:F0 D 17 -B3:D0:F0 A 18 -B3:D0:F0 B 19 -B3:D0:F0 C 16 -B3:D0:F0 D 17 -} - -[uid=0 gid=0 perms=0444] qcrypto.conf = { -openssl tags=* -} - -[uid=0 gid=0 perms=0444] /etc/passwd = { -root::0:0:Superuser:/:/bin/sh -qnxuser::1000:1000:QNX User:/:/bin/sh -sshd::15:6:sshd:/:/bin/false -} - -[uid=0 gid=0 perms=0444] /etc/group = { -root::0:root -qnxuser::1000:qnxuser -sshd::6:sshd -} - -[uid=0 gid=0 perms=0444] /etc/profile = { -export TERM=qansi -export PATH=/proc/boot -export LD_LIBRARY_PATH=/proc/boot -export MAGIC=/system/etc/magic -} - -[uid=0 gid=0 perms=0400] /var/ssh/ssh_host_rsa_key = { ------BEGIN OPENSSH PRIVATE KEY----- -b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn -NhAAAAAwEAAQAAAYEArR4LKpPGS2mqmnj+d4Y/0DLdYUVQ7hBaR/aYnNbZFUvO3nOFixa4 -u8pjRQbNFsERvY8o3Q1+SEg/xq+WC4vxhS9bjfMOxO29ncicvcDZR9kVOc/dNCLv6amdOy -9V/wN8rb7vy5KhPKF/uubj/HmcwRYZAYV3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3l6iz/5mhRN8hW0JluJhKtj6ogO6GZERr -PTYwQs+9Q7QI1cPx7G5cEPhWhEd+OmKZuXRjhMQQ+ADj/lnUAhhGQatM9/bohJOdObWCRl -Fu+/MLbJQuA1zpAAAAAAEC ------END OPENSSH PRIVATE KEY----- -} - -[uid=0 gid=0 perms=0444] /var/ssh/sshd_config = { -# Port number for SSH -Port 22 - -# Protocol version -Protocol 2 - -# Host key location -HostKey /var/ssh/ssh_host_rsa_key - -# Enable port forwarding -AllowTcpForwarding yes - -# Enable SCP/SFTP -Subsystem sftp /usr/lib/ssh/sftp-server - -# AUTHENTICATION SETTINGS - Simple passwordless authentication -# Enable password authentication to check for empty passwords -PasswordAuthentication yes - -# Allow empty passwords (no password required) -PermitEmptyPasswords yes - -# Disable all other authentication methods completely -PubkeyAuthentication no -ChallengeResponseAuthentication no -HostbasedAuthentication no - -# Allow root login without authentication -PermitRootLogin yes - -# Allow user environment variables -PermitUserEnvironment yes - -# Don't create PID file -PidFile none - -# Log level for debugging -LogLevel DEBUG - -# Disable strict modes for easier setup -StrictModes no - -# Disable DNS lookups for faster connection -UseDNS no - -# Maximum authentication attempts -MaxAuthTries 3 - -# Disable login grace time -LoginGraceTime 30 -} diff --git a/test/resources/qnx/tools.build b/test/resources/qnx/tools.build new file mode 100644 index 0000000..a690ac8 --- /dev/null +++ b/test/resources/qnx/tools.build @@ -0,0 +1,389 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +############################################# +### SHARED LIBRARIES ### +############################################# +/usr/lib/ldqnx-64.so.2=ldqnx-64.so.2 # 64-bit QNX dynamic linker (loads shared libraries) + +cam-cdrom.so # CAM (Common Access Method) CD-ROM driver +cam-disk.so # CAM disk driver for storage devices +fs-dos.so # DOS file system support +fs-qnx6.so # QNX6 file system support +io-blk.so # Block I/O manager +libbz2.so.1 # BZip2 compression library +libc++.so.2 # C++ standard library +libc.so # C standard library (essential) +libc.so.6 # Main C library (malloc, printf, file I/O, etc.) +libcam.so.2 # CAM library for device access +libcatalog.so.1 # Message catalog support +libcrypto.so.3 # OpenSSL crypto library (disabled) +libexpat.so.2 # Expat XML parser library +libfscrypto.so.1 # File system encryption support +libfsnotify.so.1 # File system notification library +libgcc_s.so.1 # GCC runtime support library +libiconv.so.1 # Character encoding conversion +libjail.so.1 # QNX jail library for process containment +liblzma.so.5 # LZMA compression library +libm.so # Math library +libpam.so.2 # Pluggable Authentication Modules library +libpci.so.3.0 # PCI library v3.0 for hardware access +libqcrypto.so.1.0 # QNX cryptographic library +libqh.so # QNX helper library +libregex.so.1 # Regular expression library +libsecpol.so.1 # Security policy library +libslog2.so.1 # System logging library (slog2_* functions) +libslog2parse.so.1 # System log parsing library +libsocket.so.4 # Socket library (TCP/IP, UDP, network I/O functions) +libssl.so.3 # OpenSSL SSL/TLS library (disabled) +libtracelog.so.1 # Trace logging library +libxml2.so.2 # XML parsing library +libz.so # Zlib compression library +qcrypto-openssl-3.so # QNX cryptographic library with OpenSSL 3 support + +[type=link] libslog2.so=libslog2.so.1 # Create version-neutral symbolic link +[type=link] libsocket.so=libsocket.so.4 # Create version-neutral symbolic link +[type=link] qcrypto-openssl.so=qcrypto-openssl-3.so + + +############################################# +### Tools ### +############################################# +[type=link] /bin/ls=/proc/boot/ls # Link ls to IFS version for compatibility +toybox # Minimal Unix utilities collection (replaces many GNU tools) +[type=link] cp=toybox # Copy files and directories +[type=link] ls=toybox # List directory contents +[type=link] cat=toybox # Display file contents +[type=link] chmod=toybox # Change file permissions +[type=link] rm=toybox # Remove files and directories +[type=link] dd=toybox # Convert and copy files with specified I/O block size +[type=link] echo=toybox # Display text +[type=link] grep=toybox # Search text patterns in files +[type=link] mkdir=toybox # Create directories +[type=link] ascii=toybox # Display ASCII character set +[type=link] base64=toybox # Base64 encoding/decoding utility +[type=link] basename=toybox # Extract filename from path +[type=link] bc=toybox # Basic calculator +[type=link] bunzip2=toybox # Decompress bzip2 files +[type=link] bzcat=toybox # Display contents of bzip2 files +[type=link] cal=toybox # Display calendar +[type=link] chgrp=toybox # Change group ownership +[type=link] chown=toybox # Change file ownership +[type=link] cksum=toybox # Calculate checksums +[type=link] clear=toybox # Clear terminal screen +[type=link] cmp=toybox # Compare files byte by byte +[type=link] comm=toybox # Compare sorted files line by line +[type=link] cpio=toybox # Copy files to/from archives +[type=link] crc32=toybox # Calculate CRC32 checksums +[type=link] cut=toybox # Extract columns from files +[type=link] date=toybox # Display or set system date +[type=link] diff=toybox # Compare files line by line +[type=link] dirname=toybox # Extract directory from path +[type=link] dos2unix=toybox # Convert DOS line endings to Unix +[type=link] du=toybox # Display disk usage +[type=link] egrep=toybox # Extended grep with regular expressions +[type=link] env=toybox # Display or set environment variables +[type=link] expand=toybox # Convert tabs to spaces +[type=link] expr=toybox # Evaluate expressions +[type=link] false=toybox # Return false status +[type=link] fgrep=toybox # Fast grep for fixed strings +[type=link] file=toybox # Determine file type +[type=link] find=toybox # Search for files and directories +[type=link] fmt=toybox # Format text paragraphs +[type=link] groups=toybox # Display user group membership +[type=link] gunzip=toybox # Decompress gzip files +[type=link] gzip=toybox # Compress files with gzip +[type=link] hd=toybox # Hexadecimal dump (alias for hexdump) +[type=link] head=toybox # Display first lines of files +[type=link] hexdump=toybox # Display files in hexadecimal format +[type=link] id=toybox # Display user and group IDs +[type=link] install=toybox # Copy files and set attributes +[type=link] link=toybox # Create hard links +[type=link] logname=toybox # Display login name +[type=link] md5sum=toybox # Calculate MD5 checksums +[type=link] mkfifo=toybox # Create named pipes (FIFOs) +[type=link] mktemp=toybox # Create temporary files/directories +[type=link] more=toybox # Display files page by page +[type=link] mv=toybox # Move/rename files and directories +[type=link] nl=toybox # Number lines in files +[type=link] nohup=toybox # Run commands immune to hangups +[type=link] od=toybox # Dump files in octal format +[type=link] paste=toybox # Merge lines from files +[type=link] patch=toybox # Apply patches to files +[type=link] printenv=toybox # Print environment variables +[type=link] printf=toybox # Format and print data +[type=link] pwd=toybox # Print working directory +[type=link] readlink=toybox # Display target of symbolic links +[type=link] realpath=toybox # Display absolute path +[type=link] rmdir=toybox # Remove empty directories +[type=link] sed=toybox # Stream editor for filtering/transforming text +[type=link] seq=toybox # Generate sequences of numbers +[type=link] sha1sum=toybox # Calculate SHA1 checksums +[type=link] sleep=toybox # Suspend execution for specified time +[type=link] sort=toybox # Sort lines in text files +[type=link] split=toybox # Split files into pieces +[type=link] stat=toybox # Display file/filesystem status +[type=link] strings=toybox # Extract printable strings from files +[type=link] tail=toybox # Display last lines of files +[type=link] tee=toybox # Copy input to files and stdout +[type=link] test=toybox # Evaluate conditional expressions +[type=link] time=toybox # Time command execution +[type=link] timeout=toybox # Run command with time limit +[type=link] touch=toybox # Update file timestamps +[type=link] tr=toybox # Translate or delete characters +[type=link] true=toybox # Return true status +[type=link] truncate=toybox # Truncate files to specified size +[type=link] tty=toybox # Display terminal name +[type=link] uname=toybox # Display system information +[type=link] uniq=toybox # Remove duplicate lines +[type=link] unix2dos=toybox # Convert Unix line endings to DOS +[type=link] unlink=toybox # Remove files (system call interface) +[type=link] uudecode=toybox # Decode uuencoded files +[type=link] uuencode=toybox # Encode files using uuencoding +[type=link] uuidgen=toybox # Generate UUIDs +[type=link] wc=toybox # Count lines, words, and characters +[type=link] which=toybox # Locate commands in PATH +[type=link] whoami=toybox # Display current username +[type=link] xargs=toybox # Execute commands from standard input +[type=link] xxd=toybox # Make hexdump or reverse +[type=link] yes=toybox # Output string repeatedly +[type=link] zcat=toybox # Display contents of compressed files +[type=link] nc=toybox # Netcat for network connections and packet streaming +[type=link] netcat=toybox # Netcat alias for network connections +[type=link] pkill=slay # Process killer Linux compatibility layer + +[type=link] waitfor=on # Create symbolic link: waitfor -> on (waits for resources to become available) +[type=link] ability=on # Create symbolic link: ability -> on (manages process abilities/privileges) +[type=link] /bin/sh=/proc/boot/ksh # Create symbolic link: sh -> ksh (standard shell link) +[type=link] setconf=getconf # Create symbolic link: setconf -> getconf (sets configuration parameters) + +awk # Text processing and pattern scanning +devb-eide # Block device driver for IDE/SATA hard drives and SSDs +devb-ram # RAM disk block device manager +devc-pty # Pseudo-terminal device manager +devc-ser8250 # Serial port driver for 8250/16550 UART controllers (console access) +dhcpcd # DHCP client daemon for automatic network configuration +fsencrypt # File system encryption utility +fsevmgr # File system event manager +getconf # System configuration query utility - retrieves system parameters +hostname # Set or display system hostname +if_up # Network interface configuration +ifconfig # Network interface configuration tool +ksh # Korn shell - provides command-line interface and scripting +ln # Create file links +mkqnx6fs # Create QNX6 file systems +mount # File system mount utility - mounts/unmounts file systems +mount_ifs # Mount Image File System (IFS) +mqueue # POSIX message queue manager +on # Command execution utility - runs commands with specific options +openssl # SSL/TLS cryptographic toolkit +pci-server # PCI bus server +pdebug # Process debugger +pfctl # Packet filter control utility +pidin # Process information display - shows running processes (like 'ps' on Linux) +pipe # Named pipe manager +random # Random number generator service +route # Network routing table management utility +shutdown # System shutdown utility +slay # Process termination utility +slog2info # System log viewer - displays logged messages +slogger2 # System logging daemon - collects and manages log messages +ssh # SSH client for remote connections +ssh-keygen # SSH key generation utility +sshd # SSH daemon for remote access +/usr/libexec/sshd-session=${QNX_TARGET}/${PROCESSOR}/usr/libexec/sshd-session # SSH session handler (required by sshd) +sync # Synchronize file system buffers to disk +sysctl # Configure kernel parameters at runtime +tar # Archive utility for creating/extracting tar files +tcpdump # Network packet capture tool for Wireshark analysis +umount # Unmount file systems + +/usr/lib/ssh/sftp-server=${QNX_TARGET}/${PROCESSOR}/usr/libexec/sftp-server # File transfer server to enable scp + + +############################################# +### NETWORKING COMPONENTS ### +############################################# +io-sock # Network socket manager +mods-pci.so # PCI module support for network hardware +mods-phy.so # Physical layer module for network interfaces +mods-usb.so # USB module support +libfdt.so.1 # Flattened Device Tree library +libusbdci.so.2 # USB device controller interface library +devs-vtnet_pci.so # VirtIO network device driver for QEMU/KVM +librpc.so.2 # For TCP dump + + +############################################# +### PCI COMPONENTS ### +############################################# +# PCI-related shared libraries and modules +pci/pci_hw-Intel_x86.so # Intel x86 PCI hardware support +pci/pci_slog2.so # PCI system logging support +pci/pci_cap-0x05.so # PCI capability handler for MSI +pci/pci_cap-0x10.so # PCI Express capability handler +pci/pci_cap-0x11.so # MSI-X capability handler +pci/pci_strings.so # PCI device string database +pci/pci_bkwd_compat.so # Backward compatibility support +pci/pci_debug2.so # Enhanced PCI debugging support + + +############################################# +### SYSTEM DIRECTORIES ### +############################################# +# Create SSH and system directories with appropriate permissions +[gid=0 uid=0 dperms=755 type=dir] /var/chroot/sshd # SSH chroot directory for privilege separation +[gid=0 uid=0 dperms=700 type=dir] /var/ssh # SSH configuration and key storage directory + +[perms=0444] pci_server.cfg = { +[buscfg] +DO_BUS_CONFIG=no + +[envars] +PCI_DEBUG_MODULE=pci_debug2.so +PCI_HW_MODULE=pci_hw-Intel_x86.so +PCI_HW_CONFIG_FILE=/proc/boot/pci_hw.cfg +} + +[perms=0444] pci_hw.cfg = { +[interrupts] +B0:D17:F0 A 18 +B0:D17:F0 B 19 +B0:D17:F0 C 16 +B0:D17:F0 D 17 +B3:D0:F0 A 18 +B3:D0:F0 B 19 +B3:D0:F0 C 16 +B3:D0:F0 D 17 +} + +[uid=0 gid=0 perms=0444] qcrypto.conf = { +openssl tags=* +} + +[uid=0 gid=0 perms=0444] /etc/passwd = { +root::0:0:Superuser:/:/bin/sh +qnxuser::1000:1000:QNX User:/:/bin/sh +sshd::15:6:sshd:/:/bin/false +} + +[uid=0 gid=0 perms=0444] /etc/group = { +root::0:root +qnxuser::1000:qnxuser +sshd::6:sshd +} + +[uid=0 gid=0 perms=0444] /etc/profile = { +export TERM=qansi +export PATH=/proc/boot +export LD_LIBRARY_PATH=/proc/boot +export MAGIC=/system/etc/magic +} + +[uid=0 gid=0 perms=0400] /var/ssh/ssh_host_rsa_key = { +-----B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Dhj50L3djf++/HkahtZJlTkpSbt +/ukoZKI1m8MgpyC3xk2UDu1yWNizT2l1L7RnE+ZO4b5U9cONANiYBD8jcnZAvh4ld3ojo0 +iNXEVEGAKIodMUsgASxGwmoxuX3ugJIwAAAMEAwLp7eVBjg27eflRNYuW8akfDyq9zB1rp +YGo3GbPytb14WVJuyNL1tJ/B/rdFBg0IXf1FQJEL99kKJP5yDxjOx9kyXBhIWjm8arz39h +uw0wrsuRl2rrCfMABGS51GohtYmKETZ6x7/2n3l6iz/5mhRN8hW0JluJhKtj6ogO6GZERr +PTYwQs+9Q7QI1cPx7G5cEPhWhEd+OmKZuXRjhMQQ+ADj/lnUAhhGQatM9/bohJOdObWCRl +Fu+/MLbJQuA1zpAAAAAAEC +-----END OPENSSH PRIVATE KEY----- +} + +[uid=0 gid=0 perms=0444] /var/ssh/sshd_config = { +# Port number for SSH +Port 22 + +# Protocol version +Protocol 2 + +# Host key location +HostKey /var/ssh/ssh_host_rsa_key + +# Enable port forwarding +AllowTcpForwarding yes + +# Enable SCP/SFTP +Subsystem sftp /usr/lib/ssh/sftp-server + +# AUTHENTICATION SETTINGS - Simple passwordless authentication +# Enable password authentication to check for empty passwords +PasswordAuthentication yes + +# Allow empty passwords (no password required) +PermitEmptyPasswords yes + +# Disable all other authentication methods completely +PubkeyAuthentication no +ChallengeResponseAuthentication no +HostbasedAuthentication no + +# Allow root login without authentication +PermitRootLogin yes + +# Allow user environment variables +PermitUserEnvironment yes + +# Don't create PID file +PidFile none + +# Log level for debugging +LogLevel DEBUG + +# Disable strict modes for easier setup +StrictModes no + +# Disable DNS lookups for faster connection +UseDNS no + +# Maximum authentication attempts +MaxAuthTries 3 + +# Increase concurrent unauthenticated connections to handle +# bursts on slow QEMU-emulated targets (default 10:30:100) +MaxStartups 50:30:100 + +# Disable login grace time +LoginGraceTime 30 +}