shell-base/modules/utility/kernel.mod

30 lines
830 B
Bash

#!/bin/bash
module_load confirm
kernel_links () {
dir=${1:-/boot}
pushd "$dir" || ( echo "no such directory $dir"; return 1; )
echo creating initramfs link in "$dir"
ls -la initramfs*
irfs=$(ls -t initramfs*.img | head -2 | grep -v fallback)
if [[ $irfs ]]; then
if confirm make a initramfs link to "$irfs" in "$dir"; then
sudo ln -sf "$irfs" initramfs
fi
else
echo "could not find a latest initramfs in $dir/"
fi
ls -la
echo now creating vmlinuz link in "$dir"
ls -la vmlinuz*
vmlz=$(ls -t vmlinuz* | head -1)
if [[ $vmlz ]]; then
if confirm make a vmlinuz link to "$vmlz" in "$dir"; then
sudo ln -sf "$vmlz" vmlinuz
fi
else
echo "could not find a latest vmlinuz in $dir/"
fi
ls -la
popd || return 2
}