aps/altools/sel

36 lines
1.3 KiB
Text
Raw Permalink Normal View History

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