Meta: Stop requesting 128-byte inodes when creating the root filesystem

We now have full support for large inodes, so we don't need to rely on
the deprecated 128-byte inodes anymore. Note that genext2fs doesn't
support large inodes, so we have to account for that when using that
utility.
This commit is contained in:
implicitfield 2024-11-23 15:14:47 +02:00 committed by Nico Weber
parent 0e368bb71a
commit caefb208f0
4 changed files with 6 additions and 6 deletions

View file

@ -75,7 +75,7 @@ dd if=/dev/zero of="${dev}${partition_number}" bs=1M count=1 status=none || die
echo "done"
printf "creating new filesystem... "
mke2fs -q -I 128 "${dev}${partition_number}" || die "couldn't create filesystem"
mke2fs -q "${dev}${partition_number}" || die "couldn't create filesystem"
echo "done"
printf "mounting filesystem... "

View file

@ -93,7 +93,7 @@ dd if=/dev/zero of="${dev}${partition_number}" bs=1M count=1 status=none || die
echo "done"
printf "creating new filesystem... "
mke2fs -q -I 128 "${dev}${partition_number}" || die "couldn't create filesystem"
mke2fs -q "${dev}${partition_number}" || die "couldn't create filesystem"
echo "done"
printf "mounting filesystem... "

View file

@ -77,7 +77,7 @@ echo "done"
printf "creating new filesystems... "
mkfs.vfat -F 32 "${dev}p1" || die "couldn't create efi filesystem"
mke2fs -q -I 128 "${dev}p2" || die "couldn't create root filesystem"
mke2fs -q "${dev}p2" || die "couldn't create root filesystem"
echo "done"
printf "mounting filesystems... "

View file

@ -33,7 +33,7 @@ fi
# Prepend the toolchain qemu directory so we pick up QEMU from there
PATH="$SCRIPT_DIR/../Toolchain/Local/qemu/bin:$PATH"
INODE_SIZE=128
INODE_SIZE=256
INODE_COUNT=$(($(inode_usage "$SERENITY_SOURCE_DIR/Base") + $(inode_usage Root)))
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 * 1024))
@ -180,8 +180,8 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
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.
# not using "-I $INODE_SIZE" since it hangs. Serenity handles whatever default this uses instead.
# 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