summary refs log tree commit diff
path: root/Documentation
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-10-10 23:28:54 +0000
committerAlyssa Ross <hi@alyssa.is>2022-11-13 23:59:27 +0000
commit395346bd3341fd0468bc4f8a9c427440c5d05438 (patch)
tree5b8e4246a8aa4d627c6b48263fcdad4d4a942687 /Documentation
parent87d1c2a5a5eff07b398135ee83f4299f09b83227 (diff)
downloadspectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.tar
spectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.tar.gz
spectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.tar.bz2
spectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.tar.lz
spectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.tar.xz
spectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.tar.zst
spectrum-395346bd3341fd0468bc4f8a9c427440c5d05438.zip
host/initramfs/extfs.nix: tar2ext4 -> mkfs.ext4 -d
tar2ext4 is designed for making read-only, minimally-sized ext4
images.  That's great for the Spectrum host system's root filesystem,
but it doesn't make sense for the user data partition, because even if
we mark it read/write after running tar2ext4, there will be very few
inodes available, so it won't be very useful for storing data.

To fix this, we use the normal tools for creating an ext4 filesystem.
We create a sparse image of an extremely large size to ensure there's
enough space available for metadata and things for the partition to
grow to fit any disk a user might want to to use Spectrum on, then
shrink the image down to its minimum size.

Doing it this way assumes that the build environment will always
support sparse files.  If this turns out not to be the case, we can
use mkfs.ext4's -E resize= option to set the maximum expected disk
size, and use a smaller size for the initial image size.  I haven't
done that here to avoid having to pick that smaller number.

Now that the filesystem is no longer marked as read-only, we need to
fsck it before every mount, or it won't mount any more after the first
time.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221010232909.1953738-15-hi@alyssa.is>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions