Add firstboot systemd service file tizen_2.1 tizen_2.2 2.1b_release 2.2.1_release 2.2_release accepted/tizen_2.1/20130425.020940 submit/tizen_2.1/20130424.222915 submit/tizen_2.2/20130714.154232
authorArron Wang <arron.wang@intel.com>
Fri, 19 Apr 2013 03:27:30 +0000 (11:27 +0800)
committerArron Wang <arron.wang@intel.com>
Fri, 19 Apr 2013 06:39:44 +0000 (14:39 +0800)
Change-Id: I2e61659132e2e8ad75ddbd391f919dcbffd154bf

etc/rc.d/rc.firstboot
packaging/system-plugin-ia-generic.spec
usr/lib/systemd/system/firstboot.service [new file with mode: 0644]
usr/lib/systemd/system/sysinit.target.wants/firstboot.service [new symlink]

index 21808d3..1c83e6b 100755 (executable)
@@ -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
index adb96ac..edf9a14 100644 (file)
@@ -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 (file)
index 0000000..5b15cb7
--- /dev/null
@@ -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 (symlink)
index 0000000..9d9ed26
--- /dev/null
@@ -0,0 +1 @@
+../firstboot.service
\ No newline at end of file