#!/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 !"
