Για την ώρα είναι ένα απλό script στο μέλλον ίσως αποκτίσει και ένα desktop endry...
#!/bin/bash
# Slackware bash script named SBKS (Slack-Build-Kernel-Script)
# Anagnostakis Ioannis 12/2022 GR (Crete) and there is NOT a copyright!
# Plz make it better and share it to SlackWorld :)
#
#
#
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# next 3 lines need edit every time you update/rebuild a new linux kernel
# kernel.org branch url and target files
KERNEL_URL=https://cdn.kernel.org/pub/linux/kernel/v6.x
KERNEL_VERSION=6.1
VERSION2=6.1.0
# Normal dont need edit next lines exept if you want to use "make menuconfig"
KERNEL_TAR=linux-$KERNEL_VERSION.tar.xz
KERNEL_SIGN=linux-$KERNEL_VERSION.tar.sign
PRGNAM=linux
GPG=gpg2
AWK=awk
WGET=wget
JOBS=${JOBS:-" -j$(expr $(getconf _NPROCESSORS_ONLN) \* 2 ) "}
# you must be root
if [ "$EUID" -ne 0 ];then
echo "Please run this script as root"
exit 1
fi
# Check if BOTH kernel version AND signature file exist
$WGET -c --spider $KERNEL_URL/linux-$KERNEL_VERSION.tar.{sign,xz}
if [ $? ]
then
# Download kernel AND signature
$WGET -c $KERNEL_URL/linux-$KERNEL_VERSION.tar.{sign,xz}
fi
# Using GnuPG to verify kernel signatures
# Not working with all kernels every time,sorry , thats why set -e starting after this step.
unxz linux-$KERNEL_VERSION.tar.xz
$GPG --verify linux-$KERNEL_VERSION.tar.sign
xz -cd $KERNEL_VERSION.tar.xz | gpg2 --verify linux-$KERNEL_VERSION.tar.sign -
echo "---------------CHECK IF KEYS ARE THE SAME. IF YES hit 'y' ---"
echo "################ IF ARE NOT THE SAME hit 'n' ###############"
while true; do
read -p "Do you want to proceed? (y/n) " yn
case $yn in
[yY] ) echo ok, we will proceed;
break;;
[nN] ) echo exiting...;
exit;;
* ) echo invalid response;;
esac
done
echo doing stuff...
# «κάλλιο γαϊδουρόδενε, παρά γαϊδουρογύρευε» <--Ancient Greek adage from my Grand, grand, grand ...father. The founder of "set -e" 3679 BC
set -e
# script check if Grub is installed to your system, if not exit...
if [ /boot/grub/grub.cfg ]
then
echo " OK you have grub as bootloader"
else
exit 0
fi
# create and direcory, put kernel tarbal there for the rest of the work
mkdir -p kernel-$KERNEL_VERSION
cp $PRGNAM-$KERNEL_VERSION.tar kernel-$KERNEL_VERSION/
cd kernel-$KERNEL_VERSION/
echo "untar Linux-kernel "
sleep 3
tar xvpf $PRGNAM-$KERNEL_VERSION.tar
echo "cd to Linux-kernel package and make oldconfig"
# My old .config I use has commended
# CONFIG_SYSTEM_TRUSTED_KEYS
# CONFIG_SYSTEM_TRUSTED_KEYRING
sleep 3
cd $PRGNAM-$KERNEL_VERSION/
zcat /proc/config.gz > .config
make oldconfig
# uncomend next line if you want make menuconfig
# make menuconfig
echo 'Lets Burn Out CPU!!!!! AND BUILD THE UNIVERSE'
sleep 3
make $JOBS
make modules_install
echo "finish build and install"
sleep 2
# cp vnlinuz and ln System.map etc. Some things are optional but just in case...not hurt.
cp arch/x86_64/boot/bzImage /boot/vmlinuz-$VERSION2
cp System.map /boot/System.map-$VERSION2
cd /boot
rm System.map
ln -s System.map-$VERSION2 System.map
# I prefer this type of kernel in my Slackware systems
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $VERSION2 > mymkinitrd.sh
sh mymkinitrd.sh
# update-grub
grub-mkconfig -o /boot/grub/grub.cfg
echo 'YOU NEVER CAN BE SURE WITH GRUB!!!'
echo "update-grub again"
grub-mkconfig -o /boot/grub/grub.cfg
sleep 3
# Just be sure that modules are on the right place
echo 'modules where are you?'
ls /lib/modules/
sleep 3
echo 'Did you saw them?'
sleep 2
# I m really sorry but, I never wrote a serious script in my life, its a tradition to add bullshits inside.
# Although I use Gnome beacause it buggy and always I have something to fix.
# Assume that you have KDE in your full Slackware installation...
/usr/bin/mplayer /usr/share/sounds/KDE-KStars-Alert.ogg &
curl -s "wttr.in/$1?m1"
echo 'Is that a snowflake or the Sun?'
sleep 4
exit 0