Openembedded Core Discussions
 help / color / mirror / Atom feed
* Initial review of ChenQi/read-only-rootfs-in-live-images
@ 2013-08-02 15:50 Chris Larson
  2013-08-05  2:18 ` ChenQi
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Larson @ 2013-08-02 15:50 UTC (permalink / raw)
  To: ChenQi; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2711 bytes --]

Greetings,

Nice work on this branch. The bind based approach seems clean. I do have
some comments:

- I think the read-only-rootfs-hook stuff, at least the bind mounting piece
at a minimum, belongs in a separate script in ${sbindir} rather than within
the startup script itself. This will ease adding support for r/o to systemd
images.
- I think we should consider having an additional script which unmounts the
binds in reverse order, in case the binds prevent unmounting of the
partitions in which they live, potentially causing an unclean shutdown.
- The irda read only bits aren't necessary, it seems. The startup script
writes to /etc/sysconfig/ if its config file doesn't already exist, as a
mechanism of handling default configuration. This is a terrible way to
handle that, and sysconfig is a redhatism, not the way we do things in our
distros. I have a commit I'll submit a patch for to resolve this by fixing
up the startup script.
- I think we should enhance the copy part of the bind script in two ways:
    - cp from/. to/ -> this ensures it will copy hidden directories as
well, which the wildcard does not
    - handle bind mounts of files as well as directories
- I also think the mount script should support mount options, making the
config files essentially a subset of the filesystem table in fstab. There
are cases where there's value in using options with bind mounts, and it'd
make the scripts potentially more generally useful.
- I think we should split out the mount and unmount scripts, along with
default configuration, into a separate recipe which inherits update-rc.d,
and which gets pulled into IMAGE_INSTALL by image.bbclass only when
read-only-rootfs is in IMAGE_FEATURES. This means we'd need less
conditional "if this is r/o" code in the scripts, as we could rely on it
being installed in r/o images, and not in others.

As an aside, I looked into libmount's previous support of fstab.d, it
appears using util-linux's libmount-based mount is supposed to support
passing a directory to its -T/--fstab= argument, which would let us offload
the work to it if we use a real mount binary, but it seems that this
directory argument support doesn't work anyway, and of course by doing that
we'd suck in additional deps, so maybe it's for the best :)

Thoughts? I have prototype mount-binds and unmount-binds shell scripts here
which implement the aforementioned suggestions, but I wanted to throw my
thoughts out to the list for comments before proceeding any further.

Thanks,
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 3010 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-05  3:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-02 15:50 Initial review of ChenQi/read-only-rootfs-in-live-images Chris Larson
2013-08-05  2:18 ` ChenQi
2013-08-05  3:30   ` ChenQi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox