kernel: mtd: Make subpartitions inherit parent's access mode
authorBruno Pena <brunompena@gmail.com>
Sat, 9 Nov 2019 14:23:58 +0000 (15:23 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 20 Jan 2020 19:57:21 +0000 (20:57 +0100)
commitde80424f706682e8bba27c60bcd2a9c1b4a5e875
treeb3d1a96d7bf433808a6a23ab8dbbeed3f783c99b
parent63000bfaf7163d97ac6feb343c7587e3d339e65e
kernel: mtd: Make subpartitions inherit parent's access mode

Currently it's not possible to effectively mark a "firmware" partition
as read-only. The sub-partitions "kernel", "rootfs" and "rootfs_data"
are always created as read-write (ignoring the parent access mode).

This patch enforces the access mode of sub-partitions to match the
parent partition, which is useful for recovery images that are meant
to be fully read-only to avoid accidental damage from end-user.

An example of such implementation (read-only firmware image) is the
recovery image used on the Zsun-SD100 [1].

Please note the related patch for fstools [2] to enable this read-only
concept.

[1] https://github.com/brunompena/zsun-resources
[2] http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021043.html

Signed-off-by: Bruno Pena <brunompena@gmail.com>
[removed already obsolete 4.9 kernel patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
target/linux/generic/hack-4.14/401-inherit-parent-partition-access-mode.patch [new file with mode: 0644]
target/linux/generic/hack-4.19/401-inherit-parent-partition-access-mode.patch [new file with mode: 0644]