diff options
author | Edward A. James <eajames@us.ibm.com> | 2017-08-12 23:29:59 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-29 17:46:36 +0300 |
commit | 06b5abbc33d9a47c66a5972fbd01f2d13542f70a (patch) | |
tree | baa49155d6ada9db54ec1d3b18199a70bbb0d9ad /meta-phosphor/common | |
parent | c764ee421b25b5422c61bc88a1d0db1415bee5e0 (diff) | |
download | openbmc-06b5abbc33d9a47c66a5972fbd01f2d13542f70a.tar.xz |
filesystem: mount rw and overlay
Append base-files to add new fstab and depend on mount-overlay recipe.
Add systemd services to help mounting overlay fs.
Resolves openbmc/openbmc#2134
Change-Id: Ib56fcdde9f7364fca56a08e1ce72e7cafaac35b0
Signed-off-by: Edward A. James <eajames@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common')
5 files changed, 42 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-core/base-files/base-files/fstab b/meta-phosphor/common/recipes-core/base-files/base-files/fstab new file mode 100644 index 000000000..eab105b40 --- /dev/null +++ b/meta-phosphor/common/recipes-core/base-files/base-files/fstab @@ -0,0 +1,9 @@ +# openbmc fstab + +/dev/root / auto defaults 1 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,gid=5 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 +ubi0:rwfs /var ubifs defaults 0 0 +overlay /etc overlay defaults,x-systemd.requires=prepare-overlay.service,lowerdir=/etc,upperdir=/var/persist/etc,workdir=/var/persist/etc-work 0 0 +tmpfs /var/volatile tmpfs defaults 0 0 diff --git a/meta-phosphor/common/recipes-core/base-files/base-files_%.bbappend b/meta-phosphor/common/recipes-core/base-files/base-files_%.bbappend new file mode 100644 index 000000000..d7e7a3bd3 --- /dev/null +++ b/meta-phosphor/common/recipes-core/base-files/base-files_%.bbappend @@ -0,0 +1,5 @@ +inherit obmc-phosphor-utils + +FILESEXTRAPATHS_prepend := "${@mf_enabled(d, 'obmc-ubi-fs', '${THISDIR}/${PN}:')}" + +RDEPENDS_${PN}_append += "${@mf_enabled(d, 'obmc-ubi-fs', 'mount-overlay-help')}" diff --git a/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help.bb b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help.bb new file mode 100644 index 000000000..4125fd07d --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help.bb @@ -0,0 +1,5 @@ +inherit obmc-phosphor-license + +SYSTEMD_SERVICE_${PN} = "prepare-overlay.service mount-machine-id.service" + +inherit obmc-phosphor-systemd diff --git a/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/mount-machine-id.service b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/mount-machine-id.service new file mode 100644 index 000000000..0d72f0a8e --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/mount-machine-id.service @@ -0,0 +1,14 @@ +[Unit] +Description=Mount machine-id +Requires=etc.mount +After=etc.mount +DefaultDependencies=false +ConditionPathExists=!/var/persist/etc/machine-id + +[Install] +RequiredBy=local-fs.target + +[Service] +ExecStart=/bin/sh -c "mount --bind /run/machine-id /etc/machine-id" +Type=oneshot +RemainAfterExit=no 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 new file mode 100644 index 000000000..0f48277f8 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service @@ -0,0 +1,9 @@ +[Unit] +Description=Prepare for overlay fs +RequiresMountsFor=/var +DefaultDependencies=false + +[Service] +ExecStart=/bin/sh -c "rm -rf /var/persist/etc-work && mkdir -p /var/persist/etc /var/persist/etc-work" +Type=oneshot +RemainAfterExit=no |