linux/kernel/manual-config: Use the kernel's make install
This commit is contained in:
parent
a9a7085684
commit
98341e0bda
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, runCommand, nettools, perl, kmod }:
|
{ stdenv, runCommand, nettools, perl, kmod, writeTextFile }:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
@ -54,7 +54,20 @@ in
|
|||||||
features ? readFeatures config
|
features ? readFeatures config
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let commonMakeFlags = [ "O=../build" ]; in
|
let
|
||||||
|
commonMakeFlags = [
|
||||||
|
"O=../build"
|
||||||
|
"INSTALL_PATH=$(out)"
|
||||||
|
"INSTALLKERNEL=${installkernel}"
|
||||||
|
];
|
||||||
|
|
||||||
|
installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
|
||||||
|
#!/bin/sh
|
||||||
|
mkdir $4
|
||||||
|
mv -v $2 $4
|
||||||
|
mv -v $3 $4
|
||||||
|
'';};
|
||||||
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
name = "linux-${version}";
|
name = "linux-${version}";
|
||||||
@ -70,9 +83,8 @@ stdenv.mkDerivation ({
|
|||||||
prePatch = ''
|
prePatch = ''
|
||||||
for mf in $(find -name Makefile -o -name Makefile.include); do
|
for mf in $(find -name Makefile -o -name Makefile.include); do
|
||||||
echo "stripping FHS paths in \`$mf'..."
|
echo "stripping FHS paths in \`$mf'..."
|
||||||
sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g'
|
sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
|
||||||
done
|
done
|
||||||
sed -i -e 's|/sbin/depmod|${kmod}/sbin/depmod|' Makefile
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
@ -85,19 +97,7 @@ stdenv.mkDerivation ({
|
|||||||
runHook postConfigure
|
runHook postConfigure
|
||||||
'';
|
'';
|
||||||
|
|
||||||
INSTALL_PATH = "$(out)";
|
buildNativeInputs = [ perl nettools kmod ];
|
||||||
|
|
||||||
buildNativeInputs = [ perl nettools ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
mkdir $out
|
|
||||||
mv -v ../build/System.map $out
|
|
||||||
# !!! Assumes x86
|
|
||||||
mv -v ../build/arch/x86/boot/bzImage $out
|
|
||||||
mv -v ../build/vmlinux $out
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = commonMakeFlags;
|
makeFlags = commonMakeFlags;
|
||||||
} // optionalAttrs features.modular {
|
} // optionalAttrs features.modular {
|
||||||
|
@ -5858,7 +5858,7 @@ let
|
|||||||
|
|
||||||
# A function to build a manually-configured kernel
|
# A function to build a manually-configured kernel
|
||||||
linuxManualConfig = import ../os-specific/linux/kernel/manual-config.nix {
|
linuxManualConfig = import ../os-specific/linux/kernel/manual-config.nix {
|
||||||
inherit stdenv runCommand nettools perl kmod;
|
inherit stdenv runCommand nettools perl kmod writeTextFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
keyutils = callPackage ../os-specific/linux/keyutils { };
|
keyutils = callPackage ../os-specific/linux/keyutils { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user