In text mode we are running /usr/bin/setup. We still need to check /etc/sysconfig/firstboot if it should run. --- firstboot.spec | 1 + progs/firstboot-text | 37 +++++++++++++++++++++++++++++++++++++ setup.py | 2 +- systemd/firstboot-text.service | 3 ++- 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100755 progs/firstboot-text diff --git a/firstboot.spec b/firstboot.spec index 8510489..8172b22 100644 --- a/firstboot.spec +++ b/firstboot.spec @@ -94,6 +94,7 @@ fi %dir %{_datadir}/firstboot/themes/default %{python_sitelib}/* %{_sbindir}/firstboot +%{_sbindir}/firstboot-text %{_datadir}/firstboot/modules/create_user.py* %{_datadir}/firstboot/modules/date.py* %{_datadir}/firstboot/modules/eula.py* diff --git a/progs/firstboot-text b/progs/firstboot-text new file mode 100755 index 0000000..36ea718 --- /dev/null +++ b/progs/firstboot-text @@ -0,0 +1,37 @@ +#! /usr/bin/env python + +# +# firstboot-text +# +# Copyright (C) 2011 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# Red Hat Author(s): Martin Gracik <mgracik@xxxxxxxxxx> +# + +import os +import sys + +if __name__ == '__main__': + if os.path.isfile('/etc/sysconfig/firstboot'): + with open('/etc/sysconfig/firstboot') as fobj: + for line in fobj: + if line.strip() == 'RUN_FIRSTBOOT=NO': + os.system('systemctl stop firstboot-graphical.service > /dev/null 2>&1') + os.system('systemctl stop firstboot-text.service > /dev/null 2>&1') + sys.exit(0) + + # run setup + os.system('/usr/bin/setup') diff --git a/setup.py b/setup.py index f97000d..9bcb6a7 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from distutils.core import setup from glob import * import os -data_files = [('/usr/sbin', ['progs/firstboot']), +data_files = [('/usr/sbin', ['progs/firstboot', 'progs/firstboot-text']), ('/usr/share/firstboot/themes/default', glob('themes/default/*.png')), ('/usr/share/firstboot/modules', glob('modules/*.py')), diff --git a/systemd/firstboot-text.service b/systemd/firstboot-text.service index 7bbd90c..843f44a 100644 --- a/systemd/firstboot-text.service +++ b/systemd/firstboot-text.service @@ -6,7 +6,8 @@ Conflicts=firstboot-graphical.service plymouth-quit.service [Service] Type=oneshot -ExecStart=/usr/bin/setup +ExecStartPre=-/bin/plymouth quit +ExecStart=/usr/sbin/firstboot-text ExecStartPost=/bin/systemctl disable firstboot-graphical.service firstboot-text.service TimeoutSec=0 RemainAfterExit=yes -- 1.7.3.2 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list