
Recall first from Testing and the final deliverable
- SensorNode readiness is measured at the first valid report at the destination specified in the project brief.
- An automatic rollback is demonstrated by observing a failed trial boot followed by recovery on the previously confirmed slot.
- End-to-end elapsed timings help distinguish CPU work from time spent waiting for I/O or scheduling.
Connect the four building blocks
3 min readThe project is built; now you step back and consolidate everything it used. This lesson answers how the toolchain, bootloader, kernel and rootfs interconnect, and walks the boot chain once more while demonstrating each capability.
A program can be present on the target filesystem and still fail with a file-not-found error when it starts. For a dynamically linked ELF executable, Linux also needs the interpreter recorded in the executable. If that interpreter is missing, execve can return ENOENT. That real failure connects three pieces of the system at once: the toolchain recorded an interpreter path, the root filesystem must supply it, and the kernel tries to open it when it starts the program. execve(2): execute a program
The toolchain runs on the Ubuntu build host. Its compiler and linker produce code for the target CPU and ABI. The build system coordinates those tools with the project configuration, kernel configuration, board files and package recipes. For the application, inspect a copy of the executable installed in the image. The following commands assume that copy is named sensornode in the current directory.
readelf -h ./sensornode
readelf -l ./sensornode
readelf -d ./sensornode
Read the ELF class and machine in the header, the requested interpreter in the program headers if one is present, and the declared shared-library dependencies in the dynamic section if there is one. Compare the interpreter and libraries with the target filesystem. The host commands inspect the file without executing it. The build configuration tells you which toolchain was selected, while the ELF file lets you check properties of what it produced.
The bootloader turns reset into a Linux entry point. Its board configuration gets the hardware ready enough to read boot artifacts. Its boot configuration determines which kernel and device tree to load, where to get an initramfs if one is used, and what arguments Linux receives. The bootloader configuration and the deployed storage layout have to agree. In an A/B system, that agreement includes which images and root filesystem belong to the selected slot.
The kernel uses the device tree and its driver configuration together. For an I2C sensor supported by an Industrial I/O driver, the device tree describes the device on its bus, the kernel driver binds to it, and the driver can expose measurement channels through IIO. A device tree node can exist even when the required driver is absent or probing fails. Conversely, a driver included in the build needs the device to be described or enumerated appropriately before it can bind. Industrial I/O core
The root filesystem supplies PID 1, the SensorNode program, any required runtime libraries and the configuration that starts the program. It also determines which tools are available for checking the running system. If the init system starts SensorNode automatically, a manual launch from a shell and an automatic launch after reset are two distinct observations. The automatic launch also tests whether startup configuration, permissions and device availability work together.
Follow one boot from reset to a reading
3 min readUse a BeagleBone Black configured for a conventional U-Boot boot as the concrete example. Follow the serial capture from reset and read the runtime state after startup. The early-stage names depend on the board. On this BeagleBone Black path, the ROM loads U-Boot SPL, and SPL loads full U-Boot. The Linux handoff then follows the 32-bit Arm boot protocol. Booting ARM Linux
Reset and ROM. The processor begins in the SoC boot ROM. The ROM follows the configured boot order and loads SPL from a supported source. If the first visible line comes from SPL, reaching SPL is evidence that the ROM transferred control. The capture may contain no messages from the ROM itself.
SPL and full U-Boot. SPL brings up the memory needed for the next stage and loads full U-Boot. Full U-Boot follows its configured boot policy, selects and loads the kernel and board device tree, and loads an initramfs if configured. It supplies the boot arguments and transfers control to Linux. A U-Boot prompt proves that U-Boot is running. Kernel messages provide separate evidence that Linux started.
Linux and the initial root. Linux initializes its subsystems and drivers as configured. On a direct boot to persistent storage, Linux needs to make the root device accessible and mount the selected root filesystem before it can start init there. With an initramfs containing
/init, Linux unpacks the archive into its initial root and runs/initas PID 1. A minimal BusyBox system can stay there. An initramfs that prepares a persistent root can switch to it and execute the final init, retaining PID 1 across that execution.PID 1 and the application. The final startup configuration starts SensorNode. The program opens its configured measurement interface, reads the sensor and produces the reading defined by the project. The first valid reading is the completion point for this walkthrough. A shell prompt confirms that user space is running, while a valid reading also exercises the application and its device path.
On the running target, use these commands if the image includes the utilities and has procfs mounted. /proc/cmdline shows what Linux received. /proc/1/comm shows PID 1's process name. /proc/self/mountinfo shows mounts as seen by the reading process. Find entries whose mount point is / and read the filesystem type and source after the separator. If an overlay is in use, use the project's slot records as well when identifying the underlying image.
cat /proc/cmdline
cat /proc/1/comm
cat /proc/self/mountinfo
Compare the requested root with the running mount state. A root= argument records a boot request. An initramfs can make a later root selection, so the mount record provides evidence of the result. This distinction also matters when an update changes the slot. Ramfs, rootfs and initramfs
Demonstrate the project capabilities with evidence
3 min readUse the final image and the records from the build and tests that produced it. For each capability, make a claim that the evidence can support. A serial capture, an ELF inspection and an application reading answer different questions, even when they all come from the same build.
Build and deploy. Show the project configuration and identify the boot artifacts, kernel image, DTB and root filesystem image that it produced or selected. Relate those outputs to the layout actually booted. Show the application ELF inspection alongside its installation in the root filesystem. If you used both Buildroot and Yocto during the module, use each system's own artifacts when showing its build. The minimal QEMU image gives a separate demonstration: boot it to the BusyBox shell and run the cross-built hello program from that image. That run verifies the emulated kernel and user-space path. Use the board capture for physical boot and sensor evidence.
Bring up the sensor and start the service. Match the enabled sensor node in the deployed device tree to the driver and the device visible on the running system. For an IIO sensor, the device directories and channel attributes under /sys/bus/iio/devices/ provide kernel-side evidence when the driver exposes them there. Show the project reading from an automatic start after reset. Where the sensor permits a controlled change, show that the reported value responds consistently to it. This ties the application's chosen input to the physical device. If the device is visible but the application cannot read it, check the service's configured path and permissions before deciding which component to debug.
Measure and diagnose startup. Use the same start event and readiness event for the baseline and final build. For example, measure from reset to the first valid sample when both events are timed from the same recording or measurement setup. Compare the recorded results and identify where the observed interval changed. For a failure, identify the last event you can confirm and the first expected event you cannot see. A kernel that prints messages but cannot mount its root directs attention to the selected device, filesystem support and any early user-space setup. A working root with a missing reading directs attention to the driver, service and application evidence.
Verify updates and security. For the project's A/B setup, show which slot was active before the update, which slot the updater installed to, and which version and slot actually ran after reboot. Tie the successful boot to the configured health confirmation. Show the recorded rollback case separately and identify the slot and version that ran after recovery. For the integrity check, show the recorded rejection of an invalid artifact at the component configured to reject it. An updater rejecting a package demonstrates package verification. A bootloader rejecting a boot image demonstrates verification at boot. Each claim should identify the component and artifact actually tested.
As a final review, choose one milestone and explain what it establishes and which observation you would need to confirm the next milestone. The next lesson, The tools checkpoint and presenting the project, asks which tools support each claim and how to present the project so a reviewer can follow the evidence.
Key takeaways
- The cross toolchain runs on the build host and produces binaries for the target.
- The bootloader starts Linux with a device tree and boot arguments, and Linux starts the first user-space process.
- A sensor reading depends on both the running kernel's hardware support and the application installed in the root filesystem.
- A working application demonstrates the current boot path, while update, rollback and integrity checks require their own evidence.
Reflect
- Explain to a colleague, in two sentences: map the four building blocks to the artifacts and settings used by SensorNode.
- Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
- What surprised you when you ran the commands yourself?
On a real board
Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.
References and further reading
- Kernel documentationBooting ARM Linux
- Kernel documentationRamfs, rootfs and initramfs
- Man pageexecve(2): execute a program
- Kernel documentationIndustrial I/O core
Official documentation first. Links checked when the lesson was published.