mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-09 23:54:32 +00:00
This patch creates the platform/galileo/bsp directory. This directory contain all files related to Galileo's Board Support Package (BSP). For now, the BSP consists of libc and bootloader. Within the BSP directory, we have the scripts build_newlib.sh and build_ grub.sh. These scripts provide an easy and quick way to build the newlib and the grub for the Galileo platform.
61 lines
1.1 KiB
Bash
Executable File
61 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
JOBS=5
|
|
HEAD="bac5d1a64ab4191058a8fd4c05f6b3b339e249e7"
|
|
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
prepare() {
|
|
if [[ ! -d ./src ]]; then
|
|
git clone git://git.savannah.gnu.org/grub.git src
|
|
fi
|
|
|
|
pushd src
|
|
git checkout $HEAD
|
|
git clean -fdx
|
|
popd
|
|
}
|
|
|
|
build() {
|
|
pushd src
|
|
|
|
./autogen.sh
|
|
./configure --with-platform=efi --target=i386
|
|
|
|
make -j${JOBS}
|
|
|
|
./grub-mkimage -p /EFI/BOOT -d ./grub-core/ -O i386-efi -o grub.efi \
|
|
boot efifwsetup efi_gop efinet efi_uga lsefimmap lsefi lsefisystab \
|
|
exfat fat multiboot2 multiboot terminal part_msdos part_gpt normal \
|
|
all_video aout configfile echo file fixvideo fshelp gfxterm gfxmenu \
|
|
gfxterm_background gfxterm_menu legacycfg video_bochs video_cirrus \
|
|
video_colors video_fb videoinfo video
|
|
|
|
popd
|
|
}
|
|
|
|
setup() {
|
|
mkdir -p bin
|
|
cp src/grub.efi bin/
|
|
}
|
|
|
|
cleanup() {
|
|
rm -rf ./src
|
|
rm -rf ./bin
|
|
}
|
|
|
|
# This script will always run on its own basepath, no matter where you call it from.
|
|
pushd ${SCRIPT_DIR}
|
|
|
|
case $1 in
|
|
-c | --cleanup)
|
|
cleanup
|
|
;;
|
|
*)
|
|
prepare && build && setup
|
|
;;
|
|
esac
|
|
|
|
popd
|