build/payload/seabios: reduced indentation

Signed-off-by: Leah Rowe <leah@libreboot.org>
fsdg20230625
Leah Rowe 2023-05-27 09:43:05 +01:00
parent a4ea286731
commit 6344b19600
1 changed files with 21 additions and 19 deletions

View File

@ -30,7 +30,10 @@ main()
printf "Building SeaBIOS payloads and SeaVGABIOS\n" printf "Building SeaBIOS payloads and SeaVGABIOS\n"
check_dependencies check_dependencies
build_seabios_payloads
for x in normal vgarom libgfxinit; do
build_seabios_elf "${x}"
done
# clean it again. gotta keep it clean! # clean it again. gotta keep it clean!
[[ -f Makefile ]] && make -C seabios distclean [[ -f Makefile ]] && make -C seabios distclean
@ -51,29 +54,28 @@ check_dependencies()
fi fi
} }
build_seabios_payloads() build_seabios_elf()
{ {
for x in normal vgarom libgfxinit; do inittype=${1}
if [ ! -f seabios/Makefile ]; then
printf "SeaBIOS not properly downloaded.\n"
exit 1
fi
make distclean -BC seabios || exit 1 if [ ! -f seabios/Makefile ]; then
printf "SeaBIOS not properly downloaded.\n"
exit 1
fi
cp "resources/seabios/config/${x}" seabios/.config make distclean -BC seabios || exit 1
make silentoldconfig -j$(nproc) -BC seabios || exit 1
make -j$(nproc) -BC seabios || exit 1
seabios_elf_dst="${payloaddir}/seabios_${x}.elf" cp "resources/seabios/config/${inittype}" seabios/.config
cp ${seabios_elf} "${seabios_elf_dst}" || exit 1 make silentoldconfig -j$(nproc) -BC seabios || exit 1
make -j$(nproc) -BC seabios || exit 1
if [ "${x}" = "libgfxinit" ]; then seabios_elf_dst="${payloaddir}/seabios_${inittype}.elf"
cp ${seavgabios} ${payloaddir}/seavgabios.bin \ cp ${seabios_elf} "${seabios_elf_dst}" || exit 1
|| exit 1
fi if [ "${inittype}" = "libgfxinit" ]; then
rm -f seabios/.config || exit 1 cp ${seavgabios} ${payloaddir}/seavgabios.bin || exit 1
done fi
rm -f seabios/.config || exit 1
} }
main $@ main $@