diff options
author | Edward A. James <eajames@us.ibm.com> | 2017-10-05 17:17:45 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-10-24 13:34:27 +0000 |
commit | b94ddcc7896fe00cb79e33b39698d23713eba75b (patch) | |
tree | a8b0041d049afe74552b4969c55132e752d0be93 /meta-phosphor/common | |
parent | cd88ae0f6f6c2e570d927f49c2c9aa988c03113d (diff) | |
download | talos-openbmc-b94ddcc7896fe00cb79e33b39698d23713eba75b.tar.gz talos-openbmc-b94ddcc7896fe00cb79e33b39698d23713eba75b.zip |
Prepare-overlay service: check for mountpoint before removing workdir
The service was getting called twice, resulting in a removal of the
overlayfs workdir while the overlay was mounted. Solve this by checking
if the /etc overlay is mounted yet before removing the workdir. Need to
add mountpoint to busybox for this.
Resolves openbmc/openbmc#2429
Change-Id: I407a07dcc3f3856af12a7f3a52966fe7c3d756c3
Signed-off-by: Edward A. James <eajames@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common')
3 files changed, 3 insertions, 1 deletions
diff --git a/meta-phosphor/common/recipes-core/busybox/busybox/mountpoint.cfg b/meta-phosphor/common/recipes-core/busybox/busybox/mountpoint.cfg new file mode 100644 index 000000000..8b009511a --- /dev/null +++ b/meta-phosphor/common/recipes-core/busybox/busybox/mountpoint.cfg @@ -0,0 +1 @@ +CONFIG_MOUNTPOINT=y diff --git a/meta-phosphor/common/recipes-core/busybox/busybox_%.bbappend b/meta-phosphor/common/recipes-core/busybox/busybox_%.bbappend index 39a6033f7..e6678fc8a 100644 --- a/meta-phosphor/common/recipes-core/busybox/busybox_%.bbappend +++ b/meta-phosphor/common/recipes-core/busybox/busybox_%.bbappend @@ -1,4 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://busybox.cfg" SRC_URI += "file://flash.cfg" +SRC_URI += "file://mountpoint.cfg" SRC_URI += "file://0001-Stop-watchdog-first-on-startup.patch" diff --git a/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service index ae5f4617c..66843b32c 100644 --- a/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service +++ b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service @@ -4,6 +4,6 @@ RequiresMountsFor=/var DefaultDependencies=false [Service] -ExecStart=/bin/sh -c "rm -rf /var/persist/etc-work && mkdir -p /var/persist/etc /var/persist/etc-work /var/persist/home/root" +ExecStart=/bin/sh -c "if ! mountpoint /etc; then rm -rf /var/persist/etc-work && mkdir -p /var/persist/etc-work; fi; mkdir -p /var/persist/etc /var/persist/home/root" Type=oneshot RemainAfterExit=no |