Files
new_install/operation/copy_kernels.sh
qinbo c1cce3bf5b update opteration
install.txt from install_0.4.txt
2010-09-19 14:35:35 +08:00

72 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
#
# DESCRIPTION: copying kernel and modules to system
#
# SCRIPT NAME: copy_kernel.sh
#
# Input: stdin
# 1.
# 2.
#
# Output:
# NULL
# Return value:
# 1 kernel directory/modules directory/initrd.gz/makeinitrd doesn't exist
#
# AUTHOR: Qin Bo
#
# EMAIL: bqin@linx-info.com
#
# DATE: 2010-08-23
#
# HISTORY:
# REVISOR DATE MODIFICATION
# Qin Bo 2010-08-23 create
#
#
#
source ./functions
main ()
{
info "copy $KERNELS/* to $TARGET/boot/"
if [ -d "$KERNELS" ];then
cp -r "$KERNELS"/* "$TARGET/boot/" 2>>$DEV_LOG
else
err "$KERNELS directory doesn't exist "
exit 1
fi
info "copy $MODULES/* to $TARGET/lib/modules/"
if [ -d "$MODULES" ];then
cp -r "$MODULES"/* "$TARGET/lib/modules/" 2>>$DEV_LOG
else
err "$MODULES directory doesn't exist "
exit 1
fi
info "copy $INITRD/initrd.gz to $TARGET/boot/initrd.gz.old"
if [ -e "$INITRD/initrd.gz" ];then
cp "$INITRD/initrd.gz" "$TARGET/boot/initrd.gz.old" 2>>$DEV_LOG
else
err "$INITRD/initrd.gz doesn't exist "
exit 1
fi
info "runing makeinitrd"
if [ -e ./makeinitrd ];then
./makeinitrd 2>>$DEV_LOG
else
err "makeinitrd doesn't exist "
exit 1
fi
}
KERNELS="/Rocky/kernels"
MODULES="/Rocky/modules"
INITRD="/Rocky/initrd"
main "$@"