openwrt / openwrt/packages

uvol: [RFE] allow configuration of UBI partition to use

Open
#22,468 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

hi @dangowrt

in some setups we have multiple UBI partitions... kinda defeats UBI's flash management, but life is what it is.

to give one example:

openwrt for WHW03 V2 has dual firmware sets, and for each set there is an UBI partition (155 MiB) containing rootfs and rootfs_data. but with the OEM firmware, said UBI partitions only contain rootfs. the writable data is stored in a separate partition (also UBI, 181 MiB) containing a UBIFS volume that is shared for both firmware sets, which means that upgrades do not touch the writable data. so in this device there are 3 UBI partitions.

right now, in this device the largest partition cannot be used with uvol, and to use uvol you have to steal space away from rootfs_data. worse yet, you would loose (revert) your uvol volumes whenever you sysupgrade (as the active firmware set is switched, and so is the UBI partition), so uvol is not usable at all.

we don't want to make uvol handle multiple UBIs, god forbid! but we could surely use a way to configure which MTD to use as the UBI.

while a config option could be added, you may want to consider a bootloader env variable instead (or additionally) so that this config survives "config resets" (just like the data in uvols).

(in any case, if an MTD device is specified somehow, we need to attach it if needed before using.)

https://github.com/openwrt/packages/blob/bfb980f18ee2eddf47b04c3d92b97b6580966cde/utils/uvol/files/ubi.uc#L57-L85

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with utils/uvol/files/ubi.uc, especially lines 57-85, and trace how uvol discovers or attaches UBI devices on the affected OpenWrt target. Compare configuration and bootloader-environment options, then verify that a selected MTD is attached when needed and that volumes remain usable across configuration resets and firmware-set switches.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.