Meta: Use the same disk size for genext2fs as for everything else

INODE_COUNT gets modified after it has been initially used to compute
DISK_SIZE_BYTES, so the approach introduced in caefb208 didn't actually
work as intended.
This commit is contained in:
implicitfield 2024-12-02 00:54:59 +02:00 committed by Nico Weber
parent c385e8beb1
commit a3fc110ea8

View file

@ -178,10 +178,6 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
"$script_path/build-root-filesystem.sh"
if [ $use_genext2fs = 1 ]; then
# regenerate new image, since genext2fs is unable to reuse the previously written image.
# genext2fs is very slow in generating big images, so I use a smaller image here. size can be updated
# if it's not enough. this also accounts for the fact that genext2fs only supports 128-byte inodes.
DISK_SIZE_BYTES=$((DISK_SIZE_BYTES - INODE_COUNT * 128))
genext2fs -B 4096 -b $((DISK_SIZE_BYTES / 4096)) -N "${INODE_COUNT}" -d mnt _disk_image || die "try increasing image size (genext2fs -b)"
# if using docker with shared mount, file is created as root, so make it writable for users
chmod 0666 _disk_image