Last active
August 25, 2022 01:18
-
-
Save iKrishneel/d10013959d5d8ed57488e74ddf627ae8 to your computer and use it in GitHub Desktop.
realtime_kernal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
VERSION=5.13 | |
cd $HOME/ && mkdir rt_kernel && cd rt_kernel | |
wget -m -np https://cdn.kernel.org/pub/linux/kernel/projects/rt/$VERSION/ | |
cd cdn.kernel.org/pub/linux/kernel/projects/rt/$VERSION/linux-$VERSION | |
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-$VERSION.tar.xz | |
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-$VERSION.tar.gz | |
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-$VERSION.tar.sign | |
tar -xzf linux-$VERSION.tar.gz | |
gunzip patch-$VERSION-rt1.patch.gz | |
cd linux-$VERSION | |
patch -p < ../patch-$VERSION-rt1.patch | |
# copy the current boot config (please check the version manually in case of different config) | |
cp -r /boot/config-$(uname -r) .config | |
# fix the dep-src | |
sudo sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list && apt update | |
sudo apt-get build-dep linux -y | |
sudo apt-get install -y libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf fakeroot | |
yes '' | make oldconfig | |
make menuconfig # manual interaction is required here | |
# check to ensure the config is same in the comment. | |
make -j `nproc` deb-pkg | |
sudo dpkg -i ../*.deb |
#/usr/bin/env bash
VERSION=5.13
function downloadIfNotExists {
if [ ! -f $1 ]; then
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/$1
fi
}
if [ ! -d "$HOME/rt_kernel" ]; then
mkdir $HOME/rt_kernel
fi
cd $HOME/rt_kernel
if [ ! -d "cdn.kernel.org" ]; then
wget -m -np https://cdn.kernel.org/pub/linux/kernel/projects/rt/$VERSION/
fi
cd cdn.kernel.org/pub/linux/kernel/projects/rt/$VERSION/
downloadIfNotExists linux-$VERSION.tar.xz
downloadIfNotExists linux-$VERSION.tar.gz
downloadIfNotExists linux-$VERSION.tar.sign
tar -xzf linux-$VERSION.tar.gz
gunzip -f -k patch-$VERSION-rt1.patch.gz
cd linux-$VERSION
patch -p1 < ../patch-$VERSION-rt1.patch
# copy the current boot config (please check the version manually in case of different config)
cp -r /boot/config-$(uname -r) .config
# fix the dep-src
sudo sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list
sudo apt update && sudo apt-get build-dep linux -y
sudo apt-get install -y libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf fakeroot
yes '' | make oldconfig
# set the ARCH_SUPPORTS_RT default to 'yes' to add the realtime option.
sed -i '1079s/bool/def_bool\ y/' arch/Kconfig
make menuconfig # manual interaction is required here
# check to ensure the config is same in the comment.
yes '' | make -j `nproc` deb-pkg
sudo dpkg -i ../*.deb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check that the setting when running
make menuconfig
has the following config