Fix mount configuration in %post 48/22548/1 tizen_3.0.m14.2_ivi accepted/tizen/common/20140610.160608 accepted/tizen/ivi/20140614.134851 accepted/tizen/ivi/20140619.124151 submit/tizen/20140610.111556 submit/tizen_common/20140610.111721 submit/tizen_common/20140610.113616 submit/tizen_common/20140918.063644 submit/tizen_ivi/20140610.132733 submit/tizen_ivi/20140918.063638 tizen_3.0.m14.2_ivi_release
authorRafal Krypa <r.krypa@samsung.com>
Thu, 5 Jun 2014 16:05:50 +0000 (18:05 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 5 Jun 2014 16:10:49 +0000 (18:10 +0200)
This package used to add three entries to /etc/fstab:

1. Bind mount of /opt/var to /var.
On Common it breaks the system, because /opt/var exists and contains only
few files. On IVI it's useless, because /opt/var doesn't exist.
On Mobile /opt/var is a hardlink to /opt, so it does nothing.
Removing this mount config.

2. Tmpfs mount for /tmp
This is useless on all profiles, because systemd already does that. And it
does it better, because it specifies more options, like Smack label.
Removing this mount config.

3. Swap on /dev/vdb
This works OK. for Common and Mobile. But IVI comes with no /etc/fstab, so
it doesn't get the swap.
Converting this mount config to systemd unit file.

Change-Id: Ic401f5ccb438fe2c17490247c6ef269de7820e13
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
filesystem/usr/lib/systemd/system/dev-vdb.swap [new file with mode: 0644]
packaging/system-plugin-emulator.spec

diff --git a/filesystem/usr/lib/systemd/system/dev-vdb.swap b/filesystem/usr/lib/systemd/system/dev-vdb.swap
new file mode 100644 (file)
index 0000000..86ea802
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Swap on emulator
+
+[Swap]
+What=/dev/vdb
+
+[Install]
+WantedBy=emulator_preinit.target
index 9f2b47a..ab2dd0d 100644 (file)
@@ -43,6 +43,7 @@ mkdir -p %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants
 ln -s %{systemd_dir}/system/emul-setup-audio-volume.service %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/
 ln -s %{systemd_dir}/system/emul-mount-hostdir.service %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/
 ln -s %{systemd_dir}/system/emul-common-preinit.service %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/
+ln -s %{systemd_dir}/system/dev-vdb.swap %{buildroot}/%{systemd_dir}/system/emulator_preinit.target.wants/
 # for emulator.target
 mkdir -p %{buildroot}/%{systemd_dir}/system/multi-user.target.wants
 ln -s %{systemd_dir}/system/emulator.target %{buildroot}/%{systemd_dir}/system/multi-user.target.wants/
@@ -55,14 +56,6 @@ mkdir -p %{buildroot}/mnt/host
 mkdir -p %{buildroot}/usr/share/license
 cp LICENSE %{buildroot}/usr/share/license/%{name}
 
-%post
-#make fstab
-if [ -e /etc/fstab ]; then
-       echo "/opt/var   /var      bind    bind             0 0" >> /etc/fstab
-       echo "/tmpfs     /tmp      tmpfs   defaults         0 0" >> /etc/fstab
-       echo "/dev/vdb   swap      swap    defaults         0 0" >> /etc/fstab
-fi
-
 %files
 /etc/emulator/setup-audio-volume.sh
 /etc/emulator/mount-hostdir.sh
@@ -86,9 +79,11 @@ fi
 /usr/lib/systemd/system/emul-setup-audio-volume.service
 /usr/lib/systemd/system/emul-mount-hostdir.service
 /usr/lib/systemd/system/emul-common-preinit.service
+/usr/lib/systemd/system/dev-vdb.swap
 /usr/lib/systemd/system/emulator_preinit.target.wants/emul-setup-audio-volume.service
 /usr/lib/systemd/system/emulator_preinit.target.wants/emul-mount-hostdir.service
 /usr/lib/systemd/system/emulator_preinit.target.wants/emul-common-preinit.service
+/usr/lib/systemd/system/emulator_preinit.target.wants/dev-vdb.swap
 /usr/lib/udev/rules.d/95-tizen-emulator.rules
 %dir /mnt/host
 /usr/share/license/%{name}