Skip to content

Commit 460cdab

Browse files
committed
[KB] LOCALVERSION length limit fix
The kernel has a 64 character limit for the VERSION. LOCALVERSION is an extension of the internal version. This will set a 54 character limit so that there is extra padding just in case there are unforeseen reasons that it would be longer than the 6 characters like in `4.18.0`.
1 parent 55a2b22 commit 460cdab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kernel_build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ else
7676
fi
7777

7878
echo "Setting Local Version for build"
79-
sed -i_bak "s/CONFIG_LOCALVERSION=\"\"/CONFIG_LOCALVERSION=\"-${BRANCH}-$(git rev-parse --short HEAD)\"/g" .config
79+
LOCALVERSION="-${BRANCH}-$(git rev-parse --short HEAD)"
80+
# Shrink the LOCALVERSION to fit in the config
81+
# Remove to a max of 54 characters (max is 64 but we want a buffer)
82+
if [ ${#LOCALVERSION} -gt 54 ]; then
83+
LOCALVERSION=$(echo "${LOCALVERSION}" | cut -c1-54)
84+
fi
85+
86+
sed -i_bak "s/CONFIG_LOCALVERSION=\"\"/CONFIG_LOCALVERSION=\"${LOCALVERSION}\"/g" .config
8087
grep "CONFIG_LOCALVERSION=" .config
8188

8289
echo "Making olddefconfig"

0 commit comments

Comments
 (0)