build/boot/roms: reduced code indentation

This commit is contained in:
Leah Rowe
2023-05-13 00:13:54 +01:00
parent 9eee0fb483
commit 3bd82b7679
2 changed files with 123 additions and 116 deletions
+5 -5
View File
@@ -36,7 +36,11 @@ firstoption="${1}"
main() main()
{ {
if [ $# -gt 0 ]; then if [ $# -lt 1 ]; then
usage
exit 1
fi
if [ "${firstoption}" = "help" ]; then if [ "${firstoption}" = "help" ]; then
usage usage
exit 0 exit 0
@@ -80,10 +84,6 @@ main()
|| die "build/roms: error" || die "build/roms: error"
done done
fi fi
else
usage
exit 1
fi
printf "\n\nDone! Your ROMs are in bin/\n\n" printf "\n\nDone! Your ROMs are in bin/\n\n"
} }
+21 -14
View File
@@ -180,7 +180,10 @@ load_config()
load_config_overrides() load_config_overrides()
{ {
# Override all payload directives with cmdline args # Override all payload directives with cmdline args
if [ ! -z ${payloads} ]; then if [ -z ${payloads} ]; then
return 0
fi
echo "setting payloads $payloads" echo "setting payloads $payloads"
payload_grub="n" payload_grub="n"
payload_grub_withseabios="n" # seabios chainloaded from grub payload_grub_withseabios="n" # seabios chainloaded from grub
@@ -192,7 +195,6 @@ load_config_overrides()
for payload in ${payloads} ; do for payload in ${payloads} ; do
eval "payload_${payload}=y" eval "payload_${payload}=y"
done done
fi
} }
die_if_cbconfig_and_nopayload() die_if_cbconfig_and_nopayload()
@@ -201,8 +203,12 @@ die_if_cbconfig_and_nopayload()
# defined in the lbmk config, exit with error # defined in the lbmk config, exit with error
# if no configs exist, this won't fail. this way, cbtrees # if no configs exist, this won't fail. this way, cbtrees
# like "default" can exist which just contain patches # like "default" can exist which just contain patches
if [ "${payload_grub}" != "y" ] && [ "${payload_seabios}" != "y" ] \
&& [ "${payload_uboot}" != "y" ]; then if [ "${payload_grub}" = "y" ] || [ "${payload_seabios}" = "y" ] \
|| [ "${payload_uboot}" = "y" ]; then
return 0
fi
for configfile in "${boardcfgdir}/config/"*; do for configfile in "${boardcfgdir}/config/"*; do
if [ ! -e "${configfile}" ]; then if [ ! -e "${configfile}" ]; then
continue continue
@@ -211,7 +217,6 @@ die_if_cbconfig_and_nopayload()
${board} ${board}
exit 1 exit 1
done done
fi
} }
build_dependencies() build_dependencies()
@@ -282,18 +287,19 @@ build_dependency_seabios()
./build payload seabios ./build payload seabios
fi fi
fi fi
if [ "${payload_memtest}" = "y" ]; then if [ "${payload_memtest}" = "y" ] && [ ! -f "memtest86plus/memtest" ]
if [ ! -f "memtest86plus/memtest" ]; then then
./build module memtest86plus ./build module memtest86plus
fi fi
fi
} }
build_dependency_grub() build_dependency_grub()
{ {
if [ "${payload_grub}" = "y" ] \ if [ "${payload_grub}" != "y" ] \
|| [ "${payload_seabios_withgrub}" = "y" ] && [ "${payload_seabios_withgrub}" != "y" ]; then
then return 0
fi
if [ -f "payload/grub/grub_usqwerty.cfg" ]; then if [ -f "payload/grub/grub_usqwerty.cfg" ]; then
sha1cmd="sha1sum resources/grub/config/grub.cfg" sha1cmd="sha1sum resources/grub/config/grub.cfg"
grubrefchecksum="$(${sha1cmd} | awk '{print $1}')" grubrefchecksum="$(${sha1cmd} | awk '{print $1}')"
@@ -326,12 +332,14 @@ build_dependency_grub()
./build payload grub ./build payload grub
fi fi
done done
fi
} }
build_dependency_uboot() build_dependency_uboot()
{ {
if [ "${payload_uboot}" = "y" ]; then if [ "${payload_uboot}" != "y" ]; then
return 0
fi
ubdir="" ubdir=""
if [ "${uboot_config}" = "default" ]; then if [ "${uboot_config}" = "default" ]; then
ubdir="payload/u-boot/${board}" ubdir="payload/u-boot/${board}"
@@ -348,7 +356,6 @@ build_dependency_uboot()
rm -Rf "payload/u-boot/${board}" # just in case rm -Rf "payload/u-boot/${board}" # just in case
./build payload u-boot "${board}" ./build payload u-boot "${board}"
fi fi
fi
} }
build_rom_images() build_rom_images()