Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions package/kernelctl/kernelctl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ get_kernel_names() {

# get current kernel
get_current_kernel_name() {
current_kernel_name=$(find "$kernelctl_dir" -samefile "$kernelctl_dir"/current.tar.bz2 ! -name current.tar.bz2 -print0 | xargs -0 -I"{}" basename {} .tar.bz2)
if [[ -e "$kernelctl_dir"/current.tar.bz2 ]]; then
current_kernel_name=$(find "$kernelctl_dir" -samefile "$kernelctl_dir"/current.tar.bz2 ! -name current.tar.bz2 -print0 | xargs -0 -I"{}" basename {} .tar.bz2)
else
current_kernel_name=''
fi
}

# translate input into a kernel name
Expand Down Expand Up @@ -104,8 +108,12 @@ list() {
# show the current configured kernel
show() {
get_current_kernel_name
echo -e "${gr}Current kernel:${sf}"
echo -e " ${bf}${current_kernel_name}${sf}"
if [[ "$current_kernel_name" = "" ]]; then
echo -e "${bf}There is no link to the current running kernel in the staging area.${sf}"
else
echo -e "${gr}Current kernel:${sf}"
echo -e " ${bf}${current_kernel_name}${sf}"
fi
}

# actually switch kernels
Expand Down
13 changes: 3 additions & 10 deletions package/kernelctl/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
pkgnames=(kernelctl)
pkgdesc="Manage aftermarket kernels"
url=https://toltec-dev.org/
pkgver=0.1-4
timestamp=2022-03-14T00:00Z
pkgver=0.1-5
timestamp=2022-11-12T00:00Z
section="utils"
maintainer="Salvatore Stella <etn45p4m@gmail.com>"
license=MIT
Expand All @@ -27,14 +27,7 @@ package() {

configure() {
if [[ "$(kernelctl list | tail -n +2 | awk '{print $2}' | grep "vanilla-$(< /etc/version)")" == "" ]]; then
read -r -d '' msg <<- EOM
It looks like there is no backup of the upstream kernel for the
installed version of codex.

Please standby while one is produced (assuming that the
currently running kernel is upstream).
EOM
echo -e "$msg"
echo "Creating a backup of the currently running kernel."
kernelctl backup vanilla
fi
}