linux: Fix update script
The script was wrecking `modDirVersion`, putting them back and
ensuring it will not break again.
commit922c07d2d2a857a5cf1685a2178dd3fd122f8b46
authorTim Steinbach <tim@nequissimus.com>
dateSun 7 Apr 2019, 08:34 (8 years ago)
parentba24e89
pkgs/os-specific/linux/kernel/linux-4.14.nix+1
@@ -6,6 +6,7 @@ buildLinux (args // rec {
66 version = "4.14.111";
77
88 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
9+ modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
910
1011 # branchVersion needs to be x.y
1112 extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
pkgs/os-specific/linux/kernel/linux-4.19.nix+1
@@ -6,6 +6,7 @@ buildLinux (args // rec {
66 version = "4.19.34";
77
88 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
9+ modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
910
1011 # branchVersion needs to be x.y
1112 extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
pkgs/os-specific/linux/kernel/linux-5.0.nix+1
@@ -6,6 +6,7 @@ buildLinux (args // rec {
66 version = "5.0.7";
77
88 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
9+ modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
910
1011 # branchVersion needs to be x.y
1112 extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
pkgs/os-specific/linux/kernel/update.sh+1−4
@@ -48,10 +48,7 @@ ls $NIXPKGS/pkgs/os-specific/linux/kernel | while read FILE; do
4848 sed -i "s/sha256 = \".*\"/sha256 = \"$HASH\"/g" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
4949
5050 # Rewrite the expression
51− sed -i -e '/version = /d' -e '/modDirVersion = /d' $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
52− if grep -q '^[0-9]\+.[0-9]\+$' <<< "$V"; then
53− sed -i "\#buildLinux (args // rec {#a \ modDirVersion = \"${V}.0\";" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
54− fi
51+ sed -i -e '/version = /d' $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
5552 sed -i "\#buildLinux (args // rec {#a \ version = \"$V\";" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
5653
5754 # Commit the changes