From: Rafal Krypa Date: Thu, 5 Jun 2014 16:05:50 +0000 (+0200) Subject: Fix mount configuration in %post X-Git-Tag: submit/tizen/20140610.111556^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a9519b183fac261f4bb0e0c33be2f9bbfa59322;p=platform%2Fadaptation%2Femulator%2Fsystem-plugin-emulator.git Fix mount configuration in %post 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 --- diff --git a/filesystem/usr/lib/systemd/system/dev-vdb.swap b/filesystem/usr/lib/systemd/system/dev-vdb.swap new file mode 100644 index 0000000..86ea802 --- /dev/null +++ b/filesystem/usr/lib/systemd/system/dev-vdb.swap @@ -0,0 +1,8 @@ +[Unit] +Description=Swap on emulator + +[Swap] +What=/dev/vdb + +[Install] +WantedBy=emulator_preinit.target diff --git a/packaging/system-plugin-emulator.spec b/packaging/system-plugin-emulator.spec index 9f2b47a..ab2dd0d 100644 --- a/packaging/system-plugin-emulator.spec +++ b/packaging/system-plugin-emulator.spec @@ -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}