Skip to content

Ship an initramfs on x64/x86 and cap /tmp (ADR-0021, fos#75) - #199

Merged
mastacontrola merged 2 commits into
masterfrom
exp/initramfs-x86
Oct 27, 2026
Merged

mastacontrola merged 2 commits into
masterfrom
exp/initramfs-x86

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Fixes #75.

What changes

  • x64 and x86 now ship init.xz / init_32.xz as an xz cpio initramfs. Before, they shipped an ext2 image that booted as a classic initrd. arm64 already did this. The file names stay the same.
  • Mainline removes root=/dev/ram0 initrd support in January 2027. 20230331 release not work with ESXi 7.0U3 VM on Dell R730 #75 panics inside that loader.
  • CONFIG_SHMEM + CONFIG_TMPFS are on in every kernel. Before, every "tmpfs" was a ramfs that ignored size=, so /tmp had no cap.
  • S00tmpsize sizes /tmp from ramdisk_size= (FOG_KERNEL_RAMDISK_SIZE), clamped to 64 MiB..half of RAM. The fstab default is 256m.
  • The server needs no change. The kernel ignores root=/ramdisk_size=/rootfstype= once /init exists.

The decision record is ADR-0021.

Breaking change for custom inits

You can no longer loop-mount the init. To customize it, append an overlay cpio. fog-docs#209 documents this. xz --check=crc32 is still required.

Verification

  • QEMU on 6.18.59: /init runs with no deprecated-initrd warning, and an appended overlay cpio customizes the init.
  • A /tmp fill stops at 275000 KB. A 1 GiB setting on a 1 GiB client stops at half of RAM. The client stays up in both cases.
  • initrd-format.sh and tmp-size.sh were both proven red before they went green.
  • This merges master in: perftest + 6.18.59.
    • All 31 tests/checks pass, and so does golden check.
    • fog.perftest stages its 256 MiB sample in /tmp. On a smaller cap the sample is truncated, and the rate uses the bytes actually read.

Not verified

🤖 Generated with Claude Code

mastacontrola and others added 2 commits October 27, 2026 10:04
The x64/x86 inits were ext2 images booted as a classic initrd
(root=/dev/ram0). Mainline is removing that path in January 2027, and
fos#75's panic ("RAMDISK: Couldn't find valid RAM disk image") is in
its loader. Both arches now ship an xz cpio initramfs, as arm64 already
did, under the same file names. The server's root=/ramdisk_size=/
rootfstype= are ignored once /init exists, so no server change.

/tmp was never capped: every kernel config had CONFIG_SHMEM off, which
makes "tmpfs" a ramfs that ignores size=. SHMEM and TMPFS are now on,
fstab gives /tmp size=256m, and etc/init.d/S00tmpsize resizes it from
ramdisk_size= (FOG_KERNEL_RAMDISK_SIZE, which every server already
sends), clamped to 64 MiB .. half of RAM.

Verified in QEMU on 6.18.59: the initramfs runs /init with no deprecated
initrd warning; an appended overlay cpio customizes the init; filling
/tmp stops at the configured size (275000 KB) and at half of RAM for a
1 GiB setting on a 1 GiB client, and the client stays up.

Guards: initrd-format.sh fails on any non-cpio init; tmp-size.sh checks
the kernel symbols, the fstab default and the clamp. Both verified red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mastacontrola
mastacontrola merged commit a1d8b04 into master Oct 27, 2026
1 check passed
@mastacontrola
mastacontrola deleted the exp/initramfs-x86 branch October 27, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20230331 release not work with ESXi 7.0U3 VM on Dell R730

1 participant