mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-09-11 12:05:26 +03:00
kernel-builder: Fix fallout from nixpkgs#110544
Deals with https://github.com/NixOS/nixpkgs/pull/110544 This is a breaking change; the kernel builder cannot be used with a Nixpkgs from before this change, and vice-versa.
This commit is contained in:
parent
225ed39dad
commit
d14b99e90f
@ -53,8 +53,8 @@ let
|
|||||||
modDirify = v: v;
|
modDirify = v: v;
|
||||||
|
|
||||||
# Shortcuts
|
# Shortcuts
|
||||||
inherit (stdenv.hostPlatform) platform;
|
|
||||||
inherit (lib) optionals optional optionalString;
|
inherit (lib) optionals optional optionalString;
|
||||||
|
platform = stdenv.hostPlatform;
|
||||||
|
|
||||||
maybeString = str: optionalString (str != null) str;
|
maybeString = str: optionalString (str != null) str;
|
||||||
in
|
in
|
||||||
@ -72,11 +72,11 @@ in
|
|||||||
|
|
||||||
# Handling of QCDT dt.img
|
# Handling of QCDT dt.img
|
||||||
, isQcdt ? false
|
, isQcdt ? false
|
||||||
, qcdt_dtbs ? "arch/${platform.kernelArch}/boot/"
|
, qcdt_dtbs ? "arch/${platform.linuxArch}/boot/"
|
||||||
|
|
||||||
# Handling of Exynos dt.img
|
# Handling of Exynos dt.img
|
||||||
, isExynosDT ? false
|
, isExynosDT ? false
|
||||||
, exynos_dtbs ? "arch/${platform.kernelArch}/boot/dts/*.dtb"
|
, exynos_dtbs ? "arch/${platform.linuxArch}/boot/dts/*.dtb"
|
||||||
, exynos_platform ? "0x50a6"
|
, exynos_platform ? "0x50a6"
|
||||||
, exynos_subtype ? "0x217584da"
|
, exynos_subtype ? "0x217584da"
|
||||||
|
|
||||||
@ -150,9 +150,9 @@ let
|
|||||||
|
|
||||||
hasDTB = platform ? kernelDTB && platform.kernelDTB;
|
hasDTB = platform ? kernelDTB && platform.kernelDTB;
|
||||||
kernelFileExtension = if isCompressed != false then ".${isCompressed}" else "";
|
kernelFileExtension = if isCompressed != false then ".${isCompressed}" else "";
|
||||||
kernelTarget = if platform.kernelTarget == "Image"
|
kernelTarget = if platform.linux-kernel.target == "Image"
|
||||||
then "${platform.kernelTarget}${kernelFileExtension}"
|
then "${platform.linux-kernel.target}${kernelFileExtension}"
|
||||||
else platform.kernelTarget;
|
else platform.linux-kernel.target;
|
||||||
in
|
in
|
||||||
|
|
||||||
# This `let` block allows us to have a self-reference to this derivation.
|
# This `let` block allows us to have a self-reference to this derivation.
|
||||||
@ -171,7 +171,7 @@ stdenv.mkDerivation (inputArgs // {
|
|||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr ]
|
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr ]
|
||||||
++ optional (platform.kernelTarget == "uImage") buildPackages.ubootTools
|
++ optional (platform.linux-kernel.target == "uImage") buildPackages.ubootTools
|
||||||
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
|
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
|
||||||
++ optional (lib.versionAtLeast version "4.15") utillinux
|
++ optional (lib.versionAtLeast version "4.15") utillinux
|
||||||
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
|
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
|
||||||
@ -396,7 +396,7 @@ stdenv.mkDerivation (inputArgs // {
|
|||||||
|
|
||||||
'' + optionalString isImageGzDtb ''
|
'' + optionalString isImageGzDtb ''
|
||||||
echo ":: Copying platform-specific -dtb image file"
|
echo ":: Copying platform-specific -dtb image file"
|
||||||
cp -v "$buildRoot/arch/${platform.kernelArch}/boot/${kernelTarget}-dtb" "$out/"
|
cp -v "$buildRoot/arch/${platform.linuxArch}/boot/${kernelTarget}-dtb" "$out/"
|
||||||
|
|
||||||
''
|
''
|
||||||
+ maybeString postInstall
|
+ maybeString postInstall
|
||||||
@ -408,7 +408,7 @@ stdenv.mkDerivation (inputArgs // {
|
|||||||
"O=$(buildRoot)"
|
"O=$(buildRoot)"
|
||||||
"CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
"CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
|
||||||
"HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
|
"HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
|
||||||
"ARCH=${platform.kernelArch}"
|
"ARCH=${platform.linuxArch}"
|
||||||
"DTC_EXT=${buildPackages.dtc}/bin/dtc"
|
"DTC_EXT=${buildPackages.dtc}/bin/dtc"
|
||||||
"KBUILD_BUILD_VERSION=1-mobile-nixos"
|
"KBUILD_BUILD_VERSION=1-mobile-nixos"
|
||||||
]
|
]
|
||||||
@ -525,8 +525,8 @@ stdenv.mkDerivation (inputArgs // {
|
|||||||
export PATH="$PATH:${buildPackages.gnumake}/bin"
|
export PATH="$PATH:${buildPackages.gnumake}/bin"
|
||||||
export KCONFIG_CONFIG="\$(readlink -f "\$1")"; shift
|
export KCONFIG_CONFIG="\$(readlink -f "\$1")"; shift
|
||||||
|
|
||||||
export SRCARCH="${platform.kernelArch}"
|
export SRCARCH="${platform.linuxArch}"
|
||||||
export ARCH="${platform.kernelArch}"
|
export ARCH="${platform.linuxArch}"
|
||||||
export KERNELVERSION="${version}"
|
export KERNELVERSION="${version}"
|
||||||
cd "\$KERNEL_TREE"
|
cd "\$KERNEL_TREE"
|
||||||
${/* We're expanding the builder's makeFlags variable here. This is not a mistake. */""}
|
${/* We're expanding the builder's makeFlags variable here. This is not a mistake. */""}
|
||||||
|
Loading…
Reference in New Issue
Block a user