Repository navigation
initramfs: guard UFS_RW partitions on a second LUN (UFS_RW_LUNS) - #530
Conversation
On the OnePlus 6, userdata is on sda but boot_b sits on LUN sde, which the guard keeps read-only at the disk level, so the boot_b named in UFS_RW could never be written. A new optional descriptor key, UFS_RW_LUNS, names the LUNs besides sda that hold UFS_RW partitions (sdb to sdz). omamobile checks it and packs it as /etc/omamobile-ufs-rw-luns. The init guards each listed LUN as it guards sda: whole-disk node removed, disk left writable, only allowlisted partitions writable. A malformed list, or a closed allowlist, leaves every LUN but sda read-only. Pixels set no key and pack no file, so they are unchanged. enchilada sets UFS_RW_LUNS=sde. tests/storage-guard covers both, the refusals at pack time and the malformed lists at boot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, Matt. This is careful work on the most sensitive file we have. The new list fails closed at every step I could think of: a missing or broken allowlist, a malformed LUN list, Two things before it merges:
For the record, this conflicts with my own #484 (every LUN guarded like |
Review asked for the enchilada opt-in to land with the change that teaches push to find boot_b on sde, the slot-B install and its CONTRIBUTING.md §3.1 entry. This drops UFS_RW_LUNS=sde from its descriptor and the enchilada wording from DEVICES and RELEASES; the mechanism and its docs stay. tests/storage-guard now builds a "lun" test descriptor from enchilada's with UFS_RW_LUNS=sde, as it builds "six", so the second-LUN cases keep their coverage. device/enchilada/NOTES.md records the 11-08 RAM-only boot of 2331a85's initramfs on 7.1.0-rc1-sdm845. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. Done in 86286cd:
Thanks for taking the #484 conflict on your side. |
|
Thank you, Matt. This is exactly what I asked for. The LUN-aware guard goes in now, and enchilada's I ran Two wording nits. Neither holds the merge, and I'm happy to fix them myself at merge if you'd rather:
As I said, I'll take the conflict with my #484 on my side. On the 7 Pro I'll read the guard's log lines on my next routine push from main. Thanks again for careful work on the file that protects everyone's calibration data. |
|
Merged. I've opened the follow-up for the first wording point myself. The second is still a question for you, @matthewjaybarr-png: which |
…s with the slot-B install (#580) #530 merged the guard's UFS_RW_LUNS without enchilada's opt-in, so the NOTES and the DEVICES row no longer call it a pull request to come: they say enchilada's UFS_RW_LUNS=sde arrives with the slot-B install that gives boot_b on sde a writer. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, Derek. It was the first-light build. The one-line NOTES follow-up is #588. |
… sets sde push looked for <image>_b only under /sys/block/sda. It now looks on sda and each LUN in UFS_RW_LUNS, the same LUNs the init guards, and refuses a name found on more than one partition or a path it doesn't expect. enchilada opts in with UFS_RW_LUNS=sde, where its boot_b is (derekross#530's review). push and flash still refuse android-v0 until the slot-B install and its CONTRIBUTING §3.1 entry land in this pull request. tests/images-layout: the fake phone places partitions on one LUN; push finds them on a UFS_RW_LUNS LUN, not on a LUN the descriptor doesn't name, and refuses a duplicate name before writing anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ekross#530) The storage guard takes a list of LUNs whose UFS_RW partitions may be writable (UFS_RW_LUNS, default sda alone), so a device whose boot partitions sit on a second LUN can open them partition by partition while that disk stays read-only. It fails closed on a missing or malformed list, sda or a partition name in it, and glob or shell characters. No descriptor sets the key: enchilada's UFS_RW_LUNS=sde comes with the pull request that gives boot_b on sde a writer (push and the slot-B install, with its CONTRIBUTING section 3.1 entry). tests/storage-guard covers the second LUN with a test descriptor. Every Pixel's guard runs the same tests as before.
…s with the slot-B install (derekross#580) derekross#530 merged the guard's UFS_RW_LUNS without enchilada's opt-in, so the NOTES and the DEVICES row no longer call it a pull request to come: they say enchilada's UFS_RW_LUNS=sde arrives with the slot-B install that gives boot_b on sde a writer. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…and the NFS root Main gained two things in the guard since this branch: a LUN list beside sda (UFS_RW_LUNS, #530) and the NFS-root mode. Both are kept, on this branch's rule that every LUN loses its whole-disk node and keeps its disk flag clear. initramfs/init: every LUN is guarded alike; the allowlist is honoured on sda and on a listed LUN only; with an NFS root sda keeps main's disk-level read-only flag and the other LUNs are guarded by their partitions' own flags. tests/storage-guard keeps both sides' cases on the own-flag model (the late LUN is now sdf, since sde is the listed LUN's fixture). akita and oriole get the storage rule's new comment. Versions: device-cheetah 0.1.55, device-lynx 0.2.5, device-raven 0.1.37.
What and why
On enchilada, userdata is on
sdabutboot_bis on LUNsde. The storage guard keeps every LUN butsdaread-only at the disk level, so theboot_binUFS_RWcould never be written. This follows the enchilada port (#432) and the note indevice/enchilada/NOTES.mdthat a LUN-awareUFS_RWwould come as its own pull request.This adds an optional descriptor key,
UFS_RW_LUNS(disk namessdbtosdz), packed as/etc/omamobile-ufs-rw-luns. The init guards each listed LUN the way it guardssda: whole-disk node removed, disk left writable, onlyUFS_RWpartitions writable.UFS_RW_LUNS=sdecomes with the pull request that teachespushto findboot_bonsde, with the slot-B install and its §3.1 entry.sdaread-only.omamobilerefuses a bad value at pack time.omamobile-boot-updateand the installer still look only onsda. enchilada's push and install refuseandroid-v0anyway.Device and build
fastboot bootfrom slot A's fastboot; nothing flashed. Pixels are unchanged.uname -r): 7.1.0-rc1-sdm845initramfs/init,bin/omamobile, docs, tests, and the 11-08 boot in enchilada's NOTES)Checks (no phone needed)
tools/pr-check origin/mainpassestests/allpasses (tests/storage-guardhas new cases, on a test descriptor with enchilada's layout andUFS_RW_LUNS=sde, for the list, no list, five malformed lists, a closed allowlist and the pack-time refusals)tests/packages: CI's every-package job (no package changed; locally theomamobile-omarchyseries does not apply to Omarchy 4.5.0-3, which this pull request does not touch)versionbumped: no package changedCo-Authored-By:trailerOn the phone
UFS_RW_LUNS=sdein the descriptor; recorded in enchilada's NOTES)dmesgand sysfs:allowlist: boot_b userdata,LUNs with allowlisted partitions: sda sde/dev/sdaand/dev/sde: whole-disk node removed, diskro0sda17(userdata) andsde39(boot_b); the other 71sdepartitions arero1sdb,sdc,sdd,sdf: diskro1, no writable partitiontools/phone-smoke(this build stays in the initramfs, so there is no session or root to check), and any write toboot_b; nothing writes it yet.userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1). No descriptor sets the new key in this pull request, so it makes no partition writable on any phone.🤖 Generated with Claude Code