vuls: init at 0.27.0
[NixPkgs.git] / nixos / modules / system / boot / loader / raspberrypi / uboot-builder.sh
blobea591427179f52999a4554d0ddb099bf27f4bb20
1 #! @bash@/bin/sh -e
3 target=/boot # Target directory
5 while getopts "t:c:d:g:" opt; do
6 case "$opt" in
7 d) target="$OPTARG" ;;
8 *) ;;
9 esac
10 done
12 copyForced() {
13 local src="$1"
14 local dst="$2"
15 cp $src $dst.tmp
16 mv $dst.tmp $dst
19 # Call the extlinux builder
20 "@extlinuxConfBuilder@" "$@"
22 # Add the firmware files
23 fwdir=@firmware@/share/raspberrypi/boot/
24 copyForced $fwdir/bootcode.bin $target/bootcode.bin
25 copyForced $fwdir/fixup.dat $target/fixup.dat
26 copyForced $fwdir/fixup_cd.dat $target/fixup_cd.dat
27 copyForced $fwdir/fixup_db.dat $target/fixup_db.dat
28 copyForced $fwdir/fixup_x.dat $target/fixup_x.dat
29 copyForced $fwdir/start.elf $target/start.elf
30 copyForced $fwdir/start_cd.elf $target/start_cd.elf
31 copyForced $fwdir/start_db.elf $target/start_db.elf
32 copyForced $fwdir/start_x.elf $target/start_x.elf
34 # Add the uboot file
35 copyForced @uboot@/u-boot.bin $target/u-boot-rpi.bin
37 # Add the config.txt
38 copyForced @configTxt@ $target/config.txt