1
0
Fork 0

also work around mkbootimage potential bug with szl

This commit is contained in:
Sebastien Bourdeauducq 2020-05-06 17:46:37 +08:00
parent 27466036a7
commit ae2cee5f7e
1 changed files with 8 additions and 6 deletions

View File

@ -68,15 +68,19 @@ in
buildInputs = [ mkbootimage ]; buildInputs = [ mkbootimage ];
} }
'' ''
bif=`mktemp` # Do not use "long" paths in boot.bif, because embedded developers
cat > $bif << EOF # can't write software (mkbootimage will segfault).
bifdir=`mktemp -d`
cd $bifdir
ln -s ${zc706-firmware}/szl.elf szl.elf
cat > boot.bif << EOF
the_ROM_image: the_ROM_image:
{ {
[bootloader]${zc706-firmware}/szl.elf [bootloader]szl.elf
} }
EOF EOF
mkdir $out mkdir $out
mkbootimage $bif $out/boot.bin mkbootimage boot.bif $out/boot.bin
ln -s ${zc706-gateware}/top.bit $out ln -s ${zc706-gateware}/top.bit $out
''; '';
zc706-sd-zip = pkgs.runCommand "zc706-sd-zip" zc706-sd-zip = pkgs.runCommand "zc706-sd-zip"
@ -96,8 +100,6 @@ in
buildInputs = [ mkbootimage ]; buildInputs = [ mkbootimage ];
} }
'' ''
# Do not use "long" paths in boot.bif, because embedded developers
# can't write software (mkbootimage will segfault).
# TODO: use self-built fsbl # TODO: use self-built fsbl
bifdir=`mktemp -d` bifdir=`mktemp -d`
cd $bifdir cd $bifdir