6c94857032
(1)Release Version Upgrade (2)Matching code changes with el7 to el8 (3)Change applying patch command Currently auto apply all patches as below %autosetup -p1 instead of applying patches commmand by command: %patchxxxx -p1 Story: 2006729 Task: 37687 Depends-On: https://review.opendev.org/#/c/696481/ Depends-On: https://review.opendev.org/#/c/696050/ Change-Id: I4a0dd93322144c13494e9ca4444f23b4b2aca0cf Signed-off-by: Long Li <lilong-neu@neusoft.com>
81 lines
2.4 KiB
Diff
81 lines
2.4 KiB
Diff
From 0b9c332f7101c890c5bb1c65f9c89d82bd759a04 Mon Sep 17 00:00:00 2001
|
|
From: Don Penney <don.penney@windriver.com>
|
|
Date: Thu, 23 Nov 2017 16:46:31 -0500
|
|
Subject: [PATCH] Cache server ip in /etc/hosts
|
|
|
|
---
|
|
data/systemd/anaconda.service | 1 +
|
|
scripts/anaconda-preexec | 50 +++++++++++++++++++++++++++++++++++++++++++
|
|
2 files changed, 51 insertions(+)
|
|
create mode 100644 scripts/anaconda-preexec
|
|
|
|
diff --git a/data/systemd/anaconda.service b/data/systemd/anaconda.service
|
|
index a80c6bb..8966258 100644
|
|
--- a/data/systemd/anaconda.service
|
|
+++ b/data/systemd/anaconda.service
|
|
@@ -7,4 +7,5 @@ Wants=anaconda-noshell.service
|
|
Type=forking
|
|
Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=en_US.UTF-8 GDK_BACKEND=x11 XDG_RUNTIME_DIR=/tmp GIO_USE_VFS=local
|
|
WorkingDirectory=/root
|
|
+ExecStartPre=/usr/sbin/anaconda-preexec
|
|
ExecStart=/usr/bin/tmux -u -f /usr/share/anaconda/tmux.conf start
|
|
diff --git a/scripts/anaconda-preexec b/scripts/anaconda-preexec
|
|
new file mode 100644
|
|
index 0000000..d491173
|
|
--- /dev/null
|
|
+++ b/scripts/anaconda-preexec
|
|
@@ -0,0 +1,50 @@
|
|
+#!/bin/bash
|
|
+#
|
|
+# Copyright (c) 2017 Wind River Systems, Inc.
|
|
+# SPDX-License-Identifier: Apache-2.0
|
|
+#
|
|
+#
|
|
+#
|
|
+#
|
|
+
|
|
+exec >>/tmp/anaconda-preexec.log
|
|
+exec 2>>/tmp/anaconda-preexec.log
|
|
+set -x
|
|
+
|
|
+function get_ip()
|
|
+{
|
|
+ local host=$1
|
|
+
|
|
+ # Try the DNS query
|
|
+ host -t A $host | awk '{print $4}' | grep '^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' | head -1
|
|
+}
|
|
+
|
|
+# If the kickstart is net-based, wait for connectivity to server
|
|
+cat /proc/cmdline | grep -q 'inst\.ks=http://'
|
|
+if [ $? -eq 0 ]
|
|
+then
|
|
+ server=$(cat /proc/cmdline | sed -r 's#.*inst\.ks=http://([^/:]*)(:[^/]*)?/.*#\1#')
|
|
+ if [ -n "$server" ]
|
|
+ then
|
|
+ echo "Testing connectivity to server: $server"
|
|
+ let -i ping_count=0
|
|
+ ping -c 1 -w 60 $server
|
|
+ while [ $? -ne 0 -a $ping_count -lt 600 ]
|
|
+ do
|
|
+ echo "Waiting for connectivity to server: $server"
|
|
+ sleep 1
|
|
+ let -i ping_count++
|
|
+ ping -c 1 -w 60 $server
|
|
+ done
|
|
+
|
|
+ # Cache the host IP
|
|
+ ipaddr=$(get_ip $server)
|
|
+ if [ -n "$ipaddr" -a "$ipaddr" != "$server" ]
|
|
+ then
|
|
+ echo "$ipaddr $server" >> /etc/hosts
|
|
+ fi
|
|
+
|
|
+ fi
|
|
+fi
|
|
+
|
|
+exit 0
|
|
--
|
|
2.7.4
|
|
|