Building new Linux kernel on Slackware Linux 14.2

Requirements

Building new Linux kernel

# I will go with 5.10.71 since it's a longterm version
# You can change it to whatever You like on kernel.org

wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.71.tar.xz
tar -C /usr/src xvf linux-5.10.71.tar.xz
cd /usr/src
rm linux
ln -s linux-5.10.71 linux

zcat /proc/config.gz > /usr/src/linux/.config
cd linux

# I want to use default's for new config, so just go with
make olddefconfig

# Change CONFIG_RETPOLINE to "n"
sed -i 's/CONFIG_RETPOLINE.*$/CONFIG_RETPOLINE=n/g' .config

# Build kernel
make -j4 bzImage modules
make modules_install
cp arch/x86_64/boot/bzImage /boot/vmlinuz-5.10
cp System.map /boot/System.map-5.10
cp .config /boot/config-5.10

cd /boot
rm System.map
ln -s System.map-5.10 System.map

# Modify LILO
cat >>/etc/lilo.conf <<EOF
image = /boot/vmlinuz-5.10
  root = /dev/sda1
  label = "Linux 5.10"
  read-only
EOF

# Update LILO configuration
lilo

# Done
reboot
    

Documents