1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 03:19:47 +03:00
pmbootstrap/pmb/install
Oliver Smith d90a037fd6
pmb.install.format: set bytes-per-inode to 16384 (MR 2558)
After setting "-T big", we still saw some images failing with "out of
space" errors in bpo, such as "v24.12:samsung-espresso10:xfce4".

I've looked at /etc/mke2fs.conf to figure out what exactly gets
configured with "-T big". What I did not realize is that the inode
ratio gets bigger by going from small -> big, big -> huge, but with a
larger ratio FEWER inodes will be created (see man mkfs.ext4, -i
bytes-per-inode).

In /etc/mke2fs.conf in Alpine edge:

	[defaults]
	…
		blocksize = 4096
		inode_size = 256
		inode_ratio = 16384

	[fs_types]
	…
		small = {
			blocksize = 1024
			inode_ratio = 4096
		}
		floppy = {
			blocksize = 1024
			inode_ratio = 8192
		}
		big = {
			inode_ratio = 32768
		}
		huge = {
			inode_ratio = 65536
		}
		news = {
			inode_ratio = 4096
		}
	…

So I've tried out half the ratio value we get with "big" now, 16384.
With that we finally seem to have:

* Enough inodes for small UIs (console, none) as well as big UIs with
  lots of files (xfce4, plasma-desktop, ...)

* We don't directly specify an inode count (-N) anymore as we did
  earlier, which had problems with small images as the inode count would
  be too large for the given image size (pmb#2572).

Test builds with various images:

Filesystem              Inodes      Used Available Use% Mounted on
master:postmarketos-trailblazer:none:
/dev/installp2           35440      5111     30329  14% /mnt/install
master:postmarketos-trailblazer:console:
/dev/installp2           47232      8713     38519  18% /mnt/install
master:pine64-pinebookpro:plasma-desktop:
/dev/installp2          276352    100607    175745  36% /mnt/install
v24.12:samsung-espresso10:xfce4:
/dev/installp2           80960     51150     29810  63% /mnt/install

So the most Use% I could get is 63% with this, leaving a nice margin for
the future.
2025-02-23 13:45:36 +01:00
..
__init__.py pmb: Use explicit re-exports (MR 2545) 2025-02-23 11:40:44 +01:00
_install.py install: log space/inodes used in image (MR 2558) 2025-02-23 13:45:32 +01:00
blockdevice.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
format.py pmb.install.format: set bytes-per-inode to 16384 (MR 2558) 2025-02-23 13:45:36 +01:00
losetup.py pmb.install.losetup: Remove unnecessary range start (MR 2537) 2025-02-02 22:48:50 +01:00
partition.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
recovery.py pmb: Add lots of type hints (MR 2464) 2024-10-30 12:39:45 +01:00
ui.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00