[systemd-devel] [PATCH] gpt-auto-generator: honor read-only attribute for native rootfs, post-initrd.

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Tue Feb 3 08:11:23 PST 2015


On 3 February 2015 at 15:50, Lennart Poettering <lennart at poettering.net> wrote:
> On Mon, 29.12.14 14:33, Dimitri John Ledkov (dimitri.j.ledkov at intel.com) wrote:
>
> Heya,
>
> Sorry for the late review, still busy keeping up with all the unmerged
> patches and unreplied mails that queued up...
>
> Is this issue still relevant?
>

I believe it is relevant, but I gave up working on it at the moment.

>> Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov at intel.com>
>
> (We do not use S-o-b, we are not the kernel...)
>
>>  This is not yet really ready for application, as ultimately this is
>>  only solution for part of the problem.
>>
>>  With this patch, post-initrd -.mount unit will have correct
>>  "Options=rw" if READ_ONLY flag is not set and ro/rw was not specified
>>  on the kernel cmdline. In the initrd the -.mount unit will continue
>>  to be mounted ro by default (honoring cmdline rw flag, but ignoring
>>  unset READ_ONLY flag).
>>
>>  However, remount-fs only considers /etc/fstab and only remounts
>>  things with options as specified in the /etc/fstab. Thus the fact
>>  that -.mount unit changed "Options=ro" -> "Options=rw" between
>>  initramfs and pivoted system does not result in the root filesystem
>>  getting remounted as rw.
>
> Hmm, what precisely is the issue again here? You are looking for a way
> to make the root disk writable when using gpt auto discovery after
> boot, without shipping an /etc/fstab that would result in remounting
> after boot? Why wouldn't specifying "rw" on the kernel cmdline suffice
> for that?

The issue is that without specifying neither "ro" nor "rw" on the
kernel command line (nor via any other configuration - e.g.
/etc/fstab, explicit mount unit etc.), the partition flags are not
honoured for the root partition by gpt-auto-generator and one ends up
with a "ro" mounted rootfs, instead of a "rw" one.

I guess at the very least we could document that from
http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/:

"For the root, server data and home partitions the partition flag bit
60 ("read-only") may be used to mark a partition for read-only mounts
only. If set the partition will be mounted read-only instead of
read-write."

Is not implemented for root partition by gpt-auto-generator, but only
for the server data & home partitions.

-- 
Regards,

Dimitri.

Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.


More information about the systemd-devel mailing list