| commit | d589b6afab60a4cfc5723c04ae83183a4487ec7e | [log] [tgz] |
|---|---|---|
| author | Jan Schär <jan@monogon.tech> | Mon Nov 11 14:55:38 2024 +0100 |
| committer | Jan Schär <jan@monogon.tech> | Tue Nov 12 16:14:55 2024 +0000 |
| tree | fd404d8cdda2f86a1298aaa85b15a3946770e597 | |
| parent | 5d1bf6ab597d1ebfc4284bcb7df6648c17535464 [diff] |
osbase/fat32: fix corrupted directories Previously, after writing the contents of a file or directory, any remaining space in the last cluster was left as is instead of zeroed. For files this may be acceptable, but directories do not have an explicit size in bytes. The result is that, if the device was not zeroed before writing the FAT32, each directory contains some number of additional garbage entries, with a random name, size, and initial cluster. The fix is to ensure that the last cluster of a directory is filled up with zeroes, following the FAT32 spec (page 24): "initialize all bytes of that cluster to 0". The change also applies to files, where zeroing the remainder of the last cluster should not be necessary, but also doesn't hurt. At most 32 KiB of zeroes (the maximum cluster size) will be written for each file. The fsck test is extended to initialize the file with random bytes. Without the fix, this results in fsck reporting a large number of problems. Change-Id: I7729e028c92bfad9b879a4256f3fa4f7af25553a Reviewed-on: https://review.monogon.dev/c/monogon/+/3607 Reviewed-by: Lorenz Brun <lorenz@monogon.tech> Tested-by: Jenkins CI
This is the main repository containing the source code for the Monogon Platform.
This is pre-release software - take a look, and check back later! In the meantime, join us on Matrix (#monogon-os-community:matrix.org) or Discord.
Our build environment is self-contained and requires only minimal host dependencies:
/dev/kvm (if you want to run tests).Our docs assume that Bazelisk is available as bazel on your PATH.
Refer to SETUP.md for detailed instructions.
The source code lives in //metropolis (Metropolis is the codename of Monogon OS).
See the //metropolis/README.md for a developer quick start guide, or see the Monogon OS Handbook for user documentation.