Files
new_install/operation/exec_finish_install.sh
Peng Zhihui a2e217c99b Correct the problem of reumount operation
Text mode uses python-newt to show install progress

	modified:   interface/ri_inst_cli.py
	modified:   interface/ri_install.py
	modified:   operation/exec_finish_install.sh
	modified:   operation/functions
	modified:   operation/partition_disks.sh
2014-03-06 16:07:57 +08:00

89 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
#
# DESCRIPTION: chroot $TARGET excute script under /var/finish_install/.
# copy 99finish_install to /var/finish_install/, then one
# by one copy the script in /var/finish_install/ to $TARGET
# with sequence, and then chroot $TARGET to execte it.
#
# SCRIPT NAME: exec_finish_install.sh
#
# Input: stdin
# 1. script name which need run after installation
#
# Output:
# NULL
# Return value:
# dependency return value of execute script, if 0 is success.
#
# AUTHOR: Qin Bo
#
# EMAIL: bqin@linx-info.com
#
# DATE: 2010-08-27
#
# HISTORY:
# REVISOR DATE MODIFICATION
# Qin Bo 2010-08-27 create
#
#
#
source ./functions
prep ()
{
local mp
if [ ! -d $FINISH_INSTALL_DIR ];then
mkdir -p $FINISH_INSTALL_DIR
fi
for mp in /dev /proc /sys
do
mount --bind -n $mp "$TARGET$mp"
done
}
clean_mp ()
{
local mp
for mp in /dev /proc /sys
do
umount $mp
done
}
main ()
{
local base
local script
prep
# run all the script in /usr/lib/new_install/operation/finish_install,
# execute sequence through number of script name
for script in "$FINISH_INSTALL_DIR"/*; do
base=$(basename $script | sed 's/[0-9]*//')
if [ -x "$script" ];then
info "Running $base"
$script >>$LOG_FILE 2>&1
erv
else
warn "Unable to execute $script"
fi
done
info "Running finish install success"
[ ! -c "$LOG_FILE" ] && cp $LOG_FILE "$TARGET/var/log"
[ ! -c "/var/install/install.xml" ] && cp "/var/install/install.xml" "$TARGET/var/log"
[ ! -c "$DEV_LOG" ] && cp $DEV_LOG "$TARGET/var/log" || true
clean_mp
}
FINISH_INSTALL_DIR="/usr/lib/new_install/operation/finish_install"
main "$@"