Scripts for sunxi: Allwinner platforms
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 18 Apr 2015 20:03:55 +0000 (22:03 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Sun, 19 Apr 2015 09:35:40 +0000 (11:35 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
sunxi/linux-sunxi-build.sh [new file with mode: 0755]
sunxi/linux-sunxi-clean.sh [new file with mode: 0755]
sunxi/linux-sunxi-config.sh [new file with mode: 0755]
sunxi/linux-sunxi-image.sh [new file with mode: 0755]
sunxi/linux-sunxi-modules.sh [new file with mode: 0755]
sunxi/linux-sunxi.sh [new file with mode: 0755]
sunxi/linux.sh [new file with mode: 0755]
sunxi/sunxi-boards.sh [new file with mode: 0755]
sunxi/u-boot-install.sh [new file with mode: 0755]
sunxi/u-boot-makeall.sh [new file with mode: 0755]

diff --git a/sunxi/linux-sunxi-build.sh b/sunxi/linux-sunxi-build.sh
new file mode 100755 (executable)
index 0000000..6bd14b9
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+./linux-sunxi-clean.sh
+./linux-sunxi-config.sh $1
+./linux-sunxi-image.sh
+./linux-sunxi-modules.sh
diff --git a/sunxi/linux-sunxi-clean.sh b/sunxi/linux-sunxi-clean.sh
new file mode 100755 (executable)
index 0000000..e064824
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. ./linux-sunxi.sh
+
+rm -rf $DST
+rm -rf $INSTALL_MOD_PATH
+
+mkdir $DST
+mkdir $INSTALL_MOD_PATH
diff --git a/sunxi/linux-sunxi-config.sh b/sunxi/linux-sunxi-config.sh
new file mode 100755 (executable)
index 0000000..84dbd71
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+. ./linux-sunxi.sh
+
+make -C $SRC O=$DST ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE $CONFIG
+
+if [ "$1" = "menuconfig" ]
+then
+       make -C $SRC O=$DST ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE menuconfig
+fi
diff --git a/sunxi/linux-sunxi-image.sh b/sunxi/linux-sunxi-image.sh
new file mode 100755 (executable)
index 0000000..eda8637
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. ./linux-sunxi.sh
+
+make -C $SRC O=$DST ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE -j$PARALLEL $TARGET
diff --git a/sunxi/linux-sunxi-modules.sh b/sunxi/linux-sunxi-modules.sh
new file mode 100755 (executable)
index 0000000..acaa502
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. ./linux-sunxi.sh
+
+make -C $SRC O=$DST ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE -j$PARALLEL modules
+make -C $SRC O=$DST ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH=$INSTALL_MOD_PATH modules_install
diff --git a/sunxi/linux-sunxi.sh b/sunxi/linux-sunxi.sh
new file mode 100755 (executable)
index 0000000..005a560
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+CROSS_COMPILE=arm-linux-gnueabihf-
+PARALLEL=9
+SRC="$( pwd )/linux-sunxi"
+DST="$( pwd )/linux-sunxi-out"
+INSTALL_MOD_PATH="$( pwd )/linux-sunxi-modules"
+ARCH=arm
+CONFIG=sun5i_defconfig
+TARGET=uImage
diff --git a/sunxi/linux.sh b/sunxi/linux.sh
new file mode 100755 (executable)
index 0000000..c67fdc6
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+CROSS_COMPILE=arm-linux-gnueabihf-
+PARALLEL=9
+SRC="$( pwd )/linux"
+DST="$( pwd )/linux-out"
+INSTALL_MOD_PATH="$( pwd )/linux-modules"
+ARCH=arm
+CONFIG=multi_v7_defconfig
+TARGET=zImage
+DTB=dtbs
+LOADADDR=0x40008000
diff --git a/sunxi/sunxi-boards.sh b/sunxi/sunxi-boards.sh
new file mode 100755 (executable)
index 0000000..18daab7
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+FEX2BIN="fex2bin"
+
+FEX=$1
+BIN=$( basename $FEX | sed "s/fex$/bin/g" )
+
+$FEX2BIN $FEX $BIN
diff --git a/sunxi/u-boot-install.sh b/sunxi/u-boot-install.sh
new file mode 100755 (executable)
index 0000000..e886da2
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. ./u-boot.sh
+
+DRIVE=""
+IMAGE="u-boot-sunxi-with-spl.bin"
+
+sudo dd if="$DST/$IMAGE" of=$DRIVE bs=1024 seek=8
+sync
+
+udisksctl power-off -b $DRIVE
diff --git a/sunxi/u-boot-makeall.sh b/sunxi/u-boot-makeall.sh
new file mode 100755 (executable)
index 0000000..06e2b14
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. ./u-boot.sh
+
+export CROSS_COMPILE=$CROSS_COMPILE
+export MAKEALL_LOGDIR="u-boot-makeall-log"
+export BUILD_DIR="u-boot-makeall-out"
+
+cd u-boot
+./MAKEALL -s sunxi
+rm $SRC/boards.cfg