Problem
--dir keeps the path exactly as typed (line 693):
INSTALL_DIR="$2"/linux-kernel
The script then moves into that folder (line 1276, cd "$INSTALL_DIR") and later uses the same path again from inside it. A relative path like --dir build then points at build/linux-kernel/build/linux-kernel, which doesn't exist. Two checks break this way:
- The tarball check:
TARGETDIR="$INSTALL_DIR" (line 969), then does not exist (line 1033).
- The source tree check:
if [ -d "$INSTALL_DIR"/linux-"${LINUX_VER}" ] (line 1317).
So a relative --dir never works:
-
With verification (the default): the script stops silently during "Downloading and Verifying source code tarball...". The only explanation is in the log: rel/linux-kernel does not exist. (Why nothing appears on screen is Tarball verification failures end the script with no message on screen #50.)
-
With verification off: the script downloads and unpacks the source, then skips configuring and compiling entirely, and ends with:
./ki.sh: line 1423: rel/linux-kernel/linux_full_ver: No such file or directory
[ERROR] Kernel build did not produce packages for 6.12.113; aborting before installation. See …/kernel_installer.log for build errors.
The INSTALL_DIR environment variable has the same problem. The README examples use absolute paths (/path/to/dir), so they don't run into this.
Suggested fix
Turn the path into an absolute one when the option is read, for example:
dir=$2
[[ $dir == /* ]] || dir=$PWD/$dir
INSTALL_DIR=$dir/linux-kernel
How this was checked
On wintermute (Linux Mint 22.3), main at 79c3234, building 6.12.113 with -c defconfig, run from ~/ki-rev under unshare -r. The test copy (ki.sh; its line numbers match kernel_installer.sh) only moved the log into the script's folder and dropped lz4, gawk and apt-transport-https from the Debian package list. A run that gets through the build ends at the first apt-get install with "are you root?".
| run |
phases shown |
result |
--dir rel, verification on |
1–2 |
exit code 1 with no message on screen; log: rel/linux-kernel does not exist |
--dir rel, verification off |
1–3 |
the error lines above |
control: --dir /home/claude/ki-rev/abs, verification off |
1–6 |
reached apt-get install |