Tizen 2.1 base tizen_2.1 2.1b_release 2.2_release accepted/tizen_2.1/20130425.020936 submit/tizen_2.1/20130424.222909 submit/tizen_2.2/20130714.154307
authorJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:36:57 +0000 (01:36 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:36:57 +0000 (01:36 +0900)
packaging/bootmode-charging.service [new file with mode: 0644]
packaging/bootmode-graphical.service [new file with mode: 0644]
packaging/bootmode.target [new file with mode: 0644]
packaging/systemd-bootmode.changes [new file with mode: 0644]
packaging/systemd-bootmode.spec [new file with mode: 0644]

diff --git a/packaging/bootmode-charging.service b/packaging/bootmode-charging.service
new file mode 100644 (file)
index 0000000..af7cfcd
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Charging Mode
+ConditionKernelCommandLine=charger_detect_boot
+
+[Service]
+Type=oneshot
+ExecStart=/bin/systemctl isolate charging-mode.target
+
diff --git a/packaging/bootmode-graphical.service b/packaging/bootmode-graphical.service
new file mode 100644 (file)
index 0000000..de63e39
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Graphical Mode
+ConditionKernelCommandLine=!charger_detect_boot
+
+[Service]
+Type=oneshot
+ExecStart=/bin/systemctl isolate graphical.target
+
diff --git a/packaging/bootmode.target b/packaging/bootmode.target
new file mode 100644 (file)
index 0000000..5198ac9
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Boot mode selector
+Requires=basic.target
+After=basic.target
+
+[Install]
+Alias=default.target
diff --git a/packaging/systemd-bootmode.changes b/packaging/systemd-bootmode.changes
new file mode 100644 (file)
index 0000000..ab21c86
--- /dev/null
@@ -0,0 +1,2 @@
+* Wed Oct 31 2012 Yin Kangkai <kangkai.yin@intel.com> - 1
+- initial version.
diff --git a/packaging/systemd-bootmode.spec b/packaging/systemd-bootmode.spec
new file mode 100644 (file)
index 0000000..996a042
--- /dev/null
@@ -0,0 +1,44 @@
+Name:       systemd-bootmode
+Summary:    Boot mode selector for systemd
+Version:    1
+Release:    1
+Group:      System/Base
+BuildArch:  noarch
+License:    Public Domain
+Source0:    bootmode.target
+Source1:    bootmode-graphical.service
+Source2:    bootmode-charging.service
+
+Requires:pkgconfig(systemd)
+
+%description
+A extensible special boot mode mechanism for systemd. This boot mode selector
+helps systemd to dynamically decide which final target it should go during the
+booting, instead of setting the final boot target in its very begining.
+
+%install
+
+mkdir -p %{buildroot}%{_libdir}/systemd/system
+install -m 0644 %{SOURCE0} %{buildroot}%{_libdir}/systemd/system/
+install -m 0644 %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/
+install -m 0644 %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/
+
+mkdir -p %{buildroot}%{_libdir}/systemd/system/bootmode.target.wants
+ln -sf ../bootmode-graphical.service %{buildroot}%{_libdir}/systemd/system/bootmode.target.wants/bootmode-graphical.service
+ln -sf ../bootmode-charging.service %{buildroot}%{_libdir}/systemd/system/bootmode.target.wants/bootmode-charging.service
+
+%post
+cp -Pf %{_libdir}/systemd/system/default.target %{_libdir}/systemd/system/default.target.bootmode
+ln -sf %{_libdir}/systemd/system/bootmode.target %{_libdir}/systemd/system/default.target
+
+%postun
+mv -f %{_libdir}/systemd/system/default.target.bootmode %{_libdir}/systemd/system/default.target
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/systemd/system/bootmode.target
+%{_libdir}/systemd/system/bootmode-graphical.service
+%{_libdir}/systemd/system/bootmode-charging.service
+%dir %{_libdir}/systemd/system/bootmode.target.wants
+%{_libdir}/systemd/system/bootmode.target.wants/bootmode-graphical.service
+%{_libdir}/systemd/system/bootmode.target.wants/bootmode-charging.service