I attached a patch, illustrating changes I propose.
I amended "recurse" option so that it take a regexp of filesystem names to work 
on, besides old values "0" and "1". That is, old values keep their meaning, but 
if recurese is set to something like "boot|backup" it will work only on those 
filesystems.

I tested with option
`overlayroot="tmpfs:swap=1,recurse=boot|backup,driver=overlay"`. It
works for me, but I don't know other use cases, for which people use
this package and cannot properly test them, obviously. Also, reusing
"recurse" option though simple, but may be questionable by someone. So,
see the patch as an illustration of idea, not as a completed solution.

Also, I found that "overlayroot-chroot" did not mount separate /var
partition and without it apt/dpkg failed to properly remove packages. I
added "var" into list of filesystems which "overlayroot-chroot" binds
before executing chroot. This is also may be not inline with original
design, but I just don't know how to properly deal with it.

With these modifications package works for me, but still is not quite
perfect solution for my goal. Which is to protect /, /boot and /backup
partitions of my laptop from incidental modifications, but leave /home,
/var, /swap and /tmp partitions in rw mode. I do not want to mount all
partitions as a single /, because I have SDD+HDD and partitions should
be on different drives (for example, / is on SDD and /var - on HDD).
Also I do not want to mount my /home as ro. And in my tests I even was
not able to boot with read-only /var. With my modifications and settings
I can boot and work with system almost normally, except that incidental
attempt to remove package without "overlay-chroot" can modify dpkg's
database (which is on rw /var), though / and /boot are protected and
restored after reboot alright. Alas, it leaves system in a half-damaged
state. I'd appreciate some idea to prevent this. But, probably, just an
alias will do.

** Patch added: "0001-Allow-to-list-affected-filesystems-in-recurse.patch"
   
https://bugs.launchpad.net/ubuntu/+source/cloud-initramfs-tools/+bug/1758389/+attachment/5089305/+files/0001-Allow-to-list-affected-filesystems-in-recurse.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1758389

Title:
  List of partitions for overlayroot

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-initramfs-tools/+bug/1758389/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to