Closed InterLinked1 closed 1 year ago
@brown1d
Adding some of your insights from email a few months ago here, so they don't get lost over time. I've also reported this to Sangoma, but I'd be very surprised if they even understand the issue, let alone do anything about it.
Took defaults for modules:
Press Enter for Default: /lib/modules/5.10.0-14-cloud-amd64/build
And yes it died at:
./Setup: line 1350: [: : integer expression expected
Now On Ubuntu you get these values get populated because the script reads from: /lib/modules/5.15.0-41-generic/build/Makefile
as:
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 15
SUBLEVEL = 39
EXTRAVERSION =
NAME = Trick or Treat
Now on Debian that just contains:
[root@ip-10-0-0-135:/lib/modules/5.10.0-14-cloud-amd64/build#] more Makefile
include /usr/src/linux-headers-5.10.0-14-common/Makefile
And if you follow that link you find the variables:
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 10
SUBLEVEL = 113
EXTRAVERSION =
NAME = Dare mighty things
If you change the source directory to be: /usr/src/linux-headers-5.10.0-14-common
Then it magically works. Fix for this would be to make the shell script follow the include file, which we could do.
Ubuntu just uses a bunch of symbolic links to go from build to /usr/src/linux-headers-X, rather than using a Makefile include. Makefile include’s are a totally reasonable way of doing things, and certainly supported in GNU make. However the Wanpipe installer just tries to parse the variables out of the original Makefile, and does not follow includes. I tried to play last night to see if it was possible to build a Makefile that could be used to extract out only the variables but it does not seem to work right (i.e. use make as the parser, rather than rolling your own).
I see two ways to handle this:
Detect Ubuntu vs Debian, and pass the correct source path. However that’s going to mean we then need to track future changes to either
In Wanpipe installer handle includes, probably by using Recursion. The way the script file works it expects Makefiles to be called “Makefile” which is an assumption, and not unfair, but not always true…
I would go with option 2, as it could be rolled into a single wanpipe patch, and then we don’t have to worry what happens in the future.
Formally opening a bug for this: this was discussed via email about a month ago.
Wanpipe installation appears to be broken on Debian, but not Ubuntu. See unary operator expected warnings below: