From: HyungKyu Song Date: Fri, 15 Feb 2013 15:52:31 +0000 (+0900) Subject: Tizen 2.0 Release X-Git-Tag: accepted/tizen_2.0/20130215.202458^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5a6b9a1fd5fb1e394c12d457411c1db6400ec3b;p=adaptation%2Fsystemd-bootmode.git Tizen 2.0 Release --- diff --git a/packaging/bootmode-charging.service b/packaging/bootmode-charging.service new file mode 100644 index 0000000..af7cfcd --- /dev/null +++ b/packaging/bootmode-charging.service @@ -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 index 0000000..de63e39 --- /dev/null +++ b/packaging/bootmode-graphical.service @@ -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 index 0000000..5198ac9 --- /dev/null +++ b/packaging/bootmode.target @@ -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 index 0000000..ab21c86 --- /dev/null +++ b/packaging/systemd-bootmode.changes @@ -0,0 +1,2 @@ +* Wed Oct 31 2012 Yin Kangkai - 1 +- initial version. diff --git a/packaging/systemd-bootmode.spec b/packaging/systemd-bootmode.spec new file mode 100644 index 0000000..996a042 --- /dev/null +++ b/packaging/systemd-bootmode.spec @@ -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