Files
new_install/operation/exec_finish_install.sh
Peng Zhihui 513f9756bf Modify finish_install interface:
exec_finish_install will run all executable scripts in the
    finish_install dir in turn.
Add support to ext4 in mount_partition.sh
move auto_install.py and state_grid.py to text dir

	modified:   operation/exec_finish_install.sh
	new file:   operation/finish_install/95state_grid_custom.py
	modified:   operation/finish_install/99finish_install.sh
	new file:   operation/finish_install/exec_post_add.sh
	modified:   operation/install.txt
	modified:   operation/mount_partition.sh
	renamed:    AutoInstall/auto_install.py -> text/auto_install.py
	renamed:    StateGrid/state_grid.py -> text/state_grid.py
2014-02-26 09:33:28 +08:00

76 lines
1.5 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
}
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
}
FINISH_INSTALL_DIR="/usr/lib/new_install/operation/finish_install"
main "$@"