[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        |   19 ++++++++++++++++---
 scripts/firstboot.csh |   19 +++++++++++++++++++
 scripts/firstboot.sh  |   21 +++++++++++++++++++++
 setup.py              |   20 ++++++++++++++------
 4 files changed, 70 insertions(+), 9 deletions(-)
 create mode 100644 scripts/firstboot.csh
 create mode 100644 scripts/firstboot.sh

diff --git a/firstboot.spec b/firstboot.spec
index e1e672f..a352714 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,8 +46,13 @@ rm %{buildroot}/%{_datadir}/firstboot/modules/additional_cds.py*
 rm -rf %{buildroot}
 
 %post
-if ! [ -f /etc/sysconfig/firstboot ]; then
-  chkconfig --add firstboot
+if [ ! -f /etc/sysconfig/firstboot ]; then
+  platform="$(arch)"
+  if [ "$platform" = "s390" -o "$platform" = "s390x" ]; then
+    echo "RUN_FIRSTBOOT=YES" > /etc/sysconfig/firstboot
+  else
+    chkconfig --add firstboot
+  fi
 fi
 
 %preun
@@ -71,8 +76,16 @@ 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
+%{_sysconfdir}/profile.d/firstboot.csh
+%endif
 
 %changelog
+* Fri Feb 12 2010 Martin Gracik <mgracik@xxxxxxxxxx> 1.111-1
+- Run firstboot the first time root logs in on s390 machines (#463564).
+
 * 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.csh b/scripts/firstboot.csh
new file mode 100644
index 0000000..07a4ab7
--- /dev/null
+++ b/scripts/firstboot.csh
@@ -0,0 +1,19 @@
+# firstboot.csh
+
+set FIRSTBOOT_EXEC = /usr/sbin/firstboot
+set FIRSTBOOT_CONF = /etc/sysconfig/firstboot
+
+# check if we should run firstboot
+grep -i "RUN_FIRSTBOOT=NO" $FIRSTBOOT_CONF >/dev/null
+if (( $? != 0 ) && ( -x $FIRSTBOOT_EXEC )) then
+    # check if we're not on 3270 terminal and root
+    if (( `/sbin/consoletype` == "pty" ) && ( `/usr/bin/id -u` == 0 )) then
+        set args = ""
+        grep -i "reconfig" /proc/cmdline >/dev/null
+        if (( $? == 0 ) || ( -e /etc/reconfigSys )) then
+            set args = "--reconfig"
+        endif
+
+        $FIRSTBOOT_EXEC $args
+    endif
+endif
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..0ae3a8d 100644
--- a/setup.py
+++ b/setup.py
@@ -2,14 +2,22 @@
 
 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']))
+    data_files.append(('/etc/profile.d', ['scripts/firstboot.csh']))
+
+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