#!/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 () { for mp in /dev /proc /sys do mount --bind -n $mp "$TARGET$mp" done # copy the script to $TARGET/opt cp -r /usr/lib/new_install/operation/finish_install $TARGET/opt } main () { prep info "Running finish install" /usr/bin/python finish_install.py >>$DEV_LOG 2>&1 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="/var/finish_install" main "$@"