Merge ~smoser/cloud-initramfs-tools:fix/1890803-overlayroot-no-fstab into cloud-initramfs-tools:master
Status: | Merged |
---|---|
Merged at revision: | aea2ecf4035051a4e4faf5b5c910af887de50844 |
Proposed branch: | ~smoser/cloud-initramfs-tools:fix/1890803-overlayroot-no-fstab |
Merge into: | cloud-initramfs-tools:master |
Diff against target: |
118 lines (+59/-19) 1 file modified
overlayroot/scripts/init-bottom/overlayroot (+59/-19) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ryan Harper (community) | Approve | ||
cloud-initramfs-tools | Pending | ||
Review via email: mp+389242@code.launchpad.net |
Commit message
overlayroot: initialize /etc/fstab if root does not have one and read-only
A root filesystem may not have an /etc/fstab. That could be for either:
a.) not needed - the kernel command line has root mount options and no
other filesystems are mounted.
b.) system has systemd.mounts - this is currently not supported by
overlayroot.
If the kernel command line contains 'ro', then overlayroot will
correctly leave root mounted 'ro'. The problem was that without an
/etc/fstab, systemd would not remount the root filesystem rw, and
thus failure would ensue.
The change here is to initialize an fstab in the case that the root
filesystem did not contain one, *and* 'ro' is present on the cmdline.
In cases where 'ro' is not present, then overlayroot will leave /
mounted as rw, so systemd does not need to remount rw.
LP: #1890803
Description of the change
see commit message
Changes compared to https:/ /code.launchpad .net/~raharper/ cloud-initramfs -tools/ +git/cloud- initramfs- tools/+ merge/389177
a.) only generate "source_fstab" if read-only on kernel cmdline.
b.) debug messages and better hint left in /etc/fstab that this happened.
c.) do not read /proc/mounts, but read initramfs-provided globals and /dev/root for fstab
I'm not opposed to reading /proc/mounts, it just seems like unneccessary work.