First commit
This commit is contained in:
commit
43eb1eaa64
4 changed files with 174 additions and 0 deletions
73
src/make_uboot.sh
Executable file
73
src/make_uboot.sh
Executable file
|
@ -0,0 +1,73 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
function usage {
|
||||
|
||||
cat <<EOF
|
||||
|
||||
Compile uboot for MNT Reform
|
||||
---
|
||||
This script compile uboot for the MNT Reform2 laptop.
|
||||
|
||||
USAGE:
|
||||
make_uboot.sh <target>
|
||||
|
||||
where <target> can be:
|
||||
|
||||
sdcard: build uboot for sdcard (default)
|
||||
emmc: build uboot for emmc
|
||||
|
||||
The <target> arguments can be replaced by UBOOT_BUILD environment variable
|
||||
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
function error {
|
||||
>&2 printf "\e[31mE\e[0m %s\n" "$1"
|
||||
}
|
||||
|
||||
export ARCH=arm64
|
||||
export CROSS_COMPILE=aarch64-linux-gnu-
|
||||
GIT_URL="https://source.mnt.re/reform/reform-boundary-uboot"
|
||||
|
||||
|
||||
|
||||
if [ -n "$1" ]
|
||||
then
|
||||
UBOOT_BUILD="$1"
|
||||
fi
|
||||
|
||||
if [ -z "$UBOOT_BUILD" ]
|
||||
then
|
||||
UBOOT_BUILD="sdcard"
|
||||
fi
|
||||
|
||||
if [ ! -d u-boot ]
|
||||
then
|
||||
printf "Cloning uboot form MNTMN repo...\n"
|
||||
if ! git clone --depth 1 "$GIT_URL" u-boot
|
||||
then
|
||||
error "Can't clone uboot from MNT, check version"
|
||||
exit 11
|
||||
fi
|
||||
fi
|
||||
|
||||
cp u-boot/mntreform-config u-boot/.config
|
||||
|
||||
cd u-boot
|
||||
|
||||
case $UBOOT_BUILD in
|
||||
" emmc")
|
||||
make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
|
||||
;;
|
||||
"sdcard")
|
||||
make -j$(nproc) flash.bin
|
||||
;;
|
||||
*)
|
||||
error "${UBOOT_BUILD} is not a valid option"
|
||||
esac
|
||||
cd ..
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue