summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-02-01 12:59:03 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-02-01 12:59:03 +0900
commit0b77ef0ca521bff93f79a601ed70bb0d10469bdf (patch)
tree9745e82e0dd3937e8d8112e9a46adc453e0a7b03
parent5933cdfc9f3bb8a729e8136662782884afc9e205 (diff)
downloadsystem-plugin-exynos-tizen_2.3_release.tar.gz
system-plugin-exynos-tizen_2.3_release.tar.bz2
system-plugin-exynos-tizen_2.3_release.zip
-rw-r--r--Makefile.am11
-rw-r--r--conf/fstab3
-rw-r--r--packaging/system-plugin-exynos.spec5
-rw-r--r--scripts/resize2fs_by_partlabel.sh17
-rw-r--r--units/fsck@.service13
-rw-r--r--units/opt-system-csc.mount4
-rw-r--r--units/opt-usr.mount4
-rw-r--r--units/opt.mount4
-rw-r--r--units/resize2fs-root.service12
-rw-r--r--units/resize2fs@.service14
10 files changed, 79 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index 652e69c..2047081 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -83,7 +83,8 @@ INSTALL_EXEC_HOOKS += \
install-target-wants-hook
bin_SCRIPTS += \
- scripts/cpu-governor.sh
+ scripts/cpu-governor.sh \
+ scripts/resize2fs_by_partlabel.sh
sysconf_DATA += \
conf/fstab
@@ -101,10 +102,14 @@ endif
systemunit_DATA += \
units/usr-share-locale.mount \
- units/cpu-governor.service
+ units/fsck@.service \
+ units/resize2fs@.service \
+ units/cpu-governor.service \
+ units/resize2fs-root.service
LOCAL_FS_TARGET_WANTS += \
- usr-share-locale.mount
+ usr-share-locale.mount \
+ resize2fs-root.service
DEFAULT_TARGET_WANTS += \
cpu-governor.service
diff --git a/conf/fstab b/conf/fstab
index 11f906d..bb304ac 100644
--- a/conf/fstab
+++ b/conf/fstab
@@ -24,5 +24,4 @@ tmpfs /tmp tmpfs comment=havefs-smackfs-s
# For new partition - 2012/06/26 add csa partition.
/dev/disk/by-partlabel/rootfs / ext4 ro 0 1
-/dev/disk/by-partlabel/system-data /opt ext4 errors=panic,nosuid 0 2
-/dev/disk/by-partlabel/user /opt/usr ext4 errors=panic,nofail,nosuid 0 2
+/dev/disk/by-partlabel/module /lib/modules ext4 ro 0 2
diff --git a/packaging/system-plugin-exynos.spec b/packaging/system-plugin-exynos.spec
index 99e247e..105f08d 100644
--- a/packaging/system-plugin-exynos.spec
+++ b/packaging/system-plugin-exynos.spec
@@ -65,11 +65,16 @@ cat LICENSE > $RPM_BUILD_ROOT%{_datadir}/license/%{name}
%{_datadir}/license/%{name}
%{_sysconfdir}/fstab
%{_bindir}/cpu-governor.sh
+%{_bindir}/resize2fs_by_partlabel.sh
%{_libdir}/udev/rules.d/51-tizen-system-plugin.rules
# systemd service units
%{_libdir}/systemd/system/cpu-governor.service
%{_libdir}/systemd/system/default.target.wants/cpu-governor.service
+%{_libdir}/systemd/system/fsck@.service
+%{_libdir}/systemd/system/resize2fs@.service
+%{_libdir}/systemd/system/resize2fs-root.service
+%{_libdir}/systemd/system/local-fs.target.wants/resize2fs-root.service
# systemd mount units
%{_libdir}/systemd/system/usr-share-locale.mount
diff --git a/scripts/resize2fs_by_partlabel.sh b/scripts/resize2fs_by_partlabel.sh
new file mode 100644
index 0000000..455d5a6
--- /dev/null
+++ b/scripts/resize2fs_by_partlabel.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ ! -n "$1" ]
+then
+ exit 1
+fi
+
+EMMC_DEVICE="/dev/mmcblk0"
+RET_PARTX=$(/usr/sbin/partx -s ${EMMC_DEVICE})
+PARTITION=${EMMC_DEVICE}p$(IFS=; echo $RET_PARTX | /bin/awk -v part=$1 'tolower($6) == part {print $1}')
+
+if [ ${EMMC_DEVICE}p != ${PARTITION} ]
+then
+ /sbin/resize2fs -f ${PARTITION}
+ exit 0
+fi
+exit 1
diff --git a/units/fsck@.service b/units/fsck@.service
new file mode 100644
index 0000000..f70d1d4
--- /dev/null
+++ b/units/fsck@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=File System Check on %f
+DefaultDependencies=no
+BindsTo=%i.device
+After=%i.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=/sbin/e2fsck -y -f %f
+StandardOutput=journal+console
+TimeoutSec=0
+SuccessExitStatus=0 1
diff --git a/units/opt-system-csc.mount b/units/opt-system-csc.mount
index 4969845..2b1a500 100644
--- a/units/opt-system-csc.mount
+++ b/units/opt-system-csc.mount
@@ -1,7 +1,9 @@
[Unit]
+Description=Mount to /opt/system/csc
DefaultDependencies=no
Before=local-fs.target
-After=local-fs-pre.target
+After=local-fs-pre.target fsck@dev-disk-by\x2dpartlabel-csc.service resize2fs@dev-disk-by\x2dpartlabel-csc.service
+Wants=resize2fs@dev-disk-by\x2dpartlabel-csc.service
[Mount]
What=/dev/disk/by-partlabel/csc
diff --git a/units/opt-usr.mount b/units/opt-usr.mount
index 53938ca..70912ff 100644
--- a/units/opt-usr.mount
+++ b/units/opt-usr.mount
@@ -1,8 +1,10 @@
[Unit]
+Description=Mount to /opt/usr
DefaultDependencies=no
ConditionPathExists=!/opt/etc/.odeprogress
Before=local-fs.target
-After=local-fs-pre.target
+After=local-fs-pre.target fsck@dev-disk-by\x2dpartlabel-user.service resize2fs@dev-disk-by\x2dpartlabel-user.service
+Wants=resize2fs@dev-disk-by\x2dpartlabel-user.service
[Mount]
What=/dev/disk/by-partlabel/user
diff --git a/units/opt.mount b/units/opt.mount
index e1302b7..e4a2201 100644
--- a/units/opt.mount
+++ b/units/opt.mount
@@ -1,7 +1,9 @@
[Unit]
+Description=Mount to /opt
DefaultDependencies=no
Before=local-fs.target
-After=local-fs-pre.target
+After=local-fs-pre.target fsck@dev-disk-by\x2dpartlabel-system\x2ddata.service resize2fs@dev-disk-by\x2dpartlabel-system\x2ddata.service
+Wants=resize2fs@dev-disk-by\x2dpartlabel-system\x2ddata.service
[Mount]
What=/dev/disk/by-partlabel/system-data
diff --git a/units/resize2fs-root.service b/units/resize2fs-root.service
new file mode 100644
index 0000000..8b8a899
--- /dev/null
+++ b/units/resize2fs-root.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Resize of File System on the Root Device
+DefaultDependencies=no
+Before=local-fs.target shutdown.target
+
+[Service]
+Type=oneshot
+ExecStartPre=/bin/mount -o remount,rw /
+ExecStart=/bin/bash -c "/usr/bin/resize2fs_by_partlabel.sh rootfs"
+ExecStartPost=/bin/ln -s /dev/null /etc/systemd/system/resize2fs-root.service
+StandardOutput=journal+console
+TimeoutSec=0
diff --git a/units/resize2fs@.service b/units/resize2fs@.service
new file mode 100644
index 0000000..e761df5
--- /dev/null
+++ b/units/resize2fs@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Resize of File System on %f
+DefaultDependencies=no
+BindsTo=%i.device
+After=fsck@%i.service
+Requires=fsck@%i.service
+Before=local-fs.target shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=/sbin/resize2fs -f %f
+ExecStartPost=/bin/ln -s /dev/null /etc/systemd/system/resize2fs@%i.service
+StandardOutput=journal+console
+TimeoutSec=0