[firstboot] Fix firstboot for s390 architecture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Run firstboot the first time root user logs in
with a capable terminal
---
 firstboot.spec       |   13 +++++++++++--
 scripts/firstboot.sh |   21 +++++++++++++++++++++
 setup.py             |   19 +++++++++++++------
 3 files changed, 45 insertions(+), 8 deletions(-)
 create mode 100644 scripts/firstboot.sh

diff --git a/firstboot.spec b/firstboot.spec
index e1e672f..d48ed40 100644
--- a/firstboot.spec
+++ b/firstboot.spec
@@ -3,7 +3,7 @@
 Summary: Initial system configuration utility
 Name: firstboot
 URL: http://fedoraproject.org/wiki/FirstBoot
-Version: 1.110
+Version: 1.111
 Release: 1%{?dist}
 # This is a Red Hat maintained package which is specific to
 # our distribution.  Thus the source is only available from
@@ -46,9 +46,11 @@ rm %{buildroot}/%{_datadir}/firstboot/modules/additional_cds.py*
 rm -rf %{buildroot}
 
 %post
-if ! [ -f /etc/sysconfig/firstboot ]; then
+%ifnarch s390 s390x
+if [ ! -f /etc/sysconfig/firstboot ]; then
   chkconfig --add firstboot
 fi
+%endif
 
 %preun
 if [ $1 = 0 ]; then
@@ -71,8 +73,15 @@ fi
 %{_datadir}/firstboot/modules/eula.py*
 %{_datadir}/firstboot/modules/welcome.py*
 %{_datadir}/firstboot/themes/default/*
+%ifarch s390 s390x
+%dir %{_sysconfdir}/profile.d
+%{_sysconfdir}/profile.d/firstboot.sh
+%endif
 
 %changelog
+* Fri Feb 12 2010 Martin Gracik <mgracik@xxxxxxxxxx> 1.111-1
+- Run firstboot the first time root logs in on s390 machines.
+
 * Wed Oct 14 2009 Chris Lumens <clumens@xxxxxxxxxx> 1.110-1
 - Always attempt to display the Fedora logo, if present (jmccann).
 - Fix a bunch of small firstboot UI problems (jmccann).
diff --git a/scripts/firstboot.sh b/scripts/firstboot.sh
new file mode 100644
index 0000000..5b4ec9d
--- /dev/null
+++ b/scripts/firstboot.sh
@@ -0,0 +1,21 @@
+# firstboot.sh
+
+FIRSTBOOT_EXEC=/usr/sbin/firstboot
+FIRSTBOOT_CONF=/etc/sysconfig/firstboot
+
+# source the config file
+[ -f $FIRSTBOOT_CONF ] && . $FIRSTBOOT_CONF
+
+# check if we should run firstboot
+if [ -f $FIRSTBOOT_EXEC ] && [ "${RUN_FIRSTBOOT,,}" = "yes" ]; then
+    # check if we're not on 3270 terminal and root
+    if [ $(/sbin/consoletype) = "pty" ] && [ $EUID -eq 0 ]; then
+        args=""
+        if grep -i "reconfig" /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then
+            args="--reconfig"
+        fi
+
+        . /etc/sysconfig/i18n
+        $FIRSTBOOT_EXEC $args
+    fi
+fi
diff --git a/setup.py b/setup.py
index 6249be6..2cefd1f 100644
--- a/setup.py
+++ b/setup.py
@@ -2,14 +2,21 @@
 
 from distutils.core import setup
 from glob import *
+import os
 
-setup(name='firstboot', version='1.110',
+data_files = [('/usr/sbin', ['progs/firstboot']),
+              ('/etc/rc.d/init.d', ['init/firstboot']),
+              ('/usr/share/firstboot/themes/default',
+               glob('themes/default/*.png')),
+              ('/usr/share/firstboot/modules', glob('modules/*.py'))]
+
+# add the firstboot start script for s390 architectures
+if os.uname()[4].startswith('s390'):
+    data_files.append(('/etc/profile.d', ['scripts/firstboot.sh']))
+
+setup(name='firstboot', version='1.111',
       description='Post-installation configuration utility',
       author='Chris Lumens', author_email='clumens@xxxxxxxxxx',
       url='http://fedoraproject.org/wiki/FirstBoot',
-      data_files=[('/usr/sbin', ['progs/firstboot']),
-                  ('/etc/rc.d/init.d', ['init/firstboot']),
-                  ('/usr/share/firstboot/themes/default', glob('themes/default/*.png')),
-                  ('/usr/share/firstboot/modules', glob('modules/*.py')),
-                 ],
+      data_files=data_files,
       packages=['firstboot'])
-- 
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux