[initial-setup][rhel7-branch][PATCH 1/2] Fixes for profile.d scripts (#1180576)
Martin Kolman
mkolman at redhat.com
Fri Jan 9 17:23:29 UTC 2015
From: Jan Stodola <jstodola at redhat.com>
1. fix path to initial-setup
2. do not start initial-setup again after successfull execution
3. source /etc/locale.conf and /etc/vconsole.conf instead of deprecated /etc/sysconfig/i18n
The sed regexp has been slightly modified by mkolman & vpodzime from the original by jstodola.
Resolves: rhbz#1180576
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
scripts/initial-setup.csh | 7 +++++--
scripts/initial-setup.sh | 10 ++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/scripts/initial-setup.csh b/scripts/initial-setup.csh
index 9934bdf..6853c85 100644
--- a/scripts/initial-setup.csh
+++ b/scripts/initial-setup.csh
@@ -1,9 +1,9 @@
# initial-setup.csh
-set IS_EXEC = /usr/sbin/initial-setup
+set IS_EXEC = /usr/bin/initial-setup
set IS_CONF = /etc/sysconfig/initial-setup
-# check if we should run firstboot
+# check if we should run initial-setup
grep -i "RUN_INITIAL_SETUP=NO" $IS_CONF >/dev/null
if (( $? != 0 ) && ( -x $IS_EXEC )) then
# check if we're not on 3270 terminal and root
@@ -15,5 +15,8 @@ if (( $? != 0 ) && ( -x $IS_EXEC )) then
endif
$IS_EXEC $args
+ if ( $? == 0 ) then
+ [ $? -eq 0 ] && sed -r -i 's/^RUN_INITIAL_SETUP\s*=\s*[yY][eE][sS]\s*/RUN_INITIAL_SETUP=NO/' $IS_CONF
+ endif
endif
endif
diff --git a/scripts/initial-setup.sh b/scripts/initial-setup.sh
index 18a2028..c980323 100644
--- a/scripts/initial-setup.sh
+++ b/scripts/initial-setup.sh
@@ -1,12 +1,12 @@
-# firstboot.sh
+# initial-setup.sh
-IS_EXEC=/usr/sbin/initial-setup
+IS_EXEC=/usr/bin/initial-setup
IS_CONF=/etc/sysconfig/initial-setup
# source the config file
[ -f $IS_CONF ] && . $IS_CONF
-# check if we should run firstboot
+# check if we should run initial-setup
if [ -f $IS_EXEC ] && [ "${RUN_INITIAL_SETUP,,}" = "yes" ]; then
# check if we're not on 3270 terminal and root
if [ $(/sbin/consoletype) = "pty" ] && [ $EUID -eq 0 ]; then
@@ -15,7 +15,9 @@ if [ -f $IS_EXEC ] && [ "${RUN_INITIAL_SETUP,,}" = "yes" ]; then
args="--reconfig"
fi
- . /etc/sysconfig/i18n
+ . /etc/locale.conf
+ . /etc/vconsole.conf
$IS_EXEC $args
+ [ $? -eq 0 ] && sed -r -i 's/^RUN_INITIAL_SETUP\s*=\s*[yY][eE][sS]\s*/RUN_INITIAL_SETUP=NO/' $IS_CONF
fi
fi
--
2.1.0
More information about the anaconda-patches
mailing list