2021-08-24 07:55:14 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#########################
|
|
|
|
# Alnux sel(ect) Script #
|
|
|
|
#########################
|
2021-08-25 12:37:56 +03:00
|
|
|
. "/etc/al/lnver.cfg"
|
2021-08-24 07:55:14 +03:00
|
|
|
case $1 in
|
2021-08-24 08:32:32 +03:00
|
|
|
linux) if [ $(whoami) != root ]; then
|
|
|
|
case $2 in
|
2021-08-25 12:37:56 +03:00
|
|
|
# Lists all kernels
|
2021-08-24 07:55:14 +03:00
|
|
|
list) ls /usr/src/ | grep 'linux' &&
|
|
|
|
ls -L /usr/src/linux 2>/dev/null
|
|
|
|
;;
|
2021-08-25 12:37:56 +03:00
|
|
|
# Sets a kernel version
|
|
|
|
set) lnver=${3} > /etc/al/lnver.cfg
|
2021-08-24 07:55:14 +03:00
|
|
|
;;
|
2021-08-25 12:37:56 +03:00
|
|
|
# Links the set kernel version.
|
2021-08-24 07:55:14 +03:00
|
|
|
link) ln -sv /usr/src/linux-${lnver} /usr/src/linux &&
|
|
|
|
mkdir -pv /var/aps/packages/linux/ &&
|
|
|
|
echo "/boot/vmlinuz-linux-${lnver}" > /var/aps/packages/linux/payloadfiles &&
|
|
|
|
echo "/usr/src/${lnver}" >> /var/aps/packages/linux/payloadfiles &&
|
|
|
|
echo "pkg_config_deploy=true" > /var/aps/packages/linux/package &&
|
|
|
|
echo "pkg_config_ver='${lnver}'" >> /var/aps/packages/linux/package &&
|
|
|
|
echo "pkg_config_name='linux'" >> /var/aps/packages/linux/package &&
|
|
|
|
echo "pkg_config_makedepends=''" >> /var/aps/packages/linux/package &&
|
|
|
|
echo "pkg_config_depends=''" >> /var/aps/packages/linux/package
|
2021-08-25 12:37:56 +03:00
|
|
|
|
2021-08-24 07:55:14 +03:00
|
|
|
;;
|
2021-08-25 12:37:56 +03:00
|
|
|
# Destroys the symlink.
|
|
|
|
destroy) rm -rfv /usr/src/linux ;;
|
2021-08-24 07:55:14 +03:00
|
|
|
esac
|
2021-08-24 08:32:32 +03:00
|
|
|
fi
|
2021-08-24 07:55:14 +03:00
|
|
|
esac
|