diff options
Diffstat (limited to 'include/rom.sh')
-rw-r--r-- | include/rom.sh | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/include/rom.sh b/include/rom.sh index 60980d22..3e8c9c9b 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright (c) 2014-2016,2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> +# Copyright (c) 2014-2016,2020-2021,2023-2025 Leah Rowe <leah@libreboot.org> # Copyright (c) 2021-2022 Ferass El Hafidi <vitali64pmemail@protonmail.com> # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> # Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com> @@ -7,7 +7,11 @@ mkserprog() { + [ $# -lt 1 ] && $err "mkserprog: no arguments provided" [ "$_f" = "-d" ] && return 0 # dry run + + [ "$1" = "pico" ] && mkpicotool + basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR" while read -r sertarget; do @@ -20,6 +24,7 @@ mkserprog() ln -srf "$sersrc/build_$pt/" "$sersrc/build") \ && x_ cmake -DPICO_BOARD="$sertarget" \ -DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" \ + -Dpicotool_DIR="$picotool/picotool" \ && x_ cmake --build "$sersrc/build" [ "$1" = "stm32" ] && x_ make -C "$sersrc" \ libopencm3-just-make BOARD=$sertarget && x_ make -C \ @@ -30,6 +35,18 @@ mkserprog() [ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/serprog_$1"; return 0 } +mkpicotool() +{ + rm -Rf "$picotool" || $err "Can't remove picotool builddir" + ( + x_ cd src/picotool + cmake -DCMAKE_INSTALL_PREFIX=xbmkbin -DPICOTOOL_FLAT_INSTALL=1 \ + -DPICO_SDK_PATH=../pico-sdk || \ + $err "Can't prep picotool" + make install || $err "Can't build picotool"; : + ) || $err "Can't build picotool"; : +} + copyps1bios() { x_ rm -Rf bin/playstation @@ -43,8 +60,8 @@ copyps1bios() mkpayload_grub() { - eval `setvars "" grub_modules grub_install_modules` - $dry eval `setcfg "$grubdata/module/$tree"` + eval "`setvars "" grub_modules grub_install_modules`" + $dry eval "`setcfg "$grubdata/module/$tree"`" $dry x_ rm -f "$srcdir/grub.elf"; $dry \ "$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \ -O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \ @@ -62,7 +79,7 @@ mkvendorfiles() printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ $err "!mk $srcdir .coreboot-version" [ -z "$mode" ] && [ "$target" != "$tree" ] && \ - x_ ./mk download $target; return 0 + x_ ./mk download "$target"; return 0 } cook_coreboot_config() @@ -113,7 +130,8 @@ mkcorebootbin() if [ "$payload_uboot_i386" = "y" ] || \ [ "$payload_uboot_amd64" = "y" ]; then - printf "'$target' has x86 U-Boot; assuming SeaBIOS=y\n" 1>&2 + printf "'%s' has x86 U-Boot; assuming SeaBIOS=y\n" \ + "$target" 1>&2 payload_seabios="y" fi @@ -204,10 +222,12 @@ mkseagrub() add_uboot() { if [ "$displaymode" = "txtmode" ]; then - printf "cb/$target: Cannot use U-Boot in text mode\n" 1>&2 + printf "cb/%s: Cannot use U-Boot in text mode\n" \ + "$target" 1>&2 return 0 elif [ "$initmode" = "normal" ]; then - printf "cb/$target: Cannot use U-Boot in normal initmode\n" 1>&2 + printf "cb/%s: Cannot use U-Boot in normal initmode\n" \ + "$target" 1>&2 return 0 fi |