summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangjung Woo <sangjung.woo@samsung.com>2014-04-04 14:37:55 +0900
committerSangjung Woo <sangjung.woo@samsung.com>2014-04-04 17:10:01 +0900
commit81dfdec205404aec43d3a32d66ed2df13d2e51b9 (patch)
tree4ee2d9e27eeb0da4150bb6509589e31ce4ef05de
parent04f5d4e7a95b9f275b927814de704a53fba6518e (diff)
downloadsystem-plugin-mount-81dfdec205404aec43d3a32d66ed2df13d2e51b9.tar.gz
system-plugin-mount-81dfdec205404aec43d3a32d66ed2df13d2e51b9.tar.bz2
system-plugin-mount-81dfdec205404aec43d3a32d66ed2df13d2e51b9.zip
Add resize partition service for root file system.
When booting the device at first time, the root partition should be extended by using resize2fs command. Change-Id: Ia16fd837a6c78b3d3b49e1d9bf20a7c9afef6c63 Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
-rwxr-xr-xpackaging/system-plugin-mount.spec6
-rw-r--r--usr/lib/systemd/system/resize2fs-root.service16
2 files changed, 22 insertions, 0 deletions
diff --git a/packaging/system-plugin-mount.spec b/packaging/system-plugin-mount.spec
index 2ab368f..55c9056 100755
--- a/packaging/system-plugin-mount.spec
+++ b/packaging/system-plugin-mount.spec
@@ -28,6 +28,10 @@ cp -a etc usr bin %{buildroot}
mkdir -p %{buildroot}/usr/share/license
cp -f LICENSE %{buildroot}/usr/share/license/%{name}
+#resize2fs service file for systemd
+install -m0755 -d %{buildroot}%{_unitdir}/local-fs.target.wants
+ln -s ../resize2fs-root.service %{buildroot}%{_unitdir}/local-fs.target.wants/resize2fs-root.service
+
%files
/bin/with-dev-root-do
/etc/fta_version.txt
@@ -35,3 +39,5 @@ cp -f LICENSE %{buildroot}/usr/share/license/%{name}
/usr/bin/save_blenv
/bin/check-booting-mode.sh
/usr/share/license/%{name}
+%{_unitdir}/resize2fs-root.service
+%{_unitdir}/local-fs.target.wants/resize2fs-root.service
diff --git a/usr/lib/systemd/system/resize2fs-root.service b/usr/lib/systemd/system/resize2fs-root.service
new file mode 100644
index 0000000..d7be3ff
--- /dev/null
+++ b/usr/lib/systemd/system/resize2fs-root.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Resize of File System on the Root Device
+DefaultDependencies=no
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+Before=systemd-remount-fs.service local-fs.target shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=no
+ExecStartPre=/bin/mount -o remount,rw /
+ExecStart=/bin/with-dev-root-do /sbin/resize2fs
+ExecStartPost=/bin/ln -s /dev/null /etc/systemd/system/resize2fs-root.service
+ExecStartPost=/bin/mount -o remount /
+StandardOutput=journal+console
+TimeoutSec=0