I installed FreePBX 17.0.19.24 with the dahdi kernel module, and when I run apt update/upgrade the active kernel version remains at 6.1.0-27-amd64, the latest version with dahdi support.
However, after any apt update/upgrade run the /usr/bin/post-apt-run script throws the error:
/usr/bin/post-apt-run: line 15: [[: "1>2": syntax error: operand expected (error token is ""1>2"")
This is happening because my debian 12 boot menu uses a sub-menu. The first line of the boot menu is the latest available kernel version, and line two is the submenu, conatining all the other kernel versions and other menu choices, and “1>2” is the submenu entry corresponding to 6.1.0-27-amd64, defined as GRUB_DEFAULT in /etc/default/grub.
I did not create this sub-menu; it is what came with the debian 12 installation.
The post-apt-run script continues running after this error, but it does not select a kernel version. It writes the following journal line:
: Checking kernel modules for dahdi and wanpipe for kernel image
: Upgrading dahdi-linux-kmod- and kmod-wanpipe-
Where a kernel version should appear after the ‘-’.
I’m not up to debgging the /usr/bin/post-app-run script or getting grub to build a boot menu with no submenu in it. Today I unconditionally ran:
I could do that, but I think that the 6.1.0-32 kernel is already installed via apt update/upgrade. It’s only the GRUB_DEFAULT definition in /etc/default/grub that forces the use of 6.1.0-27. Might it not be enough to just remove or change that, run “update-grub”, and re-boot?
I was able to stop grub from buuilding a submenu in the boot menu, by adding the line:
GRUB_DISABLE_SUBMENU=yes
To /etc/default/grub, and then running “update-grub” as root. The resulting boot menu had the newest kernel (6.1.0-32) on top, So I changed the GRUB_DEFAULT value in /etc/default/grub from “1>2” to “0”, and ran “update-grub” once again.
The “/usr/bin/post-apt-run” script no longer errors on the “1>2” entry, but it still fails to extract a kernel version from the full kernel name “vmlinuz-6.1.0-32-amd64”, so it always runs:
apt -y upgrade dahdi-linux-kmod- kmod-wanpipe-
This doesn’t do anything because those modules do not exist.
I modified /usr/bin/post-apt-run and the new version does isolate the “6.1.0-32” version from the kernel name. I am apparently too new of a forum user to upload files, but the diff listing is as follows:
The new script includes an alternate, commented-out way to derive the version number. Both work on my system’s kernel name, but I do not know what a generalized version string looks like.
I’m not very good with sed, so I didn’t try to debug this. I instead found a couple of other ways to isolate the “6.1.0-32” part, as shown in the diff output above. This website seems to not want me to mess with the tracker website.