⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exec_upgrade

📁 操作系统SunOS 4.1.3版本的源码
💻
📖 第 1 页 / 共 2 页
字号:
	karch=$KARCH    fi    if [ x_$release = "x_" ]; then	release=$FROM_RELEASE    fi    suffix=".`echo $release | $SED "s/\.//g" | $TR '[A-Z]' '[a-z]'`"    log_echo "Upgrading software category $name ..."    name_p=`basename $name`    pack=`$ECHO $name_p | $NAWK -F. '{ print $1 } ' - `    roadmap	$pack\		$NEW_VERSION\		$AARCH $karch\		med_path\		os_path\		incl_file    os_path0=$os_path    if [ x_$export_point != "x_" ]; then	os_path0=$os_path	os_path=$export_point    fi    before_file=$SCRIPT_PATH/$pack.$BEFORE    after_file=$SCRIPT_PATH/$pack.$AFTER    tar_file=$SCRIPT_PATH/$pack.$UNTAR    delete_file=$SCRIPT_PATH/$pack.$DELETE# Special treatment for root pack yp stuff# If export_point/var/yp dir does not exist, # rename it to export_point/var/yp.412 after untar,# and add to coalesce list    if [ $pack = root ] && [ ! -d $os_path/$NIS_DIR ]; then	NIS_NOT_INSTALLED=true    else	NIS_NOT_INSTALLED=false    fi    mk_nullfile $before_file    mk_nullfile $after_file    mk_nullfile $sos_file    rest_own_acc=$SCRIPT_PATH/$pack.restore    if [ -f $INCLD/$incl_file.include ]; then        fix_the_list  $INCLD/$incl_file.include $suffix        make_tar    $CD_MOUNT/$med_path $os_path\	 		$INCLD/$incl_file.include\			> $tar_file        if $DUMMY ; then	    cat_it $before_file	    cat_it $tar_file	    cat_it $after_file            log_echo "Software category $name pseudo upgraded."        else	    . $before_file# Move /usr/kvm/adb first if it's a file	    if [ $pack = kvm -a -f $os_path/adb ]; then		$MV $os_path/adb $os_path/adb$suffix		$ECHO $os_path/adb >> $COALESCE_LIST	    fi	    . $tar_file	    if [ $tar_rc -ne 0 ]; then	        . $sos_file	       cleanup 30	    else	    . $after_file            log_echo "Software category $name upgraded."	    fi        fi    else	log_echo "No replacement"    fi    if $DUMMY ; then	:    else# Special treatment for root pack /dev directory# MAKEDEV for all root exept proto	if [ $pack = root ] && \	[ x_$export_point != x_/export/exec/proto.root.sunos.$TO_RELEASE ] ; then	    log_echo "Making device nodes ..."	    here=`$PWD`	    $CD $os_path/dev	    $RM audio audioctl 2>/dev/null	    ./MAKEDEV sr2 sr3 sr4 sr5 sd16 sd17 sd18 sd19 sd20 gt audio 2>/dev/null	    [ $karch = sun4m ] && ./MAKEDEV bpp0 bpp1 bpp2 bpp3 bpp4 2>/dev/null	    $CD $here	fi	if $NIS_NOT_INSTALLED && \	    [ $pack = root -a -d $os_path/$NIS_DIR ]; then	    $MV $os_path$NIS_DIR $os_path$NIS_DIR$NEW_SUFFIX	    $ECHO $os_path/$NIS_DIR >> $COALESCE_LIST	fi    fi    if [ -f $INCLD/$incl_file.delete ]; then       log_echo "Some $release files from the software category $name unused in $TO_RELEASE   will be deleted"       make_delete  $INCLD/$incl_file.delete\		    >> $delete_file    fi    if $DUMMY ; then	:    elif [ x_$export_point = "x_" ]; then	$ECHO $pack >> $UPGRDT_PCK_LST    fi$SYNC; $SYNClog_echo}##################################################get_package(){name=$1export_point=$2karch=$3    if [ x_$karch = "x_" ]; then	karch=$KARCH    fi    log_echo "Extracting software category $name ..."    name_p=`basename $name`    pack=`$ECHO $name_p | $NAWK -F. '{ print $1 } ' - `    roadmap	$pack\		$NEW_VERSION\		$AARCH $karch\		med_path\		os_path\		incl_file    os_path0=$os_path    if [ x_$export_point != "x_" ]; then	os_path0=$os_path	os_path=$export_point    fi    tar_file=$SCRIPT_PATH/$pack.$UNTAR    mk_nullfile $sos_file    make_tar $CD_MOUNT/$med_path $os_path\			> $tar_file    if $DUMMY ; then       cat_it $tar_file            log_echo "Software category $name pseudo installed."    else       . $tar_file       if [ $tar_rc -ne 0 ]; then            . $sos_file	       cleanup 30       else            log_echo "Software category $name installed."       fi    fi$SYNC; $SYNClog_echo}#########################################upgrade_save(){name=$1export_point=$2karch=$3release=$4to_point=$5    if [ x_$karch = "x_" ]; then	karch=$KARCH    fi    if [ x_$release = "x_" ]; then	release=$FROM_RELEASE    fi    suffix=".`echo $release | $SED "s/\.//g" | $TR '[A-Z]' '[a-z]'`"    log_echo "Saving $name files for $release on $karch ..."    name_p=`basename $name`    pack=`$ECHO $name_p | $NAWK -F. '{ print $1 } ' - `    roadmap	$pack\		$NEW_VERSION\		$AARCH $karch\		med_path\		os_path\		incl_file    os_path0=$os_path    if [ x_$export_point != "x_" ]; then	os_path0=$os_path	os_path=$export_point    fi    before_file=$SCRIPT_PATH/$pack.$BEFORE    after_file=$SCRIPT_PATH/$pack.$AFTER    delete_file=$SCRIPT_PATH/$pack.$DELETE# Special treatment for root pack yp stuff# If export_point/var/yp dir does not exist, # rename it to export_point/var/yp.412 after untar,# and add to coalesce list    if [ $pack = root ] && [ ! -d $os_path/$NIS_DIR ]; then	NIS_NOT_INSTALLED=true    else	NIS_NOT_INSTALLED=false    fi    mk_nullfile $before_file    mk_nullfile $after_file    mk_nullfile $sos_file    rest_own_acc=$SCRIPT_PATH/$pack.restore    if [ -f $INCLD/$incl_file.include ]; then        fix_the_list2  $INCLD/$incl_file.include $suffix $to_point         if $DUMMY ; then	    cat_it $before_file	    cat_it $after_file            log_echo "$name files for $release on $karch saved."        else	    . $before_file        fi    else	log_echo "No files saved"    fi$SYNC; $SYNClog_echo}##################################################upgrade_openwin(){    name=$1    log_echo "Upgrading software category $name ..."    name_p=`basename $name`    pack=`$ECHO $name_p | $NAWK -F. '{ print $1 } ' - `    roadmap	$pack\		$NEW_VERSION\		$AARCH $karch\		med_path\		os_path\		incl_file    tar_file=$SCRIPT_PATH/$pack.$UNTAR    make_tar    $CD_MOUNT/$med_path $os_path\			> $tar_file    if $DUMMY ; then	    cat_it $tar_file            log_echo "Software category $name pseudo upgraded."    else	    . $tar_file	    if [ $tar_rc -ne 0 ]; then	       cleanup 30	    else               log_echo "Software category $name upgraded."	    fi    fi    if $DUMMY ; then	:    else 	$ECHO $pack >> $UPGRDT_PCK_LST    fi$SYNC; $SYNClog_echo}##################################################get_kvm_file(){    name=$1    source=$2    target=$3    $MKDIR /usr_tmp    $CD /usr_tmp    $TAR -xf $CD_KVM_DIR/$KARCH_VERSION/kvm $source    rc=$?    if [ $rc = 0 ]; then	$MV $source $target    else        log_echo "Unable to install new $name for $HOST!"    fi    $RM -rf /usr_tmp     return $rc}##################################################upgrade_fstab(){    FSTAB=/etc/fstab    if $VERBOSE; then	log_tab; log_echo "$FSTAB saved to"	log_tab; log_echo "$FSTAB$OLD_SUFFIX"    fi    if $DUMMY ; then 	return    fi    if [ ! -s $FSTAB ]; then        log_echo "No $FSTAB ?"        return 1    fi    $ECHO $FSTAB >> $COALESCE_LIST    $MV $FSTAB $FSTAB$OLD_SUFFIX    $SED "s@sunos.$FROM_RELEASE@sunos.$TO_RELEASE@" \			$FSTAB$OLD_SUFFIX > $FSTAB}##################################################install_vmunix_at_dataless(){## If vmunix.orig exists, do not save the existing version.# Untar the kernel to the just created/usr_tmp. # Move it to the vmunix.#log_echo "Installing vmunix..."if $DUMMY ; then    returnelse     [ -f /vmunix ] && \	[ ! -s /vmunix.orig ] && \	    $BACKUP && \	        $MV /vmunix /vmunix.orig    get_kvm_file kernel ./stand/$NEW_KERNEL /vmunix    if [ $? != 0 ]; then	[ ! -f /vmunix.orig ] && return        log_echo "Restoring original kernel..."        $MV /vmunix.orig /vmunix    fi    $SYNC; $SYNCfi}##################################################install_kadb_at_dataless(){log_echo "Installing kadb ..."    if $DUMMY ; then	return    else	get_kvm_file kadb ./stand/kadb /kadb        $SYNC; $SYNC    fi}##################################################install_boot_block_at_dataless(){## Install boot block#    log_echo "Installing bootblock ..."    DISK=`$MOUNT | $GREP ' / ' |\	 $NAWK '{print $1}' |\	 $NAWK -F/ '{print $3}'`    DISKTYPE=`$ECHO $DISK | colrm 3`    if $DUMMY ; then	return    fi    get_kvm_file bootblock ./stand/boot.$KARCH /boot    [ $? = 1 ] && return    $SYNC; $SYNC    cd /usr/mdec    ./installboot -v /boot boot"$DISKTYPE" /dev/r"$DISK"    $SYNC; $SYNC}##################################################fix_sbin_at_dataless(){## Copy /sbin directory commands#    log_echo "Copying /sbin commands..."    $DUMMY  && return# Let's take a new list    here=`$PWD`    $MKDIR /usr_tmp    $CD /usr_tmp    $TAR -xf $CD_EXEC/${AARCH}_$NEW_VERSION/install \			./etc/install/install.bin    if [ $? != 0 ]; then        log_echo "Unable to install new /sbin for $HOST!"	return    fi# Create the incl file and mv commands    $NAWK '/^appl/ {print "./"$2 > "'$TMP_PATH/inc'"; \		    print "'$CP' ./"$2" "$3> "'$TMP_PATH/com'"}'  \			/usr_tmp/etc/install/install.bin# Untar the commands    $TAR -xf $CD_EXEC/${AARCH}_$NEW_VERSION/usr -I $TMP_PATH/inc    if [ $? != 0 ]; then        log_echo "Unable to install new /sbin for $HOST!"	return    fi# Move all to the /sbin    . $TMP_PATH/com    $CD $here    $RM -rf $TMP_PATH/com $TMP_PATH/inc /usr_tmp}##################################################are_equal(){if [ -f $1 -a -f $2 ]; then    s1=`$SUM $1`    s2=`$SUM $2`    if [ "$s1" = "$s2" ]; then	echo true	return    fifi    echo false}##################################################

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -