From 27c402e9845488a0bb1e4ac297fceedf097d2a47 Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Mon, 30 Mar 2020 21:01:37 +0900 Subject: Add checking /opt partition is mounted If the /opt partition is not mounted, local-fs.target fails and enters emergency.target Change-Id: Ic8049c1f580463397950272f32c758792e4aca03 --- packaging/system-plugin.spec | 11 +++++++++++ units/opt.mount | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 units/opt.mount diff --git a/packaging/system-plugin.spec b/packaging/system-plugin.spec index 2ba78f8..9b8757e 100644 --- a/packaging/system-plugin.spec +++ b/packaging/system-plugin.spec @@ -9,6 +9,7 @@ Source1: %{name}.manifest Requires(post): /usr/bin/systemctl Requires(post): /usr/bin/udevadm +Requires(post): /usr/bin/sed BuildRequires: cmake BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libtzplatform-config) @@ -218,6 +219,11 @@ ln -s ../opt-usr.mount %{buildroot}%{_unitdir}/local-fs.target.wants/opt-usr.mou ln -s ../wait-mount@.service %{buildroot}%{_unitdir}/local-fs.target.wants/wait-mount@opt-usr.service ln -s ../wait-mount@.service %{buildroot}%{_userunitdir}/basic.target.wants/wait-mount@opt-usr.service +# check /opt partition +mkdir -p %{buildroot}%{_unitdir}/local-fs.target.requires +install -m 644 units/opt.mount %{buildroot}%{_unitdir} +ln -s ../opt.mount %{buildroot}%{_unitdir}/local-fs.target.requires/opt.mount + # namespace mkdir -p %{buildroot}%{_unitdir}/user@.service.d install -m 644 units/namespace.conf %{buildroot}%{_unitdir}/user@.service.d/ @@ -232,12 +238,17 @@ rm -rf %{buildroot} %post systemctl daemon-reload +%ifarch %{ix86} x86_64 +/usr/bin/sed -e 's/system-data/emulator-sysdata/g' -i /usr/lib/systemd/system/opt.mount +%endif %files %manifest %{name}.manifest %license LICENSE.Apache-2.0 %{_unitdir}/tizen-system-env.service %{_unitdir}/basic.target.wants/tizen-system-env.service +%{_unitdir}/opt.mount +%{_unitdir}/local-fs.target.requires/opt.mount %files device-spreadtrum %manifest %{name}.manifest diff --git a/units/opt.mount b/units/opt.mount new file mode 100644 index 0000000..7740345 --- /dev/null +++ b/units/opt.mount @@ -0,0 +1,16 @@ +[Unit] +Before=local-fs.target +ConditionPathIsMountPoint=!/opt + +# Tizen mounts /opt in initrd or init-wrapper +# and fsck and resizefs are also executed. +# So it is not necessary here. +# If you don't use initrd or init-wrapper, just comment it out. +#Requires=systemd-fsck@dev-disk-by\x2dlabel-system\x2ddata.service +#After=systemd-fsck@dev-disk-by\x2dlabel-system\x2ddata.service + +[Mount] +What=/dev/disk/by-label/system-data +Where=/opt +Type=ext4 +Options=defaults,relatime -- cgit v1.2.3