Skip to content

omamobile-omarchy 0.1.40: swap on zram at half the RAM (#528) - #599

Merged
derekross merged 1 commit into
derekross:mainfrom
den-kloot:omamobile-omarchy-zram-half
Nov 10, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
den-kloot:omamobile-omarchy-zram-half

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

What and why

Fixes #528. Omarchy 4.5 moves its zram tuning to /usr/lib/systemd/zram-generator.conf.d/90-omarchy.conf with zram-size = ram, and installs zram-generator on aarch64. With the zram driver in our kernel config (#515), the move past 4.0.6 would give every phone RAM-sized zram. That is the setting that hung the Pixel 9a under a 6 GB load in #515's test; with half the RAM, the same test allocated 5 GB more with no OOM kill.

omamobile-omarchy now ships zram-generator.conf.d/91-omamobile.conf, which sets only zram0's size, to ram / 2. Drop-ins are read in name order across /usr/lib, /run and /etc, so:

  • it overrides Omarchy's size and keeps Omarchy's zstd and swap priority;
  • a leftover /etc/systemd/zram-generator.conf decides nothing;
  • a local /etc/systemd/zram-generator.conf.d/99-local.conf (the name Omarchy's own migration suggests) still wins.

Under Omarchy 4.0.6 an image has no zram-generator, so nothing changes there. Where zram-generator was installed by hand, the drop-in alone makes a half-RAM device.

Device and build

Checks (no phone needed)

  • tools/pr-check upstream/main passes
  • tests/all: not run
  • packages/omamobile-omarchy/test/all passes on the phone (167 ok, none failing)
  • Commit has an area prefix and a body that says why; AI help is a Co-Authored-By: trailer, no Signed-off-by:

New test/zram.sh checks the staged file. Where zram-generator is installed, it also runs the real generator on a made-up root (ZRAM_GENERATOR_ROOT, MemTotal 8 000 000 kB):

Config in the made-up root zram0
Omarchy 4.5's 90-omarchy.conf alone 7812 MB
plus 91-omamobile.conf 3906 MB
plus a leftover /etc/systemd/zram-generator.conf (ram) 3906 MB
plus /etc/.../99-local.conf (2048) 2048 MB

With the drop-in set to ram, the test fails.

On the phone

  • The generator on the phone's own /proc/meminfo (7.4 GB), with Omarchy 4.5's drop-in and this one in a made-up root: /dev/zram0 with 3719MB; with Omarchy's alone: 7438 MB. The phone's live zram (already ram / 2 from a local /etc file since omamobile.config: swap on zram, and the 9a's zram notes #515's test) was not touched.
  • How it was tested: the agent (Claude Code, on the phone) wrote the change and ran the tests and the generator as above, unattended overnight; I (the owner) asked for it and approved sending it.
  • What I did not test: a real boot under Omarchy 4.5 (no phone here runs it yet), another phone.
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)

🤖 Generated with Claude Code

Omarchy 4.5 moves its zram tuning to
/usr/lib/systemd/zram-generator.conf.d/90-omarchy.conf, with
zram-size = ram, and installs zram-generator on aarch64. With the zram
driver in our kernel config (derekross#515), the move past 4.0.6 would give every
phone RAM-sized zram: the setting that hung the Pixel 9a under a 6 GB load
in derekross#515's test, where half the RAM took 5 GB more with no OOM kill.

The package now ships zram-generator.conf.d/91-omamobile.conf, which sets
only zram0's size to ram / 2. Drop-ins are read in name order across
/usr/lib, /run and /etc, so it overrides Omarchy's size and keeps its zstd
and swap priority; a leftover /etc/systemd/zram-generator.conf decides
nothing, and a local 99-local.conf (the name Omarchy's migration
suggests) still wins. Under Omarchy 4.0.6 an image has no zram-generator,
so nothing changes there; where it was installed by hand, the drop-in
alone makes a half-RAM device.

test/zram.sh checks the staged file and, where zram-generator is
installed, runs it on a made-up root (ZRAM_GENERATOR_ROOT, 8 000 000 kB):
7812 MB with Omarchy's drop-in alone, 3906 MB with ours, 3906 MB with a
leftover /etc file, 2048 MB with a local 99-local.conf. With the drop-in
set to ram the test fails. test/all on the Pixel 9a (zram-generator
1.2.1): 167 ok, none failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thanks, this is exactly what #528 asked for, and well checked. I
confirmed Omarchy 4.5.0's drop-in at the tag (zram-size = ram, zstd,
priority 100), and ran your test/zram.sh with zram-generator 1.2.1: the
four sizes come out as you list them, and the test fails when the drop-in
says ram. CI has no zram-generator, so that half skips there; it's good
that the test says so.

I'll merge it as 0.1.40. One note: #528 also asks for a first boot under
Omarchy 4.5 showing /dev/zram0 at half the RAM on the 7 Pro and the 9a,
and nobody can run that yet, so I'll keep #528 open for that check rather
than let this close it. When your 9a moves to 4.5, zramctl and
swapon --show from its first boot would be welcome there.

@derekross
derekross merged commit cf1bb9a into derekross:main Nov 10, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
Part of derekross#528. Omarchy 4.5 sizes swap on zram at the whole RAM; on a phone that is too much. A drop-in sets it to half the RAM, checked with zram-generator against 8, 12 and 2 GB cases. On today's 4.0.6 phones the drop-in is in place for the move to 4.5.

Still open in derekross#528: the check on a 4.5 phone's first boot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cap swap on zram at half the RAM before the image moves past Omarchy 4.0.6

2 participants