From c394a6318a6034be512105d4d5bf810952694143 Mon Sep 17 00:00:00 2001 From: "Xu, Shunxuan" Date: Wed, 30 Nov 2016 17:36:55 +0800 Subject: [PATCH] =?UTF-8?q?[Bug=20#2894]=20=E6=B7=BB=E5=8A=A0virtio=20stat?= =?UTF-8?q?egrid=20autoinstall=E5=AE=89=E8=A3=85=E9=80=89=E9=A1=B9,?= =?UTF-8?q?=E6=AD=A4=E9=80=89=E9=A1=B9=E5=AE=89=E8=A3=85=E4=BC=9A=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAG=E7=89=88=E5=86=85=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新文件: operation/finish_install/67install_virtio_redpath_kernel.sh 新文件: operation/finish_install/exec_install_redpatch_kernel.sh Signed-off-by: Xu, Shunxuan --- .../67install_virtio_redpath_kernel.sh | 21 +++++++++++++++++++ .../exec_install_redpatch_kernel.sh | 16 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 operation/finish_install/67install_virtio_redpath_kernel.sh create mode 100644 operation/finish_install/exec_install_redpatch_kernel.sh diff --git a/operation/finish_install/67install_virtio_redpath_kernel.sh b/operation/finish_install/67install_virtio_redpath_kernel.sh new file mode 100755 index 0000000..c095971 --- /dev/null +++ b/operation/finish_install/67install_virtio_redpath_kernel.sh @@ -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 diff --git a/operation/finish_install/exec_install_redpatch_kernel.sh b/operation/finish_install/exec_install_redpatch_kernel.sh new file mode 100644 index 0000000..f832c13 --- /dev/null +++ b/operation/finish_install/exec_install_redpatch_kernel.sh @@ -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 !"