AI-Now Linux — Engineering Journal
Date: 2026-11-25 (California local time)
Day: 02 — Genesis / Bootstrap
Organization: AI-Now Technology, Inc.
Host: Baihu
Baseline: Linux From Scratch 13.1-systemd
Checkpoint: Chapters 4–7 build stages complete; basic temporary-package acceptance complete. Official cleanup, backup and independent boot remain pending.
1. Objective
Construct a native userspace build environment from the cross toolchain, understand the purpose of every component, and establish a safe, repeatable transition into chroot. The goal is a source-built Linux distribution, not simply an installation of an existing distribution. Today’s stopping point is before Chapter 8.
2. Build environment and cross toolchain
Continued with the 80 GiB sparse raw image created on Day 01. The physical workstation disks are not installation targets. Created the merged-/usr hierarchy, temporary tools directory, and dedicated lfs account (UID/GID 1001). The build environment used LFS=/mnt/lfs, LFS_TGT=x86_64-lfs-linux-gnu, LC_ALL=POSIX, a controlled PATH, umask 022, disabled Bash command hashing and MAKEFLAGS=-j8. The login initialization was customized to avoid changing the host-wide Bash startup file. Parallel build times are elapsed times, not official single-job SBU measurements.
| Component | Version | Purpose |
|---|---|---|
| Binutils pass 1 | 2.47 | Assembler, linker and ELF inspection tools for the target |
| GCC pass 1 | 16.2.0 | Initial C/C++ cross compiler |
| GMP | 6.3.0 | Arbitrary precision integers for GCC |
| MPFR | 4.2.2 | Correctly rounded binary floating point |
| MPC | 1.4.1 | Multiprecision complex arithmetic |
| Linux UAPI headers | 7.1.8 | Userspace/kernel ABI declarations, not a running kernel |
| Glibc | 2.44 | C runtime, system-call wrappers, dynamic loader and startup objects |
| Libstdc++ | 16.2.0 | Target C++ standard library |
The compiler converts C/C++ into assembly; the assembler produces relocatable ELF objects; the linker resolves symbols and produces executables. The GCC mathematical dependencies support compiler computations such as constant folding. Linux headers expose interfaces for devices, networking, KVM, GPIO, I2C, SPI and other subsystems; they do not install drivers. Glibc supplies the loader and CRT startup objects. The initial target executable printed Hello, AI-Now Linux using the target loader. This was not an independent OS boot.
Reported elapsed build times: Binutils pass 1 32.586 s; GCC pass 1 6m 9.727s; Glibc 1m 47.719s; Libstdc++ 17.350s. These figures are retained from the session record; not every original log was re-audited for this journal.
3. Chapter 6 — Temporary tools
| Component | Version | Purpose |
|---|---|---|
| M4 | 1.4.21 | Macro expansion and generated build/parser code |
| Ncurses | 6.6 | Terminal capabilities and text UI |
| Bash | 5.3 | Shell and build-script execution |
| Coreutils | 9.11 | Basic filesystem and process utilities |
| Diffutils | 3.12 | Comparing source and generating differences |
| File | 5.48 | File type identification by magic signatures |
| Findutils | 4.11.0 | File traversal and argument construction |
| Gawk | 5.4.1 | Structured text processing |
| Grep | 3.12 | Pattern matching |
| Gzip | 1.14 | DEFLATE compression |
| Make | 4.4.1 | Dependency graph and timestamp-based builds |
| Patch | 2.8 | Applying source modifications |
| Sed | 4.10 | Stream editing |
| Tar | 1.35 | Filesystem archives and metadata |
| XZ | 5.8.3 | LZMA2 compression and liblzma |
| Binutils pass 2 | 2.47 | Native target assembler and linker |
| GCC pass 2 | 16.2.0 | Native target C/C++ compiler |
Ncurses required a host-side tic during cross compilation. File required a host-side magic database generator. The second compiler and binutils passes establish the native target toolchain. The temporary tools are build infrastructure, not the final production package set.
A runtime test initially mixed host and target libraries by exporting LD_LIBRARY_PATH while launching target Bash. Child processes could use the host loader and incompatible Glibc private symbols. Removed that environment override and used explicit target-loader tests, then verified native execution inside chroot. Lesson: do not globally mix two libc environments.
4. Host incident and recovery
During preparation for chroot, the workstation desktop froze. SSH from Neris-A remained available. Diagnostics showed PID 1 was still systemd, but its runtime directory was obscured by a second tmpfs mount over host /run. systemctl could not contact the system bus. Memory snapshots did not demonstrate active swap pressure as the immediate cause.
The likely cause was a mount command using an unset or incorrect $LFS in a privileged shell. The exact offending command was not conclusively established. The assistant had supplied insufficiently guarded mount instructions before completing preflight. This is a safety failure to record, not a normal build step.
A normal reboot could not contact systemd. Recovery used an emergency sync, SysRq read-only remount and reboot. This was an incident-specific last resort, not a routine shutdown procedure. No forced or lazy unmount of host /run was attempted. After reboot, systemd reported zero failed units and the original /run was restored.
The image was initially reattached read-only using a dynamically allocated loop device. Verified the exact backing file and partition UUID before running e2fsck -fn. All five filesystem checks passed, exit status 0. This establishes filesystem structural consistency, not complete file-content integrity. Reattached read-write after verifying the mapping and UUID. The new loop device was /dev/loop25, with root partition /dev/loop25p2; loop numbers are not persistent identifiers.
- Root filesystem label:
AINOW-ROOT. - Root filesystem UUID:
cf7b7e99-cf6b-470d-9fe1-87b9742e72af. - Image logical size: 80 GiB; observed allocated size after recovery approximately 14 GiB.
- Filesystem check: 238724/5242880 files; 3089458/20970496 blocks.
- Host free space after recovery approximately 250 GiB.
GCC pass 2 build/install logs ended normally, but original exit codes were not captured. Target GCC and G++ reported 16.2.0, and native compilation later succeeded. Basic executable inventory and target loader checks passed.
5. Safety engineering and Git history
Added a preflight script to validate the fixed image path, real mountpoint, exact loop backing file, filesystem UUID, ext4 read-write state, absence of unexpected child mounts and required executables. Added a guarded ownership-transfer script to change target build directories from lfs to root without recursively changing unrelated host paths. Verified no active lfs processes before transfer.
The chroot entry script uses a private mount namespace (unshare --mount --propagation private), validates paths and mounts, tracks virtual filesystems, and releases them in reverse order. The host namespace was observed as 4026531832 and the private namespace as 4026533067. These numbers are observations, not constants for future scripts. A clean exit and concurrent host checks succeeded; the script was committed and pushed before re-entry.
| Commit | Recorded purpose |
|---|---|
b77e7b5 |
Chroot preflight validation |
d1f2a51 |
Guarded ownership transfer |
cdcdcb2 |
Validated private namespace chroot environment |
The private mount namespace limits mount propagation; chroot is not a security sandbox. The host kernel, device access and other kernel resources remain shared. Pending improvements: set target /run tmpfs mode explicitly to 0755; ensure cleanup failure propagates as an error; verify no remaining mounts before backup. Never operate on physical disks from this environment merely because the shell prompt says chroot.
6. Chapter 7 — Native environment
Created the directory hierarchy, root home (0750), temporary directories (1777), account/group databases, tester account (UID/GID 101), /etc/mtab symlink to /proc/self/mounts, and login accounting files. /etc/hosts uses ai-now rather than expanding the shared host hostname; permanent hostname configuration remains pending. /var/log/btmp is mode 0600; lastlog is group utmp, mode 0664.
Native C and C++ programs compiled and executed successfully. ELF inspection showed x86-64 PIE executables with interpreter /lib64/ld-linux-x86-64.so.2. Initially ldd searched /usr/lib64 while the target loader was under /lib64; corrected its RTLDLIST with sed -i '/^RTLDLIST=/s@/usr@@g' /usr/bin/ldd. Native C and C++ dependency inspection then succeeded. The running kernel remained Baihu’s Ubuntu 7.0.0-44-generic kernel, not the downloaded Linux 7.1.8 source.
7. Chapter 7 — Temporary packages and acceptance
| Package | Version | Build elapsed | Basic acceptance |
|---|---|---|---|
| Gettext | 1.0 | 89.651 s | PASS |
| Bison | 3.8.2 | 2.265 s | PASS |
| Perl | 5.44.0 | 29.640 s | PASS |
| Zlib | 1.3.2 | 0.789 s | PASS |
| MPDecimal | 4.0.1 | 2.210 s | PASS |
| Python | 3.14.7 | 26.737 s | PASS |
| Texinfo | 7.3 | 6.519 s | PASS |
| Util-linux | 2.42.2 | 10.974 s | PASS |
All eight temporary packages are installed and basic project acceptance is complete. These are not full upstream test-suite results. Gettext and Bison build logs were rechecked at journal preparation. Official Chapter 7 package recipes were obtained from the pinned 13.1-systemd pages on Baihu; the local HTML copies belong in docs/reference/.
Gettext
Configured with --disable-shared, built and copied only msgfmt, msgmerge, xgettext into /usr/bin, as prescribed for the temporary stage. Build exit 0. All three reported version 1.0. Compiled a UTF-8 PO translation catalog into a GNU MO catalog containing two messages. This validates catalog generation, not interactive Chinese locale rendering. The full package comes later.
Bison
Configured with --prefix=/usr --docdir=/usr/share/doc/bison-3.8.2. Build/install exit 0. Bison and yacc reported 3.8.2. The first custom test failed because genesis.y did not exist in the working directory. Recreated the grammar under /tmp, generated C source with bison -d genesis.y, compiled with native GCC and verified input AI produced AI-Now Linux Parser Online. with exit 0; input AB produced syntax error with exit 1. Removed the extracted source directory. This demonstrates grammar-to-parser-to-native-executable integration, including rejection of invalid input.
Perl
Built shared libperl with core/site/vendor module paths under /usr/lib/perl5/5.44. Build/install exit 0. Version, regex, POSIX uname and dynamic linking passed. The vendor path was configured but not necessarily populated. Perl is retained for compatibility and build dependencies, rather than selected as the primary language for new project applications. Texinfo later demonstrated successful XS extension compilation and embedded Perl support.
Zlib
Configured --prefix=/usr, built and installed, removed /usr/lib/libz.a as directed. Native C compression round-trip passed: 66 original bytes, 34 compressed, 66 restored. Shared library libz.so.1.3.2 installed with linker and SONAME symlinks. Python later linked its zlib extension to this library.
MPDecimal
Configured --prefix=/usr --disable-static --docdir=/usr/share/doc/mpdecimal-4.0.1. Native C test used a 50-digit decimal context and verified 0.1 + 0.2 = 0.3 exactly. Installed C and C++ shared libraries. C++ runtime was not independently tested. Unlike binary floating point, decimal arithmetic represents decimal fractions directly within the chosen precision; arbitrary precision does not mean infinite precision. GCC’s 128-bit integer type is not evidence of 128-bit general-purpose CPU registers.
Python
Configured --prefix=/usr --enable-shared --without-ensurepip --without-static-libpython. Build and install exit 0. Initially attempted runtime before installation; corrected by running make install. Python 3.14.7 uses shared libpython3.14.so.1.0 (34 MiB observed). Compression, LZMA, decimal arithmetic and module imports passed. The initial socket test had an assistant-authored error: a tuple returned by socketpair() was used as a context manager. Corrected to a, b = socket.socketpair(); with a, b: and verified transfer of Genesis with exit 0. This is same-process socket-pair communication, not a cross-process agent test.
Final extension linking:
| Extension | Target library |
|---|---|
| zlib | /usr/lib/libz.so.1 |
| _decimal | /usr/lib/libmpdec.so.4 |
| _lzma | /usr/lib/liblzma.so.5 |
The temporary build lacked several optional modules including SSL, ctypes, bz2, readline and sqlite support. No attempt was made to install dependencies out of order. Curses import passed; interactive TUI operation was not tested. Extracted Python source removed after final acceptance.
Texinfo
Configured --prefix=/usr. Build/install exit 0. makeinfo, texi2any, info, install-info reported 7.3. info linked against target ncurses and Glibc. Generated a 296-byte genesis.info from genesis.texi containing the project motto. Perl XS and embedded Perl checks passed. Missing locales, libunistring and an optimization-related fortify warning did not prevent this build. Full documentation suite and interactive reader were not tested. Extracted source removed.
Util-linux
Created /var/lib/hwclock; used the pinned official configure options:
./configure --libdir=/usr/lib --runstatedir=/run \
--disable-chfn-chsh --disable-login --disable-nologin \
--disable-su --disable-setpriv --disable-runuser \
--disable-pylibmount --disable-static --disable-liblastlog2 \
--without-python ADJTIME_PATH=/var/lib/hwclock/adjtime \
--docdir=/usr/share/doc/util-linux-2.42.2
Build/install exit 0. Ten CLI version checks passed: mount, umount, findmnt, lsblk, blkid, fdisk, losetup, unshare, lscpu, uuidgen. Installed shared libblkid, libmount, libuuid, libfdisk and libsmartcols. Dynamic linking of mount and lsblk resolved target libraries. Read-only mount queries showed /dev/loop25p2 as ext4 root and tmpfs at /run. Native lscpu detected Intel i9-11950H, 8 cores, 16 threads, VT-x, 24 MiB L3. It also reported Gather Data Sampling vulnerability on the host; investigate host microcode/kernel mitigation separately. No actual disk partitioning or mount changes were performed during acceptance.
Native C libuuid integration generated a random UUID, serialized it, parsed it back and compared binary values; exit 0. Missing PAM, crypt, systemd, udev, readline and documentation-generation dependencies are expected limitations of this stage; sulogin and some other tools were not built. The install log set mount/umount setuid root and wall setgid tty; review permissions during final system hardening. Extracted source removed.
8. Architecture and research discussions
These are design directions discussed today, not implemented features or committed release promises.
Kernel and low-level engineering
The project is also a route back to kernel engineering. Complete the LFS reference system first, then explore Linux modules, character devices, ioctl, GPIO interrupts, I2C/SPI, device tree, USB, DMA, PCIe, FPGA interfaces, networking and DRM/KMS. A separate experimental kernel could progress from boot and serial output through GDT/IDT, interrupts, physical memory, paging, scheduler, syscalls, VFS, shell and SMP. Whether to build an original kernel or extend Linux remains open. C and x86-64 assembly, QEMU, GDB and Vim form the proposed research environment.
Discussed the analogy between DOS launching Windows and Linux launching a window manager. Windows 3.x was more than a window manager; modern Linux may use a standalone X11 window manager or Wayland compositor. CLI/TUI remains the initial interface; a custom AI shell or compositor is a later possibility.
AI-native distribution
One shared core with profiles: personal, enterprise, embedded, ai-appliance. Preserve the intended command interface ./build.sh --profile <profile>. Build engine and profiles are not yet implemented. AI should be a system-level capability with terminal, voice, vision and API interfaces; local/remote models; agent lifecycle, memory, diagnostics and hardware management. Proposed ai-now CLI commands cover status, hardware, models, agents, memory and updates. Use least privilege, explicit approvals for destructive operations and auditable actions. C/C++ for native components, Python for agents and automation, Bash for bootstrap, Perl for legacy/build compatibility; Rust may be explored later.
Neris-A as personal agent workstation, Neris-D as compute node, and AION as embedded edge device are potential deployments. No existing device has been migrated to this distribution. Build-time dependencies must be distinguished from runtime dependencies; embedded images may omit development tools after dependency validation.
Network installer and cluster
Discussed a USB network installer with hardware discovery, network setup, profile selection and a declarative configuration (for example neris-a.yaml). Source, binary and hybrid installation modes are options; signed artifacts, explicit target-disk confirmation, compatibility checks and rollback are required design considerations.
A future cluster workflow might expose ai-now cluster init/discover/join/status/deploy, with mDNS discovery, authenticated enrollment, WireGuard or mTLS, container runtimes, K3s/Ray/MPI/Slurm and monitoring as candidate technologies. GPU memory is not automatically pooled by connecting machines. Distributed inference requires explicit model partitioning or RPC support. An additional cluster profile is a proposal, not an approved fifth profile.
Bootable business card
Prioritize a bootable USB business card as a tangible demonstration after the reference system boots. Proposed BIOS/UEFI menu: live system, installation, system information and existing OS boot. A live image could use SquashFS/OverlayFS, terminal, Vim, Python and an AI agent with local/remote/online modes. Do not embed company API secrets or assume a large local model fits. The proposed embedded business-card build target and sub-1-GiB compressed size are aspirations, not measured results.
Physical PCB concept: approximately 85.6 x 54 mm, OLED (rather than LCD), SSD1306 128×64 display with 1 KiB monochrome framebuffer, MCU such as ESP32-S3 or RP2040, USB-C power/data, mass storage and buttons. Candidate screens: contact, QR, Linux, AI agent and system status. Independent storage and MCU functions may require a USB hub. A host-driven display and an on-card Linux SoC are distinct architectures; no final selection or schematic has been made. No battery is proposed for the first prototype. Black PCB, ice-blue OLED and gold traces were aesthetic suggestions only.
Industrial and academic direction
PetaLinux, FPGA/SoC integration and embedded AI remain commercial priorities. Discussed PREEMPT_RT versus hard real-time requirements, and a Zynq UltraScale+ architecture with Linux on A53, FreeRTOS on R5F and OpenAMP/RPMsg communication to separate general-purpose and deterministic tasks. Real-time behavior must be measured, not assumed. The proposed progression is LFS, drivers, PREEMPT_RT, PetaLinux, FreeRTOS/OpenAMP, and kernel research.
Cross-layer engineering across hardware, OS, drivers and AI is a potentially useful industrial differentiator, but rarity does not guarantee contracts. Revenue-generating consulting, freelance work, NVIDIA hardware deployment and PetaLinux take priority over open-ended research. Suggested time allocations were discussion only, not an agreed schedule.
Possible MSCE research topic: Design and Implementation of a Modular AI-Native Linux Distribution for Heterogeneous Computing Systems. A credible thesis needs an original research question, baselines, measurable outcomes, reproducible experiments and appropriate academic supervision. Building LFS alone is not a research contribution.
9. End-of-day status and next session
- All eight Chapter 7 temporary packages installed and basic acceptance complete, including final Python and Bison retests.
- No independent kernel boot, final system packages, production security validation or full upstream test suites yet.
- Official Chapter 7 cleanup instructions must be retrieved and reviewed before deleting
/toolsor other bootstrap files. - Exit chroot using the validated wrapper, check cleanup and host health. Preserve build logs before official temporary-file cleanup if desired.
- Verify image mapping and available disk space; create a consistent Bootstrap Checkpoint 001 backup only after safe shutdown of the build environment and appropriate unmounting. No backup has been created today as of this journal.
- Resume Chapter 8 after the checkpoint. Restore the host
/bin/shalias only when the build no longer requires the temporary change. - Commit this journal and reviewed reference files; do not commit raw disk images, build logs, secrets or generated binaries.
10. Evidence and limitations
This journal combines the session’s engineering record, user-provided terminal outputs and design discussions. Gettext and Bison log tails were directly rechecked; Texinfo and Util-linux complete pasted logs and the final Python/Bison retest outputs support the latest acceptance. Earlier stages are summarized from the session record, not a fresh audit of every source file or official recipe. The exact cause of the host mount incident remains inferred. The journal does not claim a backup, new Git commit, push, final cleanup or independent boot that has not occurred.
One Core. Multiple Profiles. Built from Source.
11. Evening engineering addendum — 2026-11-25
This addendum supersedes the status statements in sections 9 and 10 as of the evening checkpoint. Earlier entries are retained as historical records. Results below are drawn from the session’s reported terminal outputs and engineering notes, not a new independent audit of every build log.
11.1 Bootstrap completion and checkpoint 001
Chapter 7 cleanup completed: removed temporary documentation, libtool archives and /tools. Native C and C++ smoke tests passed with GCC 16.2.0. The target remained a generic x86-64 system with a Glibc Linux ABI baseline of 5.10.
After exiting chroot and releasing its virtual filesystem mounts, verified the host was healthy and the target root filesystem remained mounted at /mnt/lfs on /dev/loop25p2. Created a root-filesystem archive at ~/Backups/ai-now-linux/ai-now-linux-genesis-bootstrap-001.tar.xz using GNU tar with numeric ownership, ACLs, extended attributes, one-filesystem traversal and XZ compression (-T4 -3). Archive creation took 4m31.658s; archive size approximately 2.4 GiB. XZ integrity, tar listing and SHA-256 verification passed; manifest contained 248,588 entries. This is a root-filesystem backup, not a full disk image. Restore testing and an independent off-disk copy remain outstanding.
Commit 1d6db78: Complete bootstrap cleanup and verify checkpoint 001.
11.2 Chapter 8 final system progress
Pinned reference: LFS 13.1-systemd. Fifteen of eighty packages installed and functionally accepted (18.75%), with documented test exceptions. No independent kernel boot yet. Build timings are observed wall-clock times in seconds, not controlled performance benchmarks.
| Package | Version | Build / test / installation evidence |
|---|---|---|
| Man-pages | 6.18 | Installation 2.211s; 3,096 files/symlinks; nine sample existence checks passed. Rendering deferred. |
| Iana-Etc | 20260805 | Network database installation and six lookup checks passed. |
| Glibc | 2.44 | Build 97.973s; test 987.042s; final install 8.264s; 6,835 PASS, 523 UNSUPPORTED, 16 XFAIL, one FAIL (io/tst-lchmod, accepted documented chroot exception). |
| Zlib | 1.3.2 | Build 0.797s; check 0.011s; install 0.053s; standard, 64-bit and shared checks passed. |
| Bzip2 | 1.0.8 | Shared build 1.069s; standard build 0.858s; six comparison checks passed; install 0.044s. |
| XZ | 5.8.3 | Build 2.712s; check 2.262s, 19/19 PASS; install 1.422s. |
| LZ4 | 1.10.0 | Build 9.975s; original check 1.629s; install 0.093s; corrected full check 1.729s. |
| Zstd | 1.5.7 | Build 14.441s; initial check 21.914s; install 0.382s; corrected environment recheck 12.110s. |
| File | 5.48 | Configure 4.601s; build 1.386s; test 1.336s; install 0.196s. |
| Readline | 8.3 | Configure 4.226s; build 1.043s; install 0.086s; native C integration passed. |
| PCRE2 | 10.47 | Configure 2.846s; build 9.748s; check 4.159s, four test groups passed; install 0.198s. |
| M4 | 1.4.21 | Configure 28.549s; build 2.229s; check 13.569s; install 0.337s; 334 PASS, 48 SKIP, zero failures. |
| Bc | 7.0.3 | Configure 0.396s; build 1.170s; test 0.641s; install 5.484s; enabled bc/dc tests passed. |
| Flex | 2.6.4 | Configure 3.527s; build 2.242s; check 5.157s; install 0.314s; 114/114 PASS. |
| Tcl | 8.6.18 | Configure 4.632s; build 50.000s; test 221.028s; install 1.266s; 47,159 tests, 43,704 passed, 3,455 skipped, zero failed. Additional headers/docs installed separately. |
11.3 Foundation and native integration
Man-pages supplies system-call and library API documentation. Installed after removing conflicting crypt manual pages. The installation log was subsequently preserved.
Iana-Etc supplies service and protocol names, not network daemons. The evening audit confirmed root:root ownership and mode 0644 on both files, 11,554 lines in /etc/services (563,048 bytes) and 141 in /etc/protocols (7,818 bytes). Python socket lookups passed for SSH 22, HTTP 80, HTTPS 443, ICMP 1, TCP 6 and UDP 17. SHA-256 values:
- services:
e3ff5102f6f951856093782232dfdeaece8b2a0c159e2d355a4702f585147d09 - protocols:
8d31b82c96953daba953cd000426816b4de1055b92025e3c1386e21597ca4be0
Glibc provides the userspace ABI, dynamic loader, threading, locale, name-service and other standard C interfaces. Used staged installation and loader smoke tests before final installation; corrected GCC limits.h and ldd loader paths. Native pthread, C++ std::thread, Python threading, locale, account and service lookups passed. Six UTF-8 locales tested: en_US, zh_TW, zh_CN, ja_JP, ko_KR, el_GR. Installed tzdata 2026c and selected America/Los_Angeles. The 888 locale names are not 888 distinct languages. External DNS and systemd NSS modules were not tested. The chroot lchmod exception does not establish that every Glibc operation is correct on a booted target.
11.4 Compression and file identification
Compression libraries are shared infrastructure for archives, package distribution, logs and future AI appliances. The repeated 21,000-byte synthetic input is highly compressible and must not be treated as representative of model weights or production data.
| Codec | Compressed bytes | Integration evidence |
|---|---|---|
| Zlib | 103 | Python runtime 1.3.2, round trip and CRC32 0x27de773 |
| Bzip2 | 108 | CLI round trip; temporary Python lacks _bz2 |
| XZ -9 | 156 | CLI/Python cross-round-trip; Python preset 9 produced 148 bytes |
| LZ4 -1/-9 | 133 | Both levels round trip; native C 21-byte input to 23 bytes |
| Zstd 1/3/19 | 42 | All three round trips; native C 21-byte input to 30 bytes |
Shared-library SONAMEs and symlinks checked during package acceptance; unwanted static archives removed where prescribed. LZ4 CLI links libc rather than the installed shared liblz4; Zstd CLI does not dynamically link the installed libzstd. Native C tests separately exercise the installed libraries.
Zstd test warning traced to an unset ZSTD_LIB_EXCLUDE_COMPRESSORS_DFAST_AND_UP used in a numeric shell comparison. Re-ran make check with that variable explicitly set to 0. Optimal parser compressed-size tests executed, warning disappeared, and tests completed successfully. No production source patch or reinstall. Large-data tests remain skipped. Observed level 3 versus level 9 benchmark on 196,611 bytes: compressed size 63,213 versus 60,963 bytes, compression speed 261.5 versus 41.8 MB/s. Level 3 is a candidate default, not an approved product policy.
File/libmagic: seven sample formats (ASCII, zlib, gzip, bzip2, XZ, LZ4, Zstd) passed identification checks; native C libmagic identified /usr/bin/bash as an x86-64 ELF PIE. MIME values were printed rather than asserted. Landlock runtime behavior not tested.
11.5 Development tools and language infrastructure
Readline: native C integration exercised line input and history insertion with three entries, using Vi mode configuration. Actual interactive Vi editing, history recall and completion were not tested. Shared readline/history libraries installed; readline had no RPATH/RUNPATH in the inspected binary metadata.
PCRE2: enabled Unicode, JIT, 16/32-bit APIs, compressed-file grep and Readline integration. Unicode script matching and compressed log searching passed. Corrected the native JIT sample to use strlen(subject) instead of PCRE2_ZERO_TERMINATED for subject length. JIT matched ERROR503 and extracted code 503. Regex resource limits and JIT/interpreter differences matter for untrusted inputs.
M4: macro expansion supports Autoconf and future declarative build configuration. Corrected a project demonstration’s malformed multi-branch ifelse by repeating PROFILE comparisons. Final regression passed personal=8, enterprise=16, embedded=2, ai-appliance=8 and integer arithmetic. These are illustrative job counts, not implemented build profiles. Default/unknown-profile behavior not separately tested.
Bc: arbitrary-precision arithmetic avoids binary floating-point representation issues for decimal calculations. -G disables generated tests, not an arithmetic feature; -O3 selects optimization and -r enables Readline. Eight integration checks passed, including exact 2^256, decimal 0.1+0.2, 100-digit 1/7, a pi prefix, dc reverse Polish notation and RC cutoff calculation (159.15494309189533594430 Hz). Interactive Readline behavior deferred.
Flex: generated a native lexer for an illustrative AI command language. Tested agent/model/cluster/system commands, numbers, longest-match behavior and invalid input; separate shared libfl runtime test passed. Eight integration checks passed. This is a lexer demonstration, not an implemented agent command system. Makefile suffix-rule warnings and stdbool configure observation retained in logs.
Tcl: installed with --disable-rpath, relocated configuration paths, installed private headers and HTML documentation, retained the stub library for extension ABI support. Tcl integration checked arithmetic, large integers, dictionaries, Unicode, subprocess execution, architecture, version and threaded-build flag; embedded C Tcl interpreter returned 14. Nine integration checks passed. Actual thread creation and post-install configuration path/RPATH audit remain outstanding. Tcl enables Expect, which in turn supports DejaGNU and compiler/toolchain testing; Tcl also has relevance to FPGA and EDA automation.
11.6 GENESIS-BUG-001 — LZ4 dictionary test defect
Original make -j1 check returned success, but logs showed malformed datagen arguments such as -g2393558l, usage output and zero-byte dictionaries. A successful exit status alone was insufficient evidence of valid boundary testing.
Root cause confirmed in tests/test-lz4-dict.sh, lines 42–45: $$l is appropriate for escaping a dollar sign in a Makefile recipe, but in a standalone shell script it expands to the shell PID followed by literal l. Demonstration: $l and ${l} yielded 65536, whereas $$l yielded 227869l. The historical origin of the escaping mistake was not independently established.
Preserved original script and replaced only $$l with ${l} on the four affected lines. Shell syntax validation passed. Verified datagen output length for all sixteen sizes: 0, 1, 4, 128, 32767, 32768, 32769, 65535, 65536, 65537, 98303, 98304, 98305, 131071, 131072, 131073 bytes. Targeted dictionary regression passed in 0.639s. Corrected full make -j1 check passed in 1.729s, dictionary loading section executed, and malformed PID-based arguments were absent. The tests compare decompression using full dictionaries and their last 64 KiB; zero-length input is valid. A separate supplemental dictionary round trip used a 65,536-byte deterministic dictionary and 131,072-byte input, compressed to 542 bytes excluding dictionary storage.
No production library modification or reinstall. Original script pipelines were not hardened with independent exit-status checks; upstream fix/report status remains unknown. Ten evidence files (3.7 MiB reported) preserved in /sources/build-logs/lz4-1.10.0/; extracted source directory (3.5 MiB reported) removed after verification.
Repository patch: patches/lz4/lz4-1.10.0-dictionary-test-fix.patch
SHA-256: afc3ff79cb61261e46ca8d78486c6615e3e5c9a8d2993046cb7f521862fdd69e
Commit feb3597: Fix LZ4 1.10.0 dictionary test shell expansion. The patch is locally maintained and is not an official LFS patch. Future builds must explicitly apply it; automated patch application has not been implemented.
11.7 Reconciliation and infrastructure
Preserved available package records under /sources/build-logs/, including Zstd, M4, Bc, Flex, Tcl, LZ4 and Man-pages. Saved fifteen Chapter 7 build/install logs separately in chapter07-bootstrap/; Gettext install log was unavailable. The Iana-Etc audit is a new installation-state verification, not a recovered historical install log. Earlier toolchain source trees remain pending audit/cleanup. Logs stored inside the target are not independent backups.
The chroot wrapper originally mounted /run without an explicit mode, resulting in inappropriate tmpfs root permissions. The active chroot had already been corrected manually. Updated scripts/enter-chroot.sh to use -o nosuid,nodev,mode=0755 "$LFS/run", retaining mode 1777 for shared memory. An initial typo node=0755 passed shell syntax checking but was detected in the diff and corrected with Vim. Accidental execution of diff lines at the host prompt failed with command-not-found; no mount operation was observed. Exact option check, shell syntax and git diff checks passed. Runtime verification of the revised wrapper remains pending. Do not manipulate the host /run; preserve private mount namespace and target identity guards.
Commit 3a60dd6: Fix chroot runtime directory permissions.
Commit b28471c: Preserve LFS chapter 08 build references (15 HTML files, 4,784 inserted lines). All three evening commits pushed successfully; HEAD and origin/main matched at b28471c and working tree was clean before this addendum.
11.8 Architecture, product and research continuation
The earlier architecture discussion remains applicable. Additional discussion identified EeePC 1005P as a candidate first physical x86 deployment after QEMU boot validation, with terminal-first operation and remote AI inference. Hardware instruction-set compatibility, memory requirements, Wi-Fi/audio and voice runtime compatibility must be verified before deployment; no physical disk overwrite or migration has occurred. Proposed target interface: ./build.sh --profile embedded --target eeepc-1005p.
The shared core could support personal AI workstations, embedded AION devices, enterprise compute, FPGA/industrial systems and a bootable business card. A research profile was discussed as an additional possibility, not approved. Reproducible academic experiments would need pinned dependencies, model/data versions, hardware descriptions, seeds and measurable baselines. Business value depends on reliable delivery, security maintenance, licensing and support, not merely having a custom distribution. Prioritize revenue-generating work alongside the reference-system milestone.
Proposed package lifecycle for the future build engine: source verification, configuration, compilation, test suite, installation, integration testing, engineering-record preservation, source cleanup, then acceptance. Record test exceptions explicitly and validate test infrastructure itself. This state machine is a design proposal, not implemented software.
11.9 Evening checkpoint and next session
- Chapter 7 complete; bootstrap checkpoint 001 archive verified but not restore-tested.
- Chapter 8: 15/80 packages installed and functionally accepted with documented exceptions (18.75%).
- LZ4 regression and cleanup complete; local patch committed and pushed.
- Pending: actual
/runpermissions after wrapper reentry; Tcl installed configuration path/RPATH audit; Zstd large-data tests; LZ4 upstream status and pipeline hardening; missing Gettext historical install log; older toolchain records and source cleanup; independent backup and restore test. - Next package: Expect 5.45.4 (section 8.18), then DejaGNU. Retrieve and review the pinned recipe before building.
- Final system, kernel, bootloader, QEMU boot and physical EeePC deployment remain future milestones. Restore host
/bin/shonly after it is no longer required by the build. - This addendum is prepared for append and review; its own commit and push are not yet claimed.
One Core. Multiple Profiles. Built from Source.