generate probably-non-functional firmware image for gl-ar750
This commit is contained in:
parent
a1a1abb8c7
commit
f9626d00f4
6 changed files with 141 additions and 10 deletions
|
@ -34,9 +34,9 @@ let
|
|||
cp -a . $out
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
in rec {
|
||||
vmlinux = callPackage ./vmlinux.nix {
|
||||
inherit tree config checkedConfig;
|
||||
};
|
||||
uimage = callPackage ./uimage.nix { };
|
||||
}
|
||||
|
|
42
kernel/uimage.nix
Normal file
42
kernel/uimage.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
lzma
|
||||
, stdenv
|
||||
, ubootTools
|
||||
} :
|
||||
let
|
||||
objcopy = "${stdenv.cc.bintools.targetPrefix}objcopy";
|
||||
in {
|
||||
vmlinux
|
||||
# , commandLine
|
||||
# , fdt ? null
|
||||
, entryPoint
|
||||
# , extraName ? "" # e.g. socFamily
|
||||
, loadAddress
|
||||
} :
|
||||
# patchDtbCommand = if (fdt != null) then ''
|
||||
# ( cat vmlinux.stripped ${fdt} > vmlinux.tmp ) && mv vmlinux.tmp vmlinux.stripped
|
||||
# '' else ''
|
||||
# echo patch-cmdline vmlinux.stripped '${commandLine}'
|
||||
# patch-cmdline vmlinux.stripped '${commandLine}'
|
||||
# echo
|
||||
# '';
|
||||
stdenv.mkDerivation {
|
||||
name = "kernel.image";
|
||||
phases = [ "buildPhase" "installPhase" ];
|
||||
nativeBuildInputs = [
|
||||
# patchImage
|
||||
lzma
|
||||
stdenv.cc
|
||||
ubootTools
|
||||
];
|
||||
buildPhase = ''
|
||||
${objcopy} -O binary -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id -S ${vmlinux} vmlinux.stripped
|
||||
# {patchDtbCommand}
|
||||
rm -f vmlinux.stripped.lzma
|
||||
lzma -k -z vmlinux.stripped
|
||||
mkimage -A mips -O linux -T kernel -C lzma -a ${loadAddress} -e ${entryPoint} -n 'MIPS Liminix Linux ' -d vmlinux.stripped.lzma kernel.image
|
||||
'';
|
||||
installPhase = ''
|
||||
cp kernel.image $out
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue