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

Lennart Poettering lennart at poettering.net
Tue Feb 3 08:24:22 PST 2015


On Tue, 03.02.15 16:11, Dimitri John Ledkov (dimitri.j.ledkov at intel.com) wrote:

> > 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.

Well, I'd claim it *is* honoured... After all the flag is called
"read-only", and hence when set it ensures that things are read-only,
but it doesn't make any claim about what happens when writable... But
of course, that's nitpicking... ;-)

Maybe we should turn the gpt part flags into a tri-state, by adding a
second bit to it:

  00 → default behaviour, which means ro for root parts, rw for other parts
  10 → always read-only, regardless if root or not
  01 → always writable, regardless if root or not

And the existing bit would be the first of the two bits
above. Combination 11 would be invalid, but treated as 00 for now...

And the kernel options "ro" and "rw" would always override the flags
for the root disk, and so would fstab.

Would that work for you?

Would be happy to take a patch for this!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list