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

[firstboot] Fix firstboot for s390 architecture



Run firstboot the first time root user logs in
with a capable terminal
---
 firstboot.spec       |   11 ++++++++++-
 scripts/firstboot.sh |   18 ++++++++++++++++++
 setup.py             |    3 ++-
 3 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 scripts/firstboot.sh

diff --git a/firstboot.spec b/firstboot.spec
index e1e672f..8e84e45 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
@@ -40,15 +40,20 @@ a series of steps that allows for easier configuration of the machine.
 rm -rf %{buildroot}
 make DESTDIR=%{buildroot} SITELIB=%{python_sitelib} install
 rm %{buildroot}/%{_datadir}/firstboot/modules/additional_cds.py*
+%ifnarch s390 s390x
+rm -rf %{buildroot}/%{_sysconfdir}/profile.d
+%endif
 %find_lang %{name}
 
 %clean
 rm -rf %{buildroot}
 
 %post
+%ifnarch s390 s390x
 if ! [ -f /etc/sysconfig/firstboot ]; then
   chkconfig --add firstboot
 fi
+%endif
 
 %preun
 if [ $1 = 0 ]; then
@@ -71,6 +76,10 @@ 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
 * Wed Oct 14 2009 Chris Lumens <clumens redhat com> 1.110-1
diff --git a/scripts/firstboot.sh b/scripts/firstboot.sh
new file mode 100644
index 0000000..474622b
--- /dev/null
+++ b/scripts/firstboot.sh
@@ -0,0 +1,18 @@
+# firstboot.sh
+
+FIRSTBOOT_EXEC=/usr/sbin/firstboot
+FIRSTBOOT_CONF=/etc/sysconfig/firstboot
+
+# check if firstboot is installed and should be run
+if [ -f $FIRSTBOOT_EXEC ] && [ ! -f $FIRSTBOOT_CONF ] || [ -z "$(grep 'RUN_FIRSTBOOT=NO' $FIRSTBOOT_CONF)" ]; then
+    # check if we're on 3270 terminal and root
+    if [ $(/sbin/consoletype) == "pty" ] && [ $(/usr/bin/id -u) -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..38db780 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
 from distutils.core import setup
 from glob import *
 
-setup(name='firstboot', version='1.110',
+setup(name='firstboot', version='1.111',
       description='Post-installation configuration utility',
       author='Chris Lumens', author_email='clumens redhat com',
       url='http://fedoraproject.org/wiki/FirstBoot',
@@ -11,5 +11,6 @@ setup(name='firstboot', version='1.110',
                   ('/etc/rc.d/init.d', ['init/firstboot']),
                   ('/usr/share/firstboot/themes/default', glob('themes/default/*.png')),
                   ('/usr/share/firstboot/modules', glob('modules/*.py')),
+                  ('/etc/profile.d', ['scripts/firstboot.sh'])
                  ],
       packages=['firstboot'])
-- 
1.6.6


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