2019-02-26 12:45:54 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, coreutils, ubootOdroidXU3, runtimeShell }:
|
2017-03-20 09:52:08 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "odroid-xu3-bootloader-2015-12-04";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hardkernel";
|
|
|
|
repo = "u-boot";
|
2017-03-21 02:23:02 +01:00
|
|
|
rev = "fe2f831fd44a4071f58a42f260164544697aa666";
|
|
|
|
sha256 = "1h5yvawzla0vqhkk98gxcwc824bhc936bh6j77qkyspvqcw761fr";
|
2017-03-20 09:52:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildCommand = ''
|
2017-03-21 02:23:02 +01:00
|
|
|
install -Dm644 -t $out/lib/sd_fuse-xu3 $src/sd_fuse/hardkernel_1mb_uboot/{bl2,tzsw}.*
|
|
|
|
install -Dm644 -t $out/lib/sd_fuse-xu3 $src/sd_fuse/hardkernel/bl1.*
|
|
|
|
ln -sf ${ubootOdroidXU3}/u-boot-dtb.bin $out/lib/sd_fuse-xu3/u-boot-dtb.bin
|
2017-03-20 09:52:08 +01:00
|
|
|
|
2017-03-21 02:23:02 +01:00
|
|
|
install -Dm755 $src/sd_fuse/hardkernel_1mb_uboot/sd_fusing.1M.sh $out/bin/sd_fuse-xu3
|
2017-03-20 09:52:08 +01:00
|
|
|
sed -i \
|
2019-02-26 12:45:54 +01:00
|
|
|
-e '1i#!${runtimeShell}' \
|
2017-03-20 09:52:08 +01:00
|
|
|
-e '1iPATH=${lib.makeBinPath [ coreutils ]}:$PATH' \
|
2017-03-21 02:23:02 +01:00
|
|
|
-e '/set -x/d' \
|
|
|
|
-e 's,.\/sd_fusing\.sh,sd_fuse-xu3,g' \
|
|
|
|
-e "s,\./,$out/lib/sd_fuse-xu3/,g" \
|
2017-03-20 09:52:08 +01:00
|
|
|
$out/bin/sd_fuse-xu3
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-03-20 09:52:08 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
description = "Secure boot enabled boot loader for ODROID-XU{3,4}";
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|