-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathbuild_uboot.sh
executable file
·41 lines (30 loc) · 1.25 KB
/
build_uboot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
set -x
test -d $TARGET_DIR || mkdir -p $TARGET_DIR
pushd $UBOOT_DIR
make distclean O=$UBOOT_DIR/output
make $UBOOT_DEFCONFIG O=$UBOOT_DIR/output
make -j$JOBS O=$UBOOT_DIR/output
pushd output
cp `find . -name "env_common.o"` copy_env_common.o
arm-linux-gnueabihf-objcopy -O binary --only-section=.rodata `find . -name "copy_env_common.o"`
tr '\0' '\n' < copy_env_common.o | grep '=' > default_envs.txt
cp default_envs.txt default_envs.txt.orig
tools/mkenvimage -s 16384 -o params.bin default_envs.txt
# Generate recovery param
sed -i -e 's/bootcmd=run ramfsboot/bootcmd=run recoveryboot/g' default_envs.txt
tools/mkenvimage -s 16384 -o params_recovery.bin default_envs.txt
# Generate sd-boot param
sed -i -e 's/rootdev=0/rootdev=1/g' default_envs.txt.orig
tools/mkenvimage -s 16384 -o params_sdboot.bin default_envs.txt.orig
rm copy_env_common.o default_envs.txt default_envs.txt.orig
cp u-boot.bin $TARGET_DIR
chmod 664 params.bin params_recovery.bin params_sdboot.bin
cp params.bin params_recovery.bin params_sdboot.bin $TARGET_DIR
cp u-boot $TARGET_DIR
UBOOT_VERSION=`cat include/generated/version_autogenerated.h | grep U_BOOT_VERSION | awk -F \" '{print $2}'`
echo "RELEASE_UBOOT=${UBOOT_VERSION}" >> $TARGET_DIR/artik_release
popd
rm -rf output
popd