Category: Linux

Yocto Training: Essential Build Packages

build-essential is a metapackage on Debian and Ubuntu that installs the basic tools for compiling software. It typically pulls in:

  • gcc and g++ — C and C++ compilers
  • make — runs build instructions
  • libc6-dev — C library headers and development files
  • dpkg-dev — tools for building Debian packages

chrpath is a small Linux utility for inspecting and changing the RPATH/RUNPATH stored in an ELF executable or shared library. These paths tell the dynamic linker where to look for required shared libraries.

It’s commonly used during packaging to remove or adjust build-time library paths before distributing a program. Use it carefully: changing the path incorrectly can prevent the program from finding its libraries.

chrpath -l ./program # show its RPATH/RUNPATH
chrpath -d ./program # remove it
chrpath -r ‘$ORIGIN/lib’ ./program # set a relative path

cpio is both a command-line utility and a package that provides it. It creates and extracts archive files, often used for backups, packaging, and moving files while preserving metadata.

You may see it in Linux system workflows—for example, in initramfs images used during boot, or in software package archives. It’s similar in purpose to tar, though the archive formats differ.

Create an archive from files under mydir

find mydir -print | cpio -o -v -H newc > mydir.cpio

Extract it into the current directory

cpio -i -v < mydir.cpio

-o creates an archive, -i extracts one, -v lists files as they’re processed, and -H newc selects the commonly used newc archive format.

Linux Kernel 6.18.8 Released: Notable Fixes Across Memory, Networking, Wi-Fi, Audio, and More

Linux kernel 6.18.8 is out as a stable update, with a broad set of fixes spanning memory management, networking, device drivers, audio, platform/DT, virtualization-related paths, and more. This kind of stable release is mainly about correctness and reliability: squashing crashes, tightening edge cases, and fixing regressions.

Source

Full upstream changelog (canonical): (cdn.kernel.org)


Highlights in Linux 6.18.8

1) Memory management: VMA merge and mremap corner cases

A key set of patches addresses anon_vma and VMA merge behavior involving mremap() with faulted/unfaulted neighbors, including fixes for potential use-after-free scenarios and ensuring fork-related constraints are enforced properly. (cdn.kernel.org)


2) Networking: crash fixes and driver correctness

Several changes focus on preventing null dereferences and improving robustness:

  • Traffic control / act_ife: avoids a possible NULL dereference by ensuring encoding helpers don’t return NULL unexpectedly. (cdn.kernel.org)
  • Various net paths: additional fixes land in drivers and protocols (including addressing error conditions that could lead to crashes). (cdn.kernel.org)

3) Wi-Fi drivers: DMA pointer handling fixes

Multiple Wi-Fi drivers receive fixes involving DMA coherent memory free paths (common sources of subtle memory corruption if mishandled), including ath12k and ath10k updates. (cdn.kernel.org)


4) Audio (ALSA): memory safety and device quirks

Audio-related fixes include:

  • A use-after-free fix in USB mixer cleanup paths. (cdn.kernel.org)
  • A buffer overflow fix in scarlett2 configuration retrieval logic. (cdn.kernel.org)
  • Additional codec/quirk adjustments for specific hardware. (cdn.kernel.org)

5) Platform / Device Tree fixes

There are also platform-focused updates, including Device Tree adjustments (example: Rockchip/NanoPi-related fixes affecting audio clocking/widgets). (cdn.kernel.org)


6) Core kernel behavior: less noisy warnings

One small but practical improvement: the kernel avoids emitting a deprecation warning on reads of panic_print (so commands like sysctl -a don’t generate spurious noise), warning only when users actually try to set it. (cdn.kernel.org)


Should you upgrade?

If you’re running a 6.18.x kernel line, stable releases like 6.18.8 are generally worth taking—especially if you:

  • run newer laptops/desktops with a lot of device-driver surface area (Wi-Fi, audio, input),
  • rely on virtualization/networking features,
  • or care about fewer hard-to-diagnose crashes and memory hazards.

As always, follow your distro/vendor guidance for kernel updates (and test in staging first if you run production fleets).


Source (again)

Linux 6.18.8 changelog: (cdn.kernel.org)

Next-Generation Firewall (NGFW) with Layer 7 Filtering in Embedded Systems

A Next-Generation Firewall (NGFW) extends beyond traditional packet filtering (Layer 3/4) by providing application-level (Layer 7) visibility and control. In embedded systems — such as IoT gateways, industrial controllers, or edge servers — integrating NGFW capabilities presents unique challenges due to limited CPU, memory, and power. Layer 7 filtering inspects the application data payload, not just IP/port.
It can:

1. What Layer 7 Filtering Means

Enforce policy based on app, user, or content type — e.g. “block social media APIs” or “allow only JSON over HTTPS from whitelisted domains.”

Identify protocols like HTTP, MQTT, CoAP, Modbus, OPC-UA, etc.

Detect specific application actions (e.g., login, file upload, API calls).

2. NGFW Core Components for Embedded Systems

To achieve this in a constrained environment, the NGFW must include:

ComponentPurposeLightweight Options
Deep Packet Inspection (DPI) EngineParses protocol layers, identifies appsnDPI, L7-filter, Suricata-lite
Stateful Packet Inspection (SPI)Tracks connection statesNetfilter conntrack (Linux)
Application IdentificationUses pattern matching and heuristicsnDPI, AppID library
Content Filtering / IDSDetects malicious payloadsSnort ruleset subset, Suricata rules
Policy EngineEnforces rules per app/user/deviceCustom rule parser or iptables/nftables extensions
TLS/SSL Inspection (optional)For HTTPS visibilityOpenSSL proxy or embedded MITM TLS proxy


3. Example Embedded Software Stack

A realistic embedded NGFW architecture could look like this:

┌───────────────────────────┐
│ Management UI / CLI │
├───────────────────────────┤
│ Policy & Rule Engine │
├───────────────────────────┤
│ AppID + DPI Engine │
│ (nDPI / custom) │
├───────────────────────────┤
│ SPI / Connection Table │
│ (conntrack) │
├───────────────────────────┤
│ Packet I/O (DPDK/eBPF) │
├───────────────────────────┤
│ Network Drivers / NIC │
└───────────────────────────┘

On Linux-based embedded platforms, this stack could run on:

  • OpenWRT / Yocto Linux
  • ARM-based SoCs (Cortex-A53, NXP Layerscape, NVIDIA Jetson, etc.)
  • DPDK or XDP/eBPF for high-performance packet processing


4. Optimization Techniques
To make NGFW features viable in embedded devices:

Maintain a protocol whitelist to minimize parsing workload

Use zero-copy packet paths (DPDK or AF_XDP)

Offload flow classification to smart NICs (like NVIDIA BlueField)

Implement hardware-assisted encryption (AES-NI, ARM Crypto Extensions)

Employ incremental DPI (scan only first few packets per flow)

5. Example Open Source Projects to Build On

FrameworkUse CaseNotes
nDPILightweight DPI engineC library, used by ntopng
SuricataIDS/IPS with Layer 7 supportCan be trimmed for embedded use
Zeek (Bro)Application traffic analysisToo heavy for small systems, ok for edge
OpenWRT + nftablesBase platform for embedded firewallExtensible with Lua/C modules

6. Example Use Cases

  • Industrial IoT gateway blocking unknown MQTT brokers
  • Edge compute node enforcing API access policies
  • 5G small-cell or MEC node filtering HTTP/REST telemetry
  • Smart camera gateway isolating unauthorized cloud uploads

How to solve this Dependencies apt –fix-broken install with raspberry pi OS.

Raspberry pi is based on Debian distribution. This article may assist apt repository upgrade failures. When ever there is a broken install, you can use the below command.

apt –fix-broken install
Whatever library it depends on use the below command to resolve it.

dpkg –force-all –configure -a
dpkg –purge –force-depends <library package name>
apt –fix-broken install
apt-get -f install

 

Source: debian – How to solve this Dependencies apt –fix-broken install – Super User

Raspberry Pi – Unable to do apt upgrade 404 error

While using older images of raspberry pi, the upgrade fails with the repository 404 not found.
The reason is the older images repository is moved to legacy.raspbian.org.
I ran into this same issue but didn’t want to go through the work of upgrading versions,
so simply updated the mirror link in my sources.list from mirrordirector.raspbian.org to
legacy.raspbian.org

sources.list
deb http://legacy.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then ‘apt-get update’ to enable ‘apt-get source’
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free

Source: linux – Debian apt-get update 404 not found error – Super User