Browse Source

Fix massive root filesystem corruption under some build conditions.

Sounds scary, but it happens at build time, not runtime, so it cannot
brick devices. However, it was a frustrating exercise to uncover it,
as it is not entirely deterministic. This has been there for quite a
long time and I honestly cannot tell why it happened to me now.
Perhaps the exact location of the sparse holes on the filesystem makes
a difference. Or perhaps some versions of mkfs can handle it, others
not. All I know for sure, is that with `sparse` enabled I got massive
filesystem corruption (though sane enough to be somewhat readable) on
the rootfs. Without it, it's clean.

Changelog: Title

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
2.3.x
Kristian Amlie 4 years ago
parent
commit
2ce70456e6
No known key found for this signature in database GPG Key ID: F464407C996AF03F
  1. 2
      modules/disk.sh

2
modules/disk.sh

@ -100,7 +100,7 @@ disk_align_sectors() {
# $2 - destination file
# $3 - offset in number of 512 sectors
disk_write_at_offset() {
run_and_log_cmd "dd if=${1} of=${2} seek=${3} conv=sparse,notrunc status=none"
run_and_log_cmd "dd if=${1} of=${2} seek=${3} conv=notrunc status=none"
}
# Create file system image from directory content

Loading…
Cancel
Save