[Bug #2894] 添加virtio stategrid autoinstall安装选项,此选项安装会替换为G版内核

新文件:   operation/finish_install/67install_virtio_redpath_kernel.sh
	新文件:   operation/finish_install/exec_install_redpatch_kernel.sh

Signed-off-by: Xu, Shunxuan <sxxu@linx-info.com>
This commit is contained in:
Xu, Shunxuan
2016-11-30 17:36:55 +08:00
parent 911c08a72a
commit c394a6318a
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/bash
virtio=`cat /proc/cmdline | sed 's/.*virtio=\([^ ]*\).*/\1/'`
if [ $virtio == "true" ];then
source ./functions
mkdir -p $TARGET/redpatch_kernel
cp /Rocky/redpatch_kernel/*.tar.gz $TARGET/redpatch_kernel
cp /usr/lib/new_install/operation/finish_install/exec_install_redpatch_kernel.sh $TARGET/opt/
chmod +x $TARGET/opt/exec_install_redpatch_kernel.sh
chroot $TARGET /opt/exec_install_redpatch_kernel.sh >> $LOG_FILE 2>&1 && rm -rf $TARGET/opt/exec_install_redpatch_kernel.sh $TARGET/redpatch_kernel
mount -obind /dev $TARGET/dev
mount -obind /proc $TARGET/proc
mount -obind /sys $TARGET/sys
chroot $TARGET update-grub > /dev/null 2>&1
for mp in /dev /proc /sys
do
umount $mp
done
fi

View File

@@ -0,0 +1,16 @@
#!/bin/bash
kernel_dir="/redpatch_kernel"
for pkg in $(ls ${kernel_dir})
do
pkgname=$(echo $pkg |cut -d'#' -f1)
pkgrm $pkgname
pkgadd -f ${kernel_dir}/$pkg
done
pkgrm alsa-driver
pkgrm update-drivers
rm /lib/modules/2.6.32.41-rocky4.2-x86_64 -rf
echo -e "Install 2.6.32-redpatch kernel successfully !"