Add resize partition service for root file system. 19/19019/2
authorSangjung Woo <sangjung.woo@samsung.com>
Fri, 4 Apr 2014 05:37:55 +0000 (14:37 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Fri, 4 Apr 2014 08:10:01 +0000 (17:10 +0900)
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>
packaging/system-plugin-mount.spec
usr/lib/systemd/system/resize2fs-root.service [new file with mode: 0644]

index 2ab368f..55c9056 100755 (executable)
@@ -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 (file)
index 0000000..d7be3ff
--- /dev/null
@@ -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