From acc58bce1af8b9f50aa0221f00cfbaf19b5a9fee Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:16:31 +0000 Subject: import firstboot-19.9-8.el7 --- diff --git a/SOURCES/0001-Disable-firstboot-graphical-service-at-the-end-10913.patch b/SOURCES/0001-Disable-firstboot-graphical-service-at-the-end-10913.patch new file mode 100644 index 0000000..ca0b058 --- /dev/null +++ b/SOURCES/0001-Disable-firstboot-graphical-service-at-the-end-10913.patch @@ -0,0 +1,42 @@ +From 58abb4d88f2166e77f71fe1e6b59aaaafae8ca82 Mon Sep 17 00:00:00 2001 +From: Vratislav Podzimek +Date: Fri, 25 Apr 2014 12:47:47 +0200 +Subject: Disable firstboot-graphical service at the end (#1091317) + +There's no point in running the service again and again on every single boot +for it only to find out it shouldn't actually run. + +Signed-off-by: Vratislav Podzimek +Signed-off-by: Martin Kolman +--- + progs/firstboot | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/progs/firstboot b/progs/firstboot +index 3d9c5e9..ba57ca6 100755 +--- a/progs/firstboot ++++ b/progs/firstboot +@@ -119,6 +119,10 @@ if __name__ == '__main__': + 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') ++ ++ # disable the service so that it doesn't run on every boot just to find ++ # out it should kill itself ++ os.system("systemctl disable firstboot-graphical.service") + sys.exit(0) + + if not opts.module_dir: +@@ -178,5 +182,9 @@ if __name__ == '__main__': + except OSError: + pass + ++ # disable the service so that it doesn't run on every boot just to find ++ # out it should kill itself ++ os.system("systemctl disable firstboot-graphical.service") ++ + if reboot_required: + os.system("/sbin/reboot") +-- +1.9.3 + diff --git a/SOURCES/0002-Fix-exception-handling-952633.patch b/SOURCES/0002-Fix-exception-handling-952633.patch new file mode 100644 index 0000000..ab10ed2 --- /dev/null +++ b/SOURCES/0002-Fix-exception-handling-952633.patch @@ -0,0 +1,68 @@ +From 12167a02350e15ecde7a156c9425c068acba7051 Mon Sep 17 00:00:00 2001 +From: Martin Kolman +Date: Thu, 18 Sep 2014 15:57:10 +0200 +Subject: [PATCH] Fix exception handling (#952633) + +Provide python-meh and libreport with correctly formated data +and dump broken interactive console error reporting. + +Resolves: rhbz#952633 +Signed-off-by: Martin Kolman +--- + progs/firstboot | 26 ++++++++++++++++---------- + 1 file changed, 16 insertions(+), 10 deletions(-) + +diff --git a/progs/firstboot b/progs/firstboot +index ba57ca6..f690a86 100755 +--- a/progs/firstboot ++++ b/progs/firstboot +@@ -53,7 +53,11 @@ def exception_handler(type, value, tb, obj): + meh_conf = meh.Config(programName='firstboot', + programVersion='@VERSION@') + +- dump_obj = meh.dump.ExceptionDump((type, value, tb), meh_conf) ++ # python-meh expects the exception data in a named tuple ++ ExcInfo = namedtuple("ExcInfo", ["type", "value", "stack"]) ++ exc_info = ExcInfo(type, value, tb) ++ ++ dump_obj = meh.dump.ReverseExceptionDump(exc_info, meh_conf) + exn_dump = dump_obj.traceback_and_object_dump(obj) + + fd, path = tempfile.mkstemp(prefix='firstboot-tb-') +@@ -66,6 +70,17 @@ def exception_handler(type, value, tb, obj): + params = dict() + params.update(dump_obj.environment_info) + ++ # turn the python-meh package info to a key/value pairs ++ pkg_info = params.pop("pkg_info", None) ++ if pkg_info: ++ params["pkg_name"] = pkg_info.name ++ params["pkg_version"] = pkg_info.version ++ params["pkg_release"] = pkg_info.release ++ params["pkg_epoch"] = pkg_info.epoch ++ params["pkg_arch"] = pkg_info.arch ++ params["package"] = "%s-%s-%s.%s" % (pkg_info.name, pkg_info.version, ++ pkg_info.release, pkg_info.arch) ++ + params.setdefault('component', 'firstboot') + params.setdefault('package', 'firstboot-@VERSION@') + +@@ -80,15 +95,6 @@ def exception_handler(type, value, tb, obj): + + problem_data.create_dump_dir(ABRT_DIR) + +- print _('Unhandled exception in firstboot occured.') +- print _('Bugreport directory was created and once you login, ABRT should\n' +- 'let you file a bug. (Don\'t forget to check "Show all problems")') +- answer = raw_input (_('Do you want to start /usr/bin/setup so that you can\n' +- 'create your user account? [Y/n] ')) +- +- if not answer.lower() in [_('n'), _('no')]: +- os.system('/usr/bin/setup') +- + + if __name__ == '__main__': + # set up exception handling first +-- +1.9.3 + diff --git a/SOURCES/0003-Replace-Finish-with-Done-on-the-next-button-1107887.patch b/SOURCES/0003-Replace-Finish-with-Done-on-the-next-button-1107887.patch new file mode 100644 index 0000000..b1b91ce --- /dev/null +++ b/SOURCES/0003-Replace-Finish-with-Done-on-the-next-button-1107887.patch @@ -0,0 +1,57 @@ +From f8b8191dcc340e237a23580c60a72382cb68f596 Mon Sep 17 00:00:00 2001 +From: Martin Kolman +Date: Fri, 26 Sep 2014 14:02:02 +0200 +Subject: [PATCH] Replace Finish with Done on the next button (#1107887) + +By default Firstboot displays the "Forward" label on the next-button +if there are any modules following the current module. + +Once it reaches the last module, it currently tries to decide +if it should show keep the "Forward" label or switch to the +"Finish" label due to the given screen being the last. + +Unfortunately, some multi-page modules, such as Subscription Manager +do not provide any feedback to Firstboot if the given page is the last page. + One Subscription Manager page even has a combo box that decides if the module quits +or continues to the next page and there is no feedback provided about +this. + +The lack of feedback is not an issue if such a module is not the last +one as all the labels would just be "Forward", but if the module is the +last one as the only one, Firstboot does not have enough information +to decide which label to use. + +Given the lack of any other option, just set the next button label to +"Done" for all pages on the last (or possibly only) Firstboot module. + +Resolves: rhbz#1107887 +Signed-off-by: Martin Kolman +--- + firstboot/interface.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/firstboot/interface.py b/firstboot/interface.py +index 6fda66d..60d4800 100644 +--- a/firstboot/interface.py ++++ b/firstboot/interface.py +@@ -87,7 +87,7 @@ class Interface(object): + + # If we were previously on the last page, we need to set the Next + # button's label back to normal. +- if self.nextButton.get_label() == _("_Finish"): ++ if self.nextButton.get_label() == _("_Done"): + self.nextButton.set_label("gtk-go-forward") + + self._control.currentPage = self._control.history.pop() +@@ -163,7 +163,7 @@ class Interface(object): + # ModuleSet), it's time to kill the interface. + if len(self._controlStack) == 1: + if self._control.currentPage == len(self.moduleList)-1: +- self.nextButton.set_label(_("_Finish")) ++ self.nextButton.set_label(_("_Done")) + elif self._control.currentPage == len(self.moduleList): + self.checkReboot() + self.destroy() +-- +1.9.3 + diff --git a/SOURCES/0004-Handle-next-button-naming-also-if-there-is-only-one-.patch b/SOURCES/0004-Handle-next-button-naming-also-if-there-is-only-one-.patch new file mode 100644 index 0000000..51867a5 --- /dev/null +++ b/SOURCES/0004-Handle-next-button-naming-also-if-there-is-only-one-.patch @@ -0,0 +1,43 @@ +From 6e6a398e253772c043590183d7c036d1449e0025 Mon Sep 17 00:00:00 2001 +From: Martin Kolman +Date: Mon, 29 Sep 2014 17:01:18 +0200 +Subject: [PATCH] Handle next button naming also if there is only one module + (#1107887) + +Due to how multi-page modules work (they return FAILURE on apply() to +prevent Firstboot from switching to the next module) the code that +changes the next button label will be never called if there is only +a single multi-page module in Firstboot. + +So check if the label change is needed even if the module returns +FAILURE. + +Related: rhbz#1107887 +Signed-off-by: Martin Kolman +--- + firstboot/interface.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/firstboot/interface.py b/firstboot/interface.py +index 60d4800..800c8bd 100644 +--- a/firstboot/interface.py ++++ b/firstboot/interface.py +@@ -150,8 +150,14 @@ class Interface(object): + # interface which will know the proper way to handle it. + result = module.apply(self, self.testing) + +- # If something went wrong in the module, don't advance. ++ # If something went wrong in the module, don't advance, ++ # but check if the next button should be renamed as ++ # returning failure seems to be an indication of switching ++ # to next page in multi-page modules + if result == RESULT_FAILURE: ++ if len(self._controlStack) == 1: ++ if self._control.currentPage == len(self.moduleList) - 1: ++ self.nextButton.set_label(_("_Done")) + return + + # If the apply action from the current page jumped us to another page, +-- +1.9.3 + diff --git a/SOURCES/0005-Use-smaller-title-text-size-so-that-it-fits-on-the-s.patch b/SOURCES/0005-Use-smaller-title-text-size-so-that-it-fits-on-the-s.patch new file mode 100644 index 0000000..ef42969 --- /dev/null +++ b/SOURCES/0005-Use-smaller-title-text-size-so-that-it-fits-on-the-s.patch @@ -0,0 +1,31 @@ +From 0fbd9ec83a7868babae347b4e93d18135f664139 Mon Sep 17 00:00:00 2001 +From: Martin Kolman +Date: Tue, 9 Sep 2014 14:19:23 +0200 +Subject: [PATCH] Use smaller title text size so that it fits on the screen + (#1040583) + +I've tried to use set_line_wrap(), but it introduced weird layout +issues. Changing the text size works just as well, seems to be more +robust and even works fine on 800x600. + +Resolves: rhbz#1040583 +--- + firstboot/module.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/firstboot/module.py b/firstboot/module.py +index 1b7fadc..6c4c918 100644 +--- a/firstboot/module.py ++++ b/firstboot/module.py +@@ -166,7 +166,7 @@ class Module: + # Create the large label that goes at the top of the right side. + label = gtk.Label("") + label.set_alignment(0.0, 0.5) +- label.set_markup("%s" % _(self.title)) ++ label.set_markup("%s" % _(self.title)) + + titleBox = gtk.HBox() + +-- +1.9.3 + diff --git a/SOURCES/0006-Fix-exception-handler-952633.patch b/SOURCES/0006-Fix-exception-handler-952633.patch new file mode 100644 index 0000000..5b5796d --- /dev/null +++ b/SOURCES/0006-Fix-exception-handler-952633.patch @@ -0,0 +1,30 @@ +From 42b755d222f75fcedddfd1a7373783c3d1f2c7c9 Mon Sep 17 00:00:00 2001 +From: Martin Kolman +Date: Wed, 17 Dec 2014 17:13:53 +0100 +Subject: [PATCH] Fix exception handler (#952633) + +A missing namedtuple import was preventing the exception handler from +working correctly. + +Related: rhbz#952633 +Signed-off-by: Martin Kolman +--- + progs/firstboot | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/progs/firstboot b/progs/firstboot +index f690a86..8e45f25 100755 +--- a/progs/firstboot ++++ b/progs/firstboot +@@ -27,6 +27,8 @@ import sys + import tempfile + import traceback + ++from collections import namedtuple ++ + import firstboot.frontend + import firstboot.loader + +-- +1.9.3 + diff --git a/SOURCES/0007-Fix-the-Firstboot-startup-scripts-for-the-s390-11806.patch b/SOURCES/0007-Fix-the-Firstboot-startup-scripts-for-the-s390-11806.patch new file mode 100644 index 0000000..d20bb93 --- /dev/null +++ b/SOURCES/0007-Fix-the-Firstboot-startup-scripts-for-the-s390-11806.patch @@ -0,0 +1,52 @@ +From ea6edcfa5cb9a6a4dd5739f2238a051097f82a65 Mon Sep 17 00:00:00 2001 +From: Martin Kolman +Date: Fri, 9 Jan 2015 18:06:36 +0100 +Subject: [PATCH] Fix the Firstboot startup scripts for the s390 (#1180616) + +Drop usage of /etc/sysconfig/i18n, which has been removed in RHEL-7 +and only launch Firstboot if $DESKTOP is set. + +Patch by jstodola. + +Resolves rhbz#1180616 + +Signed-off-by: Martin Kolman +--- + scripts/firstboot.csh | 5 ++++- + scripts/firstboot.sh | 6 ++++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/scripts/firstboot.csh b/scripts/firstboot.csh +index 07a4ab7..a4ff699 100644 +--- a/scripts/firstboot.csh ++++ b/scripts/firstboot.csh +@@ -14,6 +14,9 @@ if (( $? != 0 ) && ( -x $FIRSTBOOT_EXEC )) then + set args = "--reconfig" + endif + +- $FIRSTBOOT_EXEC $args ++ # run firstboot only if $DISPLAY is set ++ if ( $?DISPLAY == 1 ) then ++ $FIRSTBOOT_EXEC $args ++ endif + endif + endif +diff --git a/scripts/firstboot.sh b/scripts/firstboot.sh +index 5b4ec9d..dc4f0ef 100644 +--- a/scripts/firstboot.sh ++++ b/scripts/firstboot.sh +@@ -15,7 +15,9 @@ if [ -f $FIRSTBOOT_EXEC ] && [ "${RUN_FIRSTBOOT,,}" = "yes" ]; then + args="--reconfig" + fi + +- . /etc/sysconfig/i18n +- $FIRSTBOOT_EXEC $args ++ . /etc/locale.conf ++ . /etc/vconsole.conf ++ # run firstboot only if $DISPLAY is set ++ [ -n "$DISPLAY" ] && $FIRSTBOOT_EXEC $args + fi + fi +-- +2.1.0 + diff --git a/SPECS/firstboot.spec b/SPECS/firstboot.spec index 98a06d7..b9b2f09 100644 --- a/SPECS/firstboot.spec +++ b/SPECS/firstboot.spec @@ -4,16 +4,30 @@ Summary: Initial system configuration utility Name: firstboot URL: http://fedoraproject.org/wiki/FirstBoot Version: 19.9 -Release: 1%{?dist} +Release: 8%{?dist} # This is a Red Hat maintained package which is specific to # our distribution. Thus the source is only available from # within this srpm. Source0: %{name}-%{version}.tar.bz2 +# disable the systemd service once Firstboot is done +Patch1: 0001-Disable-firstboot-graphical-service-at-the-end-10913.patch +# fix exception handling +Patch2: 0002-Fix-exception-handling-952633.patch +# use "Done" instead of "Forward" of "Finish" on last module +Patch3: 0003-Replace-Finish-with-Done-on-the-next-button-1107887.patch +# correctly change the next-button label even for on multi-page module +Patch4: 0004-Handle-next-button-naming-also-if-there-is-only-one-.patch +# use smaller title text size so that it fits on the screen +Patch5: 0005-Use-smaller-title-text-size-so-that-it-fits-on-the-s.patch +# fix exception handler by adding a missing import +Patch6: 0006-Fix-exception-handler-952633.patch +# fix startup scripts for the s390 +Patch7: 0007-Fix-the-Firstboot-startup-scripts-for-the-s390-11806.patch + License: GPLv2+ Group: System Environment/Base ExclusiveOS: Linux -BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext BuildRequires: python-devel, python-setuptools-devel @@ -25,6 +39,7 @@ Requires(preun): systemd-units Requires(postun): systemd-units Requires: firstboot(windowmanager) Requires: libreport-python +Requires: python-ethtool %define debug_package %{nil} @@ -37,6 +52,15 @@ a series of steps that allows for easier configuration of the machine. %prep %setup -q +# apply patches +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 + %build %install @@ -91,6 +115,38 @@ fi %changelog +* Tue Jan 13 2015 Martin Kolman 19.9-8 +- Fix the Firstboot startup scripts for the s390 (#1180616) (jstodola) + Resolves: rhbz#1180616 + +* Thu Dec 18 2014 Martin Kolman 19.9-7 +- Fix exception handler (#952633) (mkolman@redhat.com) + Related: rhbz#952633 + +* Tue Nov 11 2014 Martin Kolman 19.9-6 +- Make Firstboot architecture specific due to s390-only files (#1162567) (mkolman@redhat.com) + Resolves: rhbz#1162567 + +* Tue Sep 30 2014 Martin Kolman 19.9-5 +- Use smaller title text size so that it fits on the screen (#1040583) + Resolves: rhbz#1040583 + +* Tue Sep 30 2014 Martin Kolman 19.9-4 +- Handle next button naming also if there is only one module (#1107887) (mkolman@redhat.com) + Related: rhbz#1107887 + +* Mon Sep 29 2014 Martin Kolman 19.9-3 +- Fix exception handling (#952633) (mkolman@redhat.com) + Resolves: rhbz#952633 +- Replace Finish with Done on the next button (#1107887) (mkolman@redhat.com) + Resolves: rhbz#1107887 + +* Wed Sep 03 2014 Martin Kolman 19.9-2 +- Add missing python-ethtool dependency (#1116921) (mkolman@redhat.com) + Resolves: rhbz#1116921 +- Disable firstboot-graphical service at the end (#1091317) (vpodzime@redhat.com) + Resolves: rhbz#1091317 + * Mon Mar 03 2014 Martin Kolman 19.9-1 - Update translations (mkolman@redhat.com) Related: rhbz#1030331