-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_compilation.sh
executable file
·57 lines (47 loc) · 1.67 KB
/
run_compilation.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
export WORKING_DIR=$PWD
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=$WORKING_DIR/u-boot-xlnx/tools/:$PATH
# Working directories for outputs
mkdir -p xeno3_build
mkdir -p xeno3_zynq_stage
mkdir -p zynq_modules
mkdir -p SDCard
#export dei percorsi directory
export UBOOT=$PWD/u-boot-xlnx
export XENO_HOME=$PWD/xenomai-3
export LINUX_HOME=$PWD/ipipe-arm
export XIL_LINUX=$PWD/linux-xlnx
export XENO_BUILD=$PWD/xeno3_build
export XENO_ZYNQ_STAGE=$PWD/xeno3_zynq_stage
export ZYNQ_MODULES=$PWD/zynq_modules
export SDCARD=$PWD/SDCard
echo "Going to compile u-boot..."
# compilazione di u-boot
cd $UBOOT
git apply ../u-boot-no-ramdisk-sdcard.patch
make zynq_zybo_config
make -j 2 u-boot.elf
cp u-boot.elf $SDCARD
cd $WORKING_DIR
echo "Going to patch the Kernel source code and compile it..."
# patching del kernel
cp $XIL_LINUX/arch/arm/configs/xilinx_zynq_defconfig $LINUX_HOME/arch/arm/configs/
$XENO_HOME/scripts/prepare-kernel.sh --linux=$LINUX_HOME --arch=arm --verbose
cd $LINUX_HOME
make xilinx_zynq_defconfig
cp ../.config ./
make
make UIMAGE_LOADADDR=0x8000 uImage modules
make modules_install INSTALL_MOD_PATH=$ZYNQ_MODULES
cp $LINUX_HOME/arch/arm/boot/uImage $SDCARD
echo "Going to configure Xenomai libraries..."
# compilazione della libreria XENOMAI
cd $XENO_HOME
git checkout tags/v3.0.6 -b xenomai_3.0.6
./scripts/bootstrap
cd $XENO_BUILD
$XENO_HOME/configure CFLAGS="-march=armv7-a -mfpu=vfp3 -mfloat-abi=hard" LDFLAGS="-march=armv7-a" --build=x86_64-pc-linux-gnu --host=arm-none-linux-gnueabi --with-core=cobalt --enable-smp --enable-tls CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld
make DESTDIR=$XENO_ZYNQ_STAGE install
echo "Compilation succeeds"