Day 03 — The Birth of Genesis

AI-Now Linux — Engineering Journal

Date: 2026-11-26 (Thanksgiving, PST)
Day: 03 — The Birth of Genesis
Organization: AI-Now Technology, Inc.
Host: Baihu
Baseline: LFS 13.1-systemd
Milestone: Independent QEMU/KVM boot and complete disk checkpoint.

1. Objective

Finish the native userspace, configure the operating system, build the kernel and boot independently of the host. Preserve the result before developing the company’s hybrid package infrastructure. The engineering objective is ownership of the software stack, not a general-purpose public distribution.

2. Native userspace and engineering acceptance

The session record reports completion of Chapter 8 (80/80 package records, 303 installed-artifact hash entries, zero final audit issues). The final native toolchain includes GCC 16.2.0, Binutils 2.47, Glibc 2.44, Python 3.14.7, Bash 5.3, systemd 261.2 and GRUB 2.14. Build batches covered language tools, compression, cryptography, filesystem utilities, networking, documentation and service management.

Acceptance is not equivalent to a clean upstream regression suite. The session recorded conditional acceptance for GCC (remaining unexpected failures and XPASS), targeted network retries for Python and util-linux, and known or environment-dependent failures in several other suites. Ncurses was tested through native C/C++ integration; interactive terminal behavior was deferred. The final manifest audit checks installed artifacts, not every possible runtime behavior.

The engineering workflow separates source verification, configuration, compilation, regression testing, installation, integration and evidence retention. Build workspaces were archived before cleanup to preserve diagnostic evidence. The reported root filesystem usage fell from 22 GiB to 5.8 GiB; sparse raw allocation does not automatically shrink when files are deleted.

3. Checkpoints and configuration

The session reports a bootstrap checkpoint (001) and final userspace checkpoint (002), both root filesystem archives. Checkpoint 002 was approximately 1.8 GiB. Unlike checkpoint 003, these archives do not preserve the partition table or bootloader. The reported final-userspace documentation commit is 996983a; batch scripts and reference documents were also committed earlier. These earlier results are summarized from the engineering session rather than independently re-audited here.

Chapter 9 configured the Genesis identity, locale, timezone, ext4 root filesystem, systemd-networkd and systemd-resolved, and multi-user.target. The hostname is genesis. DNS service startup was later observed, but external DNS and HTTPS access were not demonstrated by the boot transcript.

4. Kernel and bootloader

Linux 7.1.8 was configured using a version-controlled fragment approach rather than relying on interactive menuconfig. The intended architecture is a common baseline plus hardware-specific configuration fragments. Built-in ext4, GPT and VirtIO storage support allow the QEMU root filesystem to mount without an external initramfs.

The installed kernel release is 7.1.8-ainow-genesis. The boot directory contained a 15 MiB kernel image, 9 MiB System.map and 147 KiB configuration. The boot log identifies GCC 16.2.0 and GNU Binutils 2.47.20260726 as the kernel build tools.

The first bootloader preflight returned an empty lsblk PARTTYPE field. Direct probing with blkid -p confirmed GPT and the BIOS Boot Partition type GUID 21686148-6449-6e6f-744e-656564454649. This is a metadata discovery issue, not evidence of a missing partition. The guarded installation targeted the whole loop device backing the project image, never a physical disk. GRUB 2.14 reported successful i386-pc installation. The earlier attempt to write grub.cfg before the directory existed failed; the successful sequence installed GRUB first, then wrote and checked the configuration.

GRUB searches by filesystem UUID; the kernel receives root=PARTUUID because no external initramfs is used. Normal and serial-debug entries were configured. The chroot exited, virtual mounts were released, and the image was unmounted and detached before QEMU opened it.

5. Independent boot — observed results

QEMU/KVM ran with host CPU passthrough, four vCPUs, 4096 MiB RAM, VirtIO storage/network and legacy BIOS. The kernel mounted ext4 and executed /sbin/init at approximately 0.862 seconds in the kernel log (not total boot time). systemd identified KVM and x86-64, reached multi-user.target and presented the Genesis login prompt.

Acceptance item Observed result
GRUB and native kernel PASS
Root filesystem mount PASS
PID 1 systemd /sbin/init
Login PASS after one incorrect attempt
Failed systemd units 0
DHCP and default route PASS
Gateway ICMP 3/3, zero packet loss
Native GCC compilation and execution Hello, Genesis!
Python execution Hello, Genesis Python!
Shutdown Clean poweroff, root remounted read-only

Warnings included missing wireless regulatory.db, unsupported virtual CPU performance/power-management features and a clocksource watchdog timeout. No soundcard was detected in the VM. These did not prevent the demonstrated boot, but wireless, audio, physical hardware, external DNS, SSH and older CPU compatibility remain unverified.

6. Checkpoint 003 — complete bootable disk

After shutdown, the image was checked for active loop mappings and open handles. The full 80 GiB raw image (36.8 GiB allocated) was compressed using xz -T8 -3 into a temporary archive, tested, compared by decompressed SHA256 against the original and renamed only after successful verification. The archive was restricted to mode 0600.

Metric Result
Archive ai-now-linux-genesis-bootable-003.raw.xz
Compressed size 5,312.6 MiB (5.2 GiB)
Compression time 8m39.474s
XZ integrity test PASS, 46.426s
Archive SHA256 verification PASS
Original/decompressed SHA256 Identical
Completion 12:37:42 PST

Original and decompressed raw SHA256:

2f743e5a18482adf10e5d1a889774737eba323568aefb6b89dba0597f2b93feb

This preserves GPT, BIOS boot code, filesystem and userspace. An independent restored-image boot and off-host backup are still pending. Do not publish the raw image: it may contain account credentials and machine-specific state.

7. Distribution engineering decisions

AI-Now Linux is a company engineering platform. Support only the hardware actually used by the company. Separate hardware targets (CPU, drivers, firmware, kernel configuration) from software profiles (engineering, AI, embedded and desktop).

The package manager must support compiling from source and installing prebuilt binaries. A source build should stage and package files before installation, so both paths share one installation engine and database. Git repositories hold recipes, source references and patches; release assets can distribute binaries without bloating Git history. Upload, download and install are distinct operations. Authentication, signed metadata, dependency handling, safe archive extraction, configuration preservation and ABI compatibility must be designed explicitly.

Proposed implementation: Python CLI and curses menu, Bash recipes, TOML metadata, SQLite database and tar.zst archives with a provisional .ainpkg extension. These are design proposals, not implemented capabilities. OpenSSH is the first package acceptance target; host keys must be generated per installation and private keys must never be bundled.

8. Next milestone — EeePC

Build the minimal package infrastructure and OpenSSH first. Then inventory the EeePC 1005P, check userspace CPU instruction compatibility, build a dedicated kernel and boot from separate removable storage without overwriting the existing Yocto installation. Test network, SSH, keyboard, storage, audio, Unicode console and package installation. Measure idle memory and boot time. Develop the formal ISO/installer and graphics stack after gaining physical deployment experience.

9. Status at close

Genesis v0.1 is independently bootable in QEMU/KVM and checkpoint 003 is byte-verified. Package manager, Git distribution workflow, physical deployment, GUI and hardware-specific kernels remain future work. This journal is a retrospective based on session records; the final boot and archive figures were checked against the supplied terminal transcript. Earlier package-level results are not a new independent audit.

10. Chapter 11 — Hybrid source/binary package manager

This entry follows the Genesis checkpoint retrospective above. The repository had the package design in the README and Day 03 journal; no committed prototype was present at baseline c0e99f7. Implementation follows the existing Python/Bash/TOML/SQLite and tar.zst design.

  • The native source builder exports a reviewed Git recipe to a temporary workspace, validates the upstream SHA256, builds without elevated privileges and packages its isolated DESTDIR. Both source output and downloaded binaries enter the same install path. The manifest records the recipe commit and the architecture, glibc and CPU baseline labels.
  • ainpkg preflights archive, filesystem and ownership conflicts. SQLite records packages, file digests and modes. A target lock serializes operations. An undo table records file contents and modes across interruptions. Locally modified configuration survives upgrades and removal. Direct-to-root make install was avoided because it would bypass package ownership and recovery.
  • GitHub releases supply binary transport through gh, with separate upload and download commands and a trusted SHA256 check before accepting a download. The CLI upload preserves existing release assets. The first test run exposed incorrect positional argument handling in the fake gh program. The stub was corrected and the full suite passed.
  • The first recipe pins OpenSSH Portable 10.6p2 to the SHA256 in the upstream release notes. The x86-64 recipe uses the upstream install-without-keys target, clears the setuid bit on ssh-keysign and includes the upstream license.
Verification Actual result
Python 3.12.14 automated tests 13 passed, including malformed payloads, link rejection, ownership collisions, competing installs, configuration preservation, rollback and interrupted-transaction recovery
Bash syntax and Git whitespace checks Passed
Source input and Git recipe Built from the pinned Git recipe and SHA256-verified source. Cached local input and HTTPS retrieval both succeeded
Reproducibility Two OpenSSH builds on the same x86-64/glibc 2.41 host from the same recipe revision produced byte-identical packages. Recipe Git subtree 38b4c32a862f590392b81525b5af952e81bc4d8d. Local package SHA256 8592011a85943c3fe2ca32a7237cb99bdabca83ca070e53b90d6dd48868fa484
OpenSSH package lifecycle Installed and verified in a disposable root. ssh -V and sshd -V reported OpenSSH 10.6p2 with OpenSSL 3.5.9. No host keys were staged. Reinstallation and removal preserved the edited sshd_config
Compatibility gate The host-built glibc 2.41 package was rejected by a disposable root labeled glibc 2.44
Binary release workflow Automated tests used a stub gh and exercised success, checksum failure and existing-output protection. Live GitHub asset transfer remains unverified

Testing used temporary directories. No physical disks or Genesis RAW image were modified. The source package and build logs remained outside Git. The Chapter 11 branch is based on c0e99f7. Its commit records the implementation, test suite and this journal together for review.

The next checkpoint is a native Genesis build in a disposable Genesis environment, followed by runtime library validation, per-target key provisioning and an SSH connection test. Remaining package work includes dependencies, signed metadata, service activation, full upstream OpenSSH regression testing and power-cut validation. For the ASUS EeePC 1005P, inventory the CPU and storage/network controllers, validate the userland ISA against the hardware, and use a dedicated kernel for external-media boot.

Package inspection and transaction preview

Follow-up on the Chapter 11 branch added ainpkg inspect, read-only previews for installation and removal, and unchanged-file reuse on reinstallation. Preview uses the same ownership, compatibility and configuration preflight as the write path. It refuses pending recovery so a preview cannot replay earlier changes.

The suite passed 17 tests on Python 3.12.14. Four new checks cover manifest inspection without a target, accurate upgrade and removal previews with unchanged SQLite contents, interrupted transactions left untouched during preview, and preservation of the inode on identical reinstalls. Testing used temporary roots.

Native Genesis QEMU acceptance

The Baihu serial-console transcript confirms Genesis v0.1 reached multi-user.target and accepted a login on ttyS0. The guest reported kernel 7.1.8-ainow-genesis, glibc 2.44, Python 3.14.7, SQLite 3.53.4, a working TOML import and /usr/bin/zstd. Git was absent. The clocksource watchdog warning did not prevent login.

Baihu served the committed CLI and test suite on loopback. The guest retrieved both through QEMU user networking and ran the CLI and tests in a temporary directory. The native suite ran 17 cases in 4.279 seconds with 16 passes and 1 expected skip. The source-build test skipped because the guest session ran as root. Package lifecycle, compatibility checks, dry runs, ownership, transaction recovery and the stubbed release workflow passed. The next checkpoint is to bootstrap Git as a managed package and exercise the source-build path as an unprivileged user.

Managed Git bootstrap

Genesis had no Git, so ainpkg build gained a bootstrap input for a SHA256-pinned git archive of a committed recipe. Baihu exports the recipe. Genesis builds with its native compiler and glibc. Both build entry points use the same staging logic and record the Git commit in the package manifest. The bootstrap input verifies its archive bytes before extraction and still verifies the pinned upstream source separately.

The recipe uses Git 2.56.1 from kernel.org in a C-only bootstrap configuration. The first build exposed the upstream default Rust build and was corrected with NO_RUST. A subsequent install exposed upstream symlink aliases for three public built-ins. The recipe stages those as separate regular files for compatibility with the current package format. This bootstrap defers HTTPS transport and GUI tooling.

All 17 automated cases passed in the development environment. The source-build case also exercised a valid recipe archive and a wrong digest with Git absent from PATH. The x86-64/glibc 2.41 development build produced a 22 MiB package. Installation, ownership, verification, git --version, local commit, file:// clone, git fsck and removal passed in disposable directories. A Genesis glibc 2.44 build and package lifecycle are pending.

The Genesis serial-console follow-up confirmed the complete native lifecycle. The guest built git.ainpkg as nobody with its glibc 2.44 toolchain using a verified recipe export from 882725b. Package SHA256: 9bb822dab6df7f193dbc5a39a730ab31ef85e60c1942aaffa49889e86d393984. In a disposable root, preview, install, verification and ownership lookup for /usr/bin/git passed. Git reported version 2.56.1, created commit 1fcdeed, cloned it through file:// and passed git fsck. Package removal deleted the managed executable and the script reported PASS: Genesis Git package lifecycle. HTTPS transport and a persistent deployment remain outside this acceptance.

OpenSSH client/server split

Genesis built and installed the original combined OpenSSH package in a temporary root. Both binaries reported OpenSSH 10.6p2 and OpenSSL 4.0.1. The package SHA256 was 5e687ae02d99b74e056fe848d7216e7ba482c627c81bd2c4e11d39215070054c. The daemon’s sshd account and /var/empty/sshd were absent in the guest, so an SSH session was not attempted.

The same OpenSSH recipe now produces the openssh client and independently installable openssh-server. The server owns its daemon, helpers, configuration, unit, and declarative account and directory fragments. It contains its own key generation helper. An explicit service start can generate keys and validate the configuration. Package installation stages files without starting a service.

Both artifacts built on the glibc 2.41 development host. Co-installation, ownership, version checks, absence of bundled host keys, verification and independent removal passed. Offline sysusers provisioned the sshd account. Direct unprivileged tmpfiles could not apply root ownership, so the provisioning check was rerun in a mapped-root user namespace and passed with a 0755 root-owned privilege-separation directory. All 17 tests passed, including named recipe output validation. Split packages, service startup and a loopback connection still need native Genesis verification.

Genesis provisioning fallback

Genesis natively built and co-installed both split packages in a disposable root. Ownership and verification passed, the client and daemon reported OpenSSH 10.6p2 with OpenSSL 4.0.1, and no host keys were staged. The client archive SHA256 was fd876b8d2e5b2f88e98b73f0c098f472e96d4ef4ae02147636b534a007515615; the server archive SHA256 was 6313b3717de1612fb92a15fbd5b541054b33ef21899fb6d0dda81dcfd4c8971c.

The first provisioning attempt stopped because the Genesis systemd build follows the LFS sysusers=false configuration. The server now packages an idempotent preparation helper, invoked by its unit before key generation, that uses Shadow’s useradd if the local service account is absent. The systemd fragments remain for targets with sysusers. Shell checks and the 17-case Python suite passed. A mapped-root test verified the fallback arguments with a stub useradd, idempotence and the root-owned 0755 directory. The development host’s real useradd requires an audit interface unavailable inside that namespace. Native fallback execution and a loopback SSH session remain pending.

Genesis loopback SSH acceptance

Shadow’s useradd --root successfully created the locked sshd separation account (UID/GID 999) in the disposable target. The privilege-separation directory verified as mode 0755 with UID/GID 0:0. This confirmed the native Shadow provisioning path manually, using the previously built server package.

The split Genesis-native packages completed a loopback test inside a disposable chroot and private mount/network namespaces. The first test stopped because the library-copy script treated an ldd filename header as a library path. After filtering the headers, OpenSSH could not open the temporary root’s manually created /dev/null. Binding the guest’s /dev/null and /dev/urandom inside the private mount namespace allowed the test to proceed. sshd -t passed, and the packaged client authenticated a non-root test account with a temporary Ed25519 key and a pinned host key on 127.0.0.1:2222. The server executed the forced test command and returned Genesis-SSH-OK. The exit handler stopped the test daemon. The packaged systemd unit and preparation helper were not executed in that run. Live binary release asset round-trip and persistent service deployment remain unverified.

Chapter 11 acceptance — draft Release round-trip

Genesis produced the glibc 2.44 openssh-server.ainpkg from recipe commit 86c698f. Baihu received it over the local QEMU connection and verified SHA256 6313b3717de1612fb92a15fbd5b541054b33ef21899fb6d0dda81dcfd4c8971c. With explicit approval, Baihu created the unpublished GitHub draft Release chapter-11-openssh-server-roundtrip, uploaded through ainpkg upload, downloaded through ainpkg download with the recorded digest, and confirmed a byte-for-byte match. The release was checked as a draft before upload and after download.

The downloaded asset was transferred back to Genesis. It passed SHA256, temporary-root install, package verification, ownership lookup for /usr/sbin/sshd, the version check (OpenSSH 10.6p2/OpenSSL 4.0.1) and removal. The test reported PASS: GitHub draft asset installed and removed on Genesis. This closes the Chapter 11 acceptance checklist for staged source builds, local and release binary installation, and loopback SSH. Persistent service activation and native execution of the newer preparation helper remain deferred. The hardware checkpoint remains EeePC 1005P inventory, ISA testing, a dedicated kernel and external-media boot.

Chapter 12 start — terminal installer and kernel profiles

Added ainstall with a write-free preview, SHA256 validation, a new-file rehearsal target and an explicitly confirmed whole-disk path. The initial deployment payload is BIOS/MBR with one aligned Linux partition so the installer can copy and verify the same image regardless of the target disk size within the MBR limit. The original GPT Genesis image is an input baseline, not a deployment payload. No physical disk was opened for writing.

All 24 unit tests passed, including seven installer cases. The new tests use a synthetic image and cover preview, exact copy, layout and checksum rejection, protection of existing outputs, a stable disk identifier, and interactive confirmation. QEMU and a real bootable deployment payload were unavailable in this environment.

Resolved eeepc-1005p, genericx86 and genericamd64 against Linux 7.1.8 using its upstream defconfig and olddefconfig. Kernel.org’s listed tarball SHA256 matched the downloaded source. The host lacked flex, bison and m4, so tools were staged temporarily. The first i386 pass exposed that Kconfig omits the inactive 64BIT symbol; the 32-bit fragment now asserts the effective X86_32 setting. All three final configurations retained the boot storage options and profile suffixes. Full kernel compilation, EeePC inventory and hardware drivers, rescue media build, and installed-disk boot acceptance are the next checkpoints.

Chapter 12 continuation — recovery media builder and virtual installation

Added build-bios-image.sh for a sealed rootfs tree and a matching kernel. The builder writes only a newly allocated loop image. It assigns a fresh ext4 UUID, writes an image-local fstab and BIOS GRUB configuration, and can embed a verified deployment payload and ainstall in a separate rescue image. The original Genesis GPT image and physical disks were untouched.

The test environment had no QEMU or loop device. Staged QEMU and the rescue tooling from Debian packages without installing them on the host, then ran the image builder in TCG with a disposable Debian/BusyBox fixture. The initial run exposed a losetup --detach argument handling issue; removing the redundant delimiter fixed it. Subsequent fixture retries required a devpts mount for interactive confirmation and the Debian CRC32C module for the test initramfs. These were fixture corrections.

The final run built separate 128 MiB deployment and 320 MiB rescue images. It copied the verified deployment payload from the installer environment to a blank 256 MiB QEMU disk using the real ainstall --disk path and terminal confirmation. The written range matched the expected SHA256. A separate VM with only the installed disk attached booted through BIOS GRUB, mounted ext4 and reached the fixture init. All 27 unit tests passed. The actual AI-Now rootfs and EeePC hardware still need deployment verification.

All three Linux 7.1.8 profiles built with GCC 14.2.0. The first two 64-bit builds hit an objtool link failure because the staged libelf development symlink could only resolve the static archive. Connecting it to the compatible host libelf shared library fixed the link. The 32-bit genericx86 and both 64-bit candidates executed matching minimal native init binaries in QEMU and powered off. The build bundles contain the bzImage, matching stripped modules, resolved configuration, source reference and smoke-test output.

Profile Archive SHA256
genericx86 50ef3c8c8226c4b7d0ffcab4945a2fcf86e2a12e3b7c79e0586b9858a2e5b4e6
genericamd64 a303f3ae6fec398eca12000302b090f741e5653d623e0d78b7f3ac2741f5d1cb
eeepc-1005p 5ca6b1993c82d7eec95eb2cfaf0176cfcf252f63b7fe908bf46776b61417081f

The EeePC profile remains a candidate. Intel HDA, Ethernet drivers and the wireless framework were present in its resolved configuration. Actual NIC, WLAN and codec support remains unverified until the hardware inventory and on-device tests.

Re-ran the complete virtual installation with the AI-Now EeePC candidate kernel and a minimal BusyBox rootfs fixture, this time without an initramfs on the installed disk. Changed the GRUB kernel argument from filesystem UUID to MBR PARTUUID for direct root discovery. The installed virtual disk booted alone through BIOS GRUB, reported 7.1.8-ainow-eeepc-1005p, mounted ext4 and reached the test init. The physical EeePC and the full Genesis rootfs were not part of this test.

Genesis RAW to EeePC rescue media

Added build-eeepc-rescue.sh to pin the EeePC kernel bundle, mount partition 2 of the Genesis GPT image read-only with ext4 journal replay disabled, stage the matching modules, and size and build separate deployment and rescue images. It publishes both images with SHA256SUMS in a new output directory. Existing output and an incorrect kernel digest were rejected during preflight.

QEMU verified the complete wrapper with a synthetic GPT/ext4 source, the real EeePC kernel bundle and the BIOS image builder. The first fixture runs exposed a missing awk dependency and a fixture-only zstd runtime dependency. The wrapper now uses coreutils for the capacity query. The final run generated 523 MiB and 1302 MiB deployment and rescue images. Both matched SHA256SUMS, and the source GPT image kept its original SHA256. The actual Genesis RAW is on Baihu. Production-size media build and EeePC hardware acceptance remain pending.

Baihu’s first build from the actual Genesis RAW accepted the 8721 MiB rootfs and formatted the new 11413 MiB deployment image’s loop partition. GRUB then stopped because Baihu lacked /usr/lib/grub/i386-pc/modinfo.sh. No final images were published. The BIOS builders now check for the GRUB module file before mounting a source or formatting an image. A mapped-root check with a valid kernel bundle confirmed the missing-module error exits before creating any output. Install Ubuntu’s grub-pc-bin on Baihu and rerun. The calculated rescue image is 23082 MiB.

Baihu rescue image serial boot acceptance

After installing grub-pc-bin, Baihu produced the Genesis-derived rescue image. Earlier black-screen reports did not identify the failing boot stage. The rescue image subsequently booted under QEMU TCG with qemu64, a BIOS IDE disk in snapshot mode, and the serial console redirected to the terminal. The user logged in, confirmed kernel 7.1.8-ainow-eeepc-1005p, and observed the ext4 root mounted from /dev/sda1. The embedded deployment image was present at /opt/ainow-install/deploy.img and listed as 12G. The packaged ainstall --help executed successfully. This confirms boot and access to the offline installer on the Genesis-derived image. Physical USB boot, EeePC device support, and installation to its internal disk remain pending.