mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Meta: Tweak default disk size calculation to not be as gratuitous
Instead of first doubling the required size for the determined inode count and then _also_ tripling the sum of that and the determined disk size, let's be a bit more reasonable and just double the sum of inode count * size and disk size. This results in a 1.4GB _disk_image, instead of the 2GB from before (for < 800MB worth of files).
This commit is contained in:
@@ -71,7 +71,9 @@ inode_usage() {
|
||||
|
||||
INODE_SIZE=128
|
||||
INODE_COUNT=$(($(inode_usage "$SERENITY_SOURCE_DIR/Base") + $(inode_usage Root)))
|
||||
DISK_SIZE_BYTES=$((($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root) + INODE_COUNT) * 1024))
|
||||
INODE_COUNT=$((INODE_COUNT + 2000)) # Some additional inodes for toolchain files, could probably also be calculated
|
||||
DISK_SIZE_BYTES=$((($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root)) * 1024))
|
||||
DISK_SIZE_BYTES=$((DISK_SIZE_BYTES + (INODE_COUNT * INODE_SIZE)))
|
||||
|
||||
if [ -z "$SERENITY_DISK_SIZE_BYTES" ]; then
|
||||
# Try to use heuristics to guess a good disk size and inode count.
|
||||
@@ -80,7 +82,7 @@ if [ -z "$SERENITY_DISK_SIZE_BYTES" ]; then
|
||||
# * Indirect/doubly indirect/triply indirect blocks,
|
||||
# * Inodes and block bitmaps for each block group,
|
||||
# * Plenty of extra free space and free inodes.
|
||||
DISK_SIZE_BYTES=$(((DISK_SIZE_BYTES + (INODE_COUNT * INODE_SIZE * 2)) * 3))
|
||||
DISK_SIZE_BYTES=$((DISK_SIZE_BYTES * 2))
|
||||
INODE_COUNT=$((INODE_COUNT * 7))
|
||||
else
|
||||
if [ "$DISK_SIZE_BYTES" -gt "$SERENITY_DISK_SIZE_BYTES" ]; then
|
||||
|
||||
Reference in New Issue
Block a user