summaryrefslogtreecommitdiff
path: root/include/rom.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/rom.sh')
-rw-r--r--include/rom.sh77
1 files changed, 51 insertions, 26 deletions
diff --git a/include/rom.sh b/include/rom.sh
index 2dd16c70..4de49eee 100644
--- a/include/rom.sh
+++ b/include/rom.sh
@@ -12,11 +12,11 @@ buildser()
{
if [ "$1" = "pico" ]; then
x_ cmake -DPICO_BOARD="$2" \
- -DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" && \
- x_ cmake --build "$sersrc/build"
+ -DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc"
+ x_ cmake --build "$sersrc/build"
elif [ "$1" = "stm32" ]; then
- x_ make -C "$sersrc" libopencm3-just-make \
- BOARD=$2 && x_ make -C "$sersrc" BOARD=$2
+ x_ make -C "$sersrc" libopencm3-just-make BOARD=$2
+ x_ make -C "$sersrc" BOARD=$2
fi
x_ mkdir -p "bin/serprog_$1"
@@ -25,7 +25,7 @@ buildser()
copyps1bios()
{
- if [ "$dry" = ":" ]; then
+ if [ "$if_not_dry_build" = ":" ]; then
return 0
fi
@@ -45,11 +45,16 @@ mkpayload_grub()
grub_modules=""
grub_install_modules=""
- $dry eval "`setcfg "$grubdata/module/$tree"`"
+ if [ "$if_not_dry_build" = ":" ]; then
+ return 0
+ fi
- $dry x_ rm -f "$srcdir/grub.elf"
+ . "$grubdata/module/$tree" || \
+ err "Can't read '$grubdata/module/$tree'" "mkpayload_grub" "$@"
- $dry x_ "$srcdir/grub-mkstandalone" \
+ x_ rm -f "$srcdir/grub.elf"
+
+ x_ "$srcdir/grub-mkstandalone" \
--grub-mkimage="$srcdir/grub-mkimage" \
-O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \
--fonts= --themes= --locales= --modules="$grub_modules" \
@@ -64,7 +69,9 @@ corebootpremake()
return 0
fi
- $dry cook_coreboot_config
+ $if_not_dry_build \
+ cook_coreboot_config
+
fx_ check_coreboot_util printf "cbfstool\nifdtool\n"
printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \
@@ -106,6 +113,7 @@ check_coreboot_util()
# TODO: is this rm command needed?
x_ rm -Rf "$utilelfdir"
+
return 0
elif [ -n "$mode" ] || [ -f "$utilelfdir/$1" ]; then
return 0
@@ -125,7 +133,8 @@ coreboot_pad_one_byte()
return 0
fi
- $dry pad_one_byte "$srcdir/build/coreboot.rom"
+ $if_not_dry_build \
+ pad_one_byte "$srcdir/build/coreboot.rom"
}
mkcorebootbin()
@@ -134,8 +143,11 @@ mkcorebootbin()
return 0
fi
- $dry check_coreboot_util cbfstool
- $dry check_coreboot_util ifdtool
+ $if_not_dry_build \
+ check_coreboot_util cbfstool
+
+ $if_not_dry_build \
+ check_coreboot_util ifdtool
for y in "$target_dir/config"/*; do
defconfig="$y"
@@ -169,8 +181,11 @@ mkcorebootbin_real()
fi
elfrom="$elfrom/coreboot.rom"
- $dry x_ cp "$elfrom" "$tmprom"
- $dry unpad_one_byte "$tmprom"
+ $if_not_dry_build \
+ x_ cp "$elfrom" "$tmprom"
+
+ $if_not_dry_build \
+ unpad_one_byte "$tmprom"
if [ -n "$payload_uboot" ] && [ "$payload_uboot" != "amd64" ] && \
[ "$payload_uboot" != "i386" ] && [ "$payload_uboot" != "arm64" ]
@@ -190,8 +205,9 @@ mkcorebootbin_real()
payload_seabios="y"
fi
if [ "$payload_seabios" = "y" ] && [ "$payload_uboot" = "arm64" ]; then
- $dry err "$target: U-Boot(arm) and SeaBIOS/GRUB both enabled" \
- "mkcorebootbin_real" "$@"
+ $if_not_dry_build \
+ err "$target: U-Boot arm and SeaBIOS/GRUB both enabled" \
+ "mkcorebootbin_real" "$@"
fi
if [ -z "$grub_scan_disk" ]; then
@@ -216,18 +232,21 @@ mkcorebootbin_real()
payload_grubsea="n"
fi
- if $dry grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then
+ if $if_not_dry_build grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then
if [ "$payload_seabios" = "y" ]; then
pname="seabios"
- $dry add_seabios
+ $if_not_dry_build \
+ add_seabios
fi
if [ "$payload_uboot" = "arm64" ]; then
pname="uboot"
- $dry add_uboot
+ $if_not_dry_build \
+ add_uboot
fi
else
pname="custom"
- $dry cprom
+ $if_not_dry_build \
+ cprom
fi; :
}
@@ -244,7 +263,8 @@ add_seabios()
# we must add u-boot first, because it's added as a flat
# binary at a specific offset for secondary program loader
- $dry add_uboot
+ $if_not_dry_build \
+ add_uboot
fi
_seabioself="elf/seabios/default/default/$initmode/bios.bin.elf"
@@ -341,12 +361,13 @@ mkseagrub()
add_uboot()
{
if [ "$displaymode" = "txtmode" ]; then
- printf "cb/%s: Cannot use U-Boot in text mode\n" \
- "$target" 1>&2
+ printf "cb/%s: Can't use U-Boot in text mode\n" "$target" 1>&2
+
return 0
elif [ "$initmode" = "normal" ]; then
- printf "cb/%s: Cannot use U-Boot in normal initmode\n" \
+ printf "cb/%s: Can't use U-Boot in normal initmode\n" \
"$target" 1>&2
+
return 0
fi
@@ -458,7 +479,11 @@ mkcoreboottar()
{
if [ "$target" != "$tree" ] && [ "$XBMK_RELEASE" = "y" ] && \
[ "$release" != "n" ]; then
- $dry mkrom_tarball "bin/$target" && \
- $dry x_ ./mk inject "bin/${relname}_${target}.tar.xz" nuke; :
+
+ $if_not_dry_build \
+ mkrom_tarball "bin/$target"
+
+ $if_not_dry_build \
+ x_ ./mk inject "bin/${relname}_${target}.tar.xz" nuke
fi
}