summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2013-04-19 11:27:30 +0800
committerArron Wang <arron.wang@intel.com>2013-04-19 14:39:44 +0800
commit68dd51c9638a830f4a6c9f4de7c97b7bba763127 (patch)
tree5a036508fa010a6f54bb1c0938fdc40946490e97
parent065b2ee3932826c979b310e12b84052b6b97071c (diff)
downloadsystem-plugin-ia-generic-tizen_2.1.tar.gz
system-plugin-ia-generic-tizen_2.1.tar.bz2
system-plugin-ia-generic-tizen_2.1.zip
Change-Id: I2e61659132e2e8ad75ddbd391f919dcbffd154bf
-rwxr-xr-xetc/rc.d/rc.firstboot2
-rw-r--r--packaging/system-plugin-ia-generic.spec16
-rw-r--r--usr/lib/systemd/system/firstboot.service11
l---------usr/lib/systemd/system/sysinit.target.wants/firstboot.service1
4 files changed, 30 insertions, 0 deletions
diff --git a/etc/rc.d/rc.firstboot b/etc/rc.d/rc.firstboot
index 21808d3..1c83e6b 100755
--- a/etc/rc.d/rc.firstboot
+++ b/etc/rc.d/rc.firstboot
@@ -38,4 +38,6 @@ chown -R root:soundpath /opt/etc/sound/default
if [ -e /opt/system/csc/.factoryreset ]; then
rm -f /opt/system/csc/.factoryreset
fi
+
+touch /opt/etc/.firstboot
sync
diff --git a/packaging/system-plugin-ia-generic.spec b/packaging/system-plugin-ia-generic.spec
index adb96ac..edf9a14 100644
--- a/packaging/system-plugin-ia-generic.spec
+++ b/packaging/system-plugin-ia-generic.spec
@@ -10,6 +10,10 @@ Source1001: packaging/system-plugin-ia-generic.manifest
# << gbp-patch-tags # auto-added by gbp
Requires: udev
Requires: corewatcher
+Requires: systemd
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
ExclusiveArch: %ix86 x86_64
@@ -32,6 +36,16 @@ install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/
install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/
install -m 0755 scripts/bt-set-addr.sh %{buildroot}%{_prefix}/etc/bluetooth/
+%post
+systemctl daemon-reload
+systemctl restart firstboot.service
+
+%preun
+systemctl stop firstboot.service
+
+%postun
+systemctl daemon-reload
+
%files
%manifest system-plugin-ia-generic.manifest
/etc/fstab
@@ -46,6 +60,8 @@ install -m 0755 scripts/bt-set-addr.sh %{buildroot}%{_prefix}/etc/bluetooth/
/etc/rc.d/rc.sysinit
/etc/rc.d/rc.*
/usr/bin/wlan.sh
+/usr/lib/systemd/system/firstboot.service
+/usr/lib/systemd/system/sysinit.target.wants/firstboot.service
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
diff --git a/usr/lib/systemd/system/firstboot.service b/usr/lib/systemd/system/firstboot.service
new file mode 100644
index 0000000..5b15cb7
--- /dev/null
+++ b/usr/lib/systemd/system/firstboot.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=firstboot configuration service
+After=udev.service
+ConditionPathExists=!/opt/etc/.firstboot
+
+[Service]
+Type=oneshot
+ExecStart=/etc/rc.d/rc.firstboot
+
+[Install]
+WantedBy=sysinit.target
diff --git a/usr/lib/systemd/system/sysinit.target.wants/firstboot.service b/usr/lib/systemd/system/sysinit.target.wants/firstboot.service
new file mode 120000
index 0000000..9d9ed26
--- /dev/null
+++ b/usr/lib/systemd/system/sysinit.target.wants/firstboot.service
@@ -0,0 +1 @@
+../firstboot.service \ No newline at end of file