Skip to content

Commit 5920a68

Browse files
committed
get current kernel by reading /vmlinuz link
1 parent 8b01ddb commit 5920a68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ubuntukernel-load.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ fixup_shutdown_initrd() {
106106
}
107107

108108
get_kernel_version() {
109-
# last linux-image-* package in the list is the current kernel
110-
UBUNTU_KERNEL_VERSION=$(dpkg -l "linux-image*"|grep ^ii| tail -1 |awk '{print $2}'|cut -f3- -d-)
109+
# i guess /vmlinuz always points to the current kernel
110+
UBUNTU_KERNEL_VERSION=$(readlink /vmlinuz | cut -f2- -d-)
111111
if [ -r $UBUNTU_KERNEL_STAMP ] ; then
112112
INITRD_KERNEL_VERSION=$(cat $UBUNTU_KERNEL_STAMP)
113113
fi

0 commit comments

Comments
 (0)