Repository navigation
Ship an initramfs on x64/x86 and cap /tmp (ADR-0021, fos#75) - #199
Merged
Merged
Conversation
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>
# Conflicts: # CLAUDE.md # tests/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #75.
What changes
init.xz/init_32.xzas 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.root=/dev/ram0initrd support in January 2027. 20230331 release not work with ESXi 7.0U3 VM on Dell R730 #75 panics inside that loader.CONFIG_SHMEM+CONFIG_TMPFSare on in every kernel. Before, every "tmpfs" was a ramfs that ignoredsize=, so/tmphad no cap.S00tmpsizesizes/tmpfromramdisk_size=(FOG_KERNEL_RAMDISK_SIZE), clamped to 64 MiB..half of RAM. The fstab default is 256m.root=/ramdisk_size=/rootfstype=once/initexists.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=crc32is still required.Verification
/initruns with no deprecated-initrd warning, and an appended overlay cpio customizes the init./tmpfill 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.shandtmp-size.shwere both proven red before they went green.tests/checkspass, and so doesgolden check.fog.perfteststages 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