From: Jinkun Jang Date: Tue, 12 Mar 2013 16:36:57 +0000 (+0900) Subject: Tizen 2.1 base X-Git-Tag: 2.1b_release X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2F2.1b_release;p=adaptation%2Fsystemd-bootmode.git Tizen 2.1 base --- 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