linux/manual-config: Install the kernel with the name given in stdenv.platform.kernelTarget
This commit is contained in:
parent
f4847262ae
commit
fd330e9315
|
@ -61,10 +61,10 @@ in
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
|
installkernel = name: writeTextFile { name = "installkernel"; executable=true; text = ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
mkdir $4
|
mkdir $4
|
||||||
mv -v $2 $4
|
mv -v $2 $4/${name}
|
||||||
mv -v $3 $4
|
mv -v $3 $4
|
||||||
'';};
|
'';};
|
||||||
|
|
||||||
|
@ -72,6 +72,12 @@ let
|
||||||
|
|
||||||
installsFirmware = (config.isEnabled "FW_LOADER") &&
|
installsFirmware = (config.isEnabled "FW_LOADER") &&
|
||||||
(isModular || (config.isDisabled "FIRMWARE_IN_KERNEL"));
|
(isModular || (config.isDisabled "FIRMWARE_IN_KERNEL"));
|
||||||
|
|
||||||
|
commonMakeFlags = [
|
||||||
|
"O=../build"
|
||||||
|
"INSTALL_PATH=$(out)"
|
||||||
|
] ++ (optional isModular "MODLIB=$(out)/lib/modules/${modDirVersion}")
|
||||||
|
++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
@ -86,7 +92,7 @@ stdenv.mkDerivation {
|
||||||
inherit patches src;
|
inherit patches src;
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
for mf in $(find -name Makefile -o -name Makefile.include); do
|
for mf in $(find -name Makefile -o -name Makefile.include -o -name install.sh); do
|
||||||
echo "stripping FHS paths in \`$mf'..."
|
echo "stripping FHS paths in \`$mf'..."
|
||||||
sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
|
sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
|
||||||
done
|
done
|
||||||
|
@ -104,12 +110,15 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
buildNativeInputs = [ perl nettools ] ++ optional isModular kmod;
|
buildNativeInputs = [ perl nettools ] ++ optional isModular kmod;
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = commonMakeFlags ++ [
|
||||||
"O=../build"
|
"INSTALLKERNEL=${installkernel stdenv.platform.kernelTarget}"
|
||||||
"INSTALL_PATH=$(out)"
|
];
|
||||||
"INSTALLKERNEL=${installkernel}"
|
|
||||||
] ++ (optional isModular "MODLIB=$(out)/lib/modules/${modDirVersion}")
|
crossAttrs = {
|
||||||
++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
|
makeFlags = commonMakeFlags ++ [
|
||||||
|
"INSTALLKERNEL=${installkernel stdenv.cross.platform.kernelTarget}"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
postInstall = stdenv.lib.optionalString installsFirmware ''
|
postInstall = stdenv.lib.optionalString installsFirmware ''
|
||||||
mkdir -p $out/lib/firmware
|
mkdir -p $out/lib/firmware
|
||||||
|
|
Loading…
Reference in New Issue