Print this page
XXX Remove nawk(1)
*** 19,30 ****
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
- # ident "%Z%%M% %I% %E% SMI"
- #
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# SVM Flash cleanup
# Remove existing master SVM configuration on clone after full flash install.
--- 19,28 ----
*** 44,54 ****
if [ "${FLASH_TYPE}" = "FULL" ]; then
# Full flash install, remove master's SVM configuration from clone.
# Remove any SVM root entry from /etc/system file.
! nawk '
BEGIN {delroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {delroot=1}
/^\* End MDD root info \(do not edit\)$/ {delroot=0; next}
{if (delroot == 0) print $0}
' ${IN_SYS} > ${TMP_SYS}
--- 42,52 ----
if [ "${FLASH_TYPE}" = "FULL" ]; then
# Full flash install, remove master's SVM configuration from clone.
# Remove any SVM root entry from /etc/system file.
! /usr/xpg4/bin/awk '
BEGIN {delroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {delroot=1}
/^\* End MDD root info \(do not edit\)$/ {delroot=0; next}
{if (delroot == 0) print $0}
' ${IN_SYS} > ${TMP_SYS}
*** 64,83 ****
# need to copy the md.conf file from the current root onto the
# newly installed root. Note that the flash archive might not have
# been created from the currently running system.
if [ -h /kernel/drv/md.conf ]; then
# Remove SVM mddb entries from /kernel/drv/md.conf.
! nawk '
BEGIN {delmddb=0}
/^# Begin MDD database info \(do not edit\)$/ {delmddb=1}
/^# End MDD database info \(do not edit\)$/ {delmddb=0; next}
{if (delmddb == 0) print $0}
' ${IN_CONF} > ${TMP_CONF}
cp ${TMP_CONF} ${IN_CONF}
# Remove SVM mddb entries from /etc/lvm/mddb.cf.
! nawk '
/^#/ {print $0}
' ${IN_CF} > ${TMP_CF}
cp ${TMP_CF} ${IN_CF}
else
--- 62,81 ----
# need to copy the md.conf file from the current root onto the
# newly installed root. Note that the flash archive might not have
# been created from the currently running system.
if [ -h /kernel/drv/md.conf ]; then
# Remove SVM mddb entries from /kernel/drv/md.conf.
! /usr/xpg4/bin/awk '
BEGIN {delmddb=0}
/^# Begin MDD database info \(do not edit\)$/ {delmddb=1}
/^# End MDD database info \(do not edit\)$/ {delmddb=0; next}
{if (delmddb == 0) print $0}
' ${IN_CONF} > ${TMP_CONF}
cp ${TMP_CONF} ${IN_CONF}
# Remove SVM mddb entries from /etc/lvm/mddb.cf.
! /usr/xpg4/bin/awk '
/^#/ {print $0}
' ${IN_CF} > ${TMP_CF}
cp ${TMP_CF} ${IN_CF}
else
*** 144,162 ****
# There is no difference so leave it alone.
exit 0;
fi
# Get any SVM root entry from master /etc/system file.
! MASTER_ROOT=`nawk '
BEGIN {inroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {inroot=1; next}
/^\* End MDD root info \(do not edit\)$/ {inroot=0}
{if (inroot == 1) print $0}
' ${IN_SYS}`
# Get any SVM root entry from clone /etc/system file.
! CLONE_ROOT=`nawk '
BEGIN {inroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {inroot=1; next}
/^\* End MDD root info \(do not edit\)$/ {inroot=0}
{if (inroot == 1) print $0}
' ${SAVE_DIR}/system`
--- 142,160 ----
# There is no difference so leave it alone.
exit 0;
fi
# Get any SVM root entry from master /etc/system file.
! MASTER_ROOT=`/usr/xpg4/bin/awk '
BEGIN {inroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {inroot=1; next}
/^\* End MDD root info \(do not edit\)$/ {inroot=0}
{if (inroot == 1) print $0}
' ${IN_SYS}`
# Get any SVM root entry from clone /etc/system file.
! CLONE_ROOT=`/usr/xpg4/bin/awk '
BEGIN {inroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {inroot=1; next}
/^\* End MDD root info \(do not edit\)$/ {inroot=0}
{if (inroot == 1) print $0}
' ${SAVE_DIR}/system`
*** 166,176 ****
# If there is an SVM root entry in the clone /etc/system file.
if [ "${CLONE_ROOT}" ]; then
# Restore clone SVM root entry in /etc/system file.
! nawk -v clone_root="${CLONE_ROOT}" '
BEGIN {newroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {
newroot=1
print $0
print clone_root
--- 164,174 ----
# If there is an SVM root entry in the clone /etc/system file.
if [ "${CLONE_ROOT}" ]; then
# Restore clone SVM root entry in /etc/system file.
! /usr/xpg4/bin/awk -v clone_root="${CLONE_ROOT}" '
BEGIN {newroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {
newroot=1
print $0
print clone_root
*** 182,192 ****
else
# There is no SVM root entry in the clone so remove the entry
# from the /etc/system file.
! nawk '
BEGIN {delroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {delroot=1}
/^\* End MDD root info \(do not edit\)$/ {delroot=0; next }
{if (delroot == 0) print $0}
' ${IN_SYS} >${TMP_SYS}
--- 180,190 ----
else
# There is no SVM root entry in the clone so remove the entry
# from the /etc/system file.
! /usr/xpg4/bin/awk '
BEGIN {delroot=0}
/^\* Begin MDD root info \(do not edit\)$/ {delroot=1}
/^\* End MDD root info \(do not edit\)$/ {delroot=0; next }
{if (delroot == 0) print $0}
' ${IN_SYS} >${TMP_SYS}