2013-12-29 12:01:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-02-24 22:19:59 +01:00
|
|
|
# --- TODO
|
2014-02-26 12:06:35 +01:00
|
|
|
# * DONE remove dependance on debian based host
|
|
|
|
# ** DONE use linaro toolchain
|
2014-02-25 07:55:05 +01:00
|
|
|
# https://launchpad.net/linaro-toolchain-binaries/trunk/
|
2014-02-26 12:06:35 +01:00
|
|
|
# * DOING clean up script
|
|
|
|
# * TODO package the kernel in a real slackware package
|
|
|
|
# * TODO switch userland to hard-float binaries
|
|
|
|
# * TODO build rootfs from slackwarearm-current
|
2014-02-25 07:27:10 +01:00
|
|
|
# ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/scripts/
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
if [ ! -x /usr/bin/mkimage ]; then
|
|
|
|
echo "Missing u-boot tools"
|
|
|
|
echo "Please install them from http://www.slackware.com/~alien/slackbuilds/u-boot-tools/"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-02-24 22:19:59 +01:00
|
|
|
|
2014-01-02 11:33:32 +01:00
|
|
|
# --- Configuration -------------------------------------------------------------
|
2014-01-24 09:35:26 +01:00
|
|
|
#change to your needs
|
2014-02-24 19:44:00 +01:00
|
|
|
VERSION="SlackwareARM_0.1"
|
|
|
|
DEST_LANG="en_US"
|
|
|
|
DEST_LANGUAGE="us"
|
2014-02-10 13:36:25 +01:00
|
|
|
COMPILE="true"
|
2014-02-26 12:06:35 +01:00
|
|
|
DEST=/home/cycojesus/cubieslack
|
2014-01-22 11:47:48 +01:00
|
|
|
DISPLAY=3 # "3:hdmi; 4:vga"
|
2014-02-26 12:06:35 +01:00
|
|
|
IMAGE_SIZE_MB=2000
|
|
|
|
SLACKWARE_VERSION=14.1
|
|
|
|
ROOTFS_VERSION=04Nov13
|
|
|
|
CONFIG_HZ=300HZ # 250HZ, 300HZ or 1000HZ
|
2014-01-02 11:33:32 +01:00
|
|
|
# --- End -----------------------------------------------------------------------
|
2014-02-24 22:19:59 +01:00
|
|
|
|
2014-01-02 11:33:32 +01:00
|
|
|
SRC=$(pwd)
|
2014-02-26 12:06:35 +01:00
|
|
|
CWD=$(pwd)
|
2014-01-02 11:33:32 +01:00
|
|
|
set -e
|
2013-12-29 13:57:19 +01:00
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
mkdir -p $DEST
|
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
#Requires root ..
|
2014-01-02 11:33:32 +01:00
|
|
|
if [ "$UID" -ne 0 ]
|
2014-02-26 12:06:35 +01:00
|
|
|
then echo "Please run as root"
|
|
|
|
exitssid=CUBIE
|
|
|
|
interface=wlan0
|
|
|
|
hw_mode=g
|
|
|
|
channel=1
|
|
|
|
bridge=br0
|
|
|
|
|
|
|
|
logger_syslog=0
|
|
|
|
logger_syslog_level=0
|
|
|
|
|
|
|
|
wmm_enabled=0
|
|
|
|
wpa=2
|
|
|
|
preamble=1
|
|
|
|
wpa_psk=66eb31d2b48d19ba216f2e50c6831ee11be98e2fa3a8075e30b866f4a5ccda27
|
|
|
|
wpa_passphrase=12345678
|
|
|
|
wpa_key_mgmt=WPA-PSK
|
|
|
|
wpa_pairwise=TKIP
|
|
|
|
rsn_pairwise=CCMP
|
|
|
|
auth_algs=1
|
|
|
|
macaddr_acl=0
|
2014-01-02 11:33:32 +01:00
|
|
|
fi
|
2014-02-26 12:06:35 +01:00
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
echo "Building Cubietruck-Slackware in $DEST from $SRC"
|
2014-01-02 11:33:32 +01:00
|
|
|
sleep 3
|
2014-02-26 12:06:35 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
#--------------------------------------------------------------------------------
|
2014-01-24 09:35:26 +01:00
|
|
|
# Downloading necessary files for building - aka Toolchain
|
2013-12-29 12:01:02 +01:00
|
|
|
#--------------------------------------------------------------------------------
|
2014-01-02 11:33:32 +01:00
|
|
|
echo "------ Downloading necessary files"
|
2014-01-22 15:04:26 +01:00
|
|
|
#Read this for further information if you run into problems with gcc compiler
|
|
|
|
#http://linux-sunxi.org/Toolchain
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
wget -c https://launchpadlibrarian.net/155358238/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
|
|
|
|
tar xf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
|
|
|
|
|
|
|
|
CROSS_COMPILE=$PWD/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-
|
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
#--------------------------------------------------------------------------------
|
|
|
|
# Preparing output / destination files
|
|
|
|
#--------------------------------------------------------------------------------
|
2014-01-02 11:33:32 +01:00
|
|
|
echo "------ Fetching files from github"
|
2013-12-29 12:01:02 +01:00
|
|
|
mkdir -p $DEST/output
|
|
|
|
cp output/uEnv.txt $DEST/output
|
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
# # u-boot tools
|
|
|
|
# if [ -d "$DEST/u-boot" ]; then
|
|
|
|
# (cd $DEST/u-boot;
|
|
|
|
# git pull)
|
|
|
|
# else
|
|
|
|
# git clone git://git.denx.de/u-boot.git $DEST/u-boot
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# Boot loader
|
2014-01-02 11:33:32 +01:00
|
|
|
if [ -d "$DEST/u-boot-sunxi" ]
|
|
|
|
then
|
2014-02-26 12:06:35 +01:00
|
|
|
cd $DEST/u-boot-sunxi ; git pull; cd $SRC
|
2014-01-02 11:33:32 +01:00
|
|
|
else
|
2014-02-26 12:06:35 +01:00
|
|
|
git clone https://github.com/cubieboard/u-boot-sunxi $DEST/u-boot-sunxi
|
|
|
|
# Applying Patch for 2gb memory
|
|
|
|
patch -f $DEST/u-boot-sunxi/include/configs/sunxi-common.h < $SRC/patch/memory.patch || true
|
2014-01-02 11:33:32 +01:00
|
|
|
fi
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
# Allwinner tools
|
2014-01-02 11:33:32 +01:00
|
|
|
if [ -d "$DEST/sunxi-tools" ]
|
|
|
|
then
|
2014-02-26 12:06:35 +01:00
|
|
|
cd $DEST/sunxi-tools; git pull; cd $SRC
|
2014-01-02 11:33:32 +01:00
|
|
|
else
|
2014-02-26 12:06:35 +01:00
|
|
|
git clone https://github.com/linux-sunxi/sunxi-tools.git $DEST/sunxi-tools
|
2014-01-02 11:33:32 +01:00
|
|
|
fi
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
# Hardware configurations
|
2014-01-02 11:33:32 +01:00
|
|
|
if [ -d "$DEST/cubie_configs" ]
|
|
|
|
then
|
2014-02-26 12:06:35 +01:00
|
|
|
cd $DEST/cubie_configs; git pull; cd $SRC
|
2014-01-02 11:33:32 +01:00
|
|
|
else
|
2014-02-26 12:06:35 +01:00
|
|
|
git clone https://github.com/cubieboard/cubie_configs $DEST/cubie_configs
|
2014-02-24 19:44:00 +01:00
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
# Applying Patch for high load. Could cause troubles with USB OTG port
|
|
|
|
sed -e 's/usb_detect_type = 1/usb_detect_type = 0/g' $DEST/cubie_configs/sysconfig/linux/cubietruck.fex > $DEST/cubie_configs/sysconfig/linux/ct.fex
|
2014-02-24 19:44:00 +01:00
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
# Prepare fex files for VGA & HDMI
|
|
|
|
sed -e 's/screen0_output_type.*/screen0_output_type = 3/g' $DEST/cubie_configs/sysconfig/linux/ct.fex > $DEST/cubie_configs/sysconfig/linux/ct-hdmi.fex
|
|
|
|
sed -e 's/screen0_output_type.*/screen0_output_type = 4/g' $DEST/cubie_configs/sysconfig/linux/ct.fex > $DEST/cubie_configs/sysconfig/linux/ct-vga.fex
|
2014-01-02 11:33:32 +01:00
|
|
|
fi
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
# Patwood's kernel 3.4.75+
|
2014-01-02 11:33:32 +01:00
|
|
|
if [ -d "$DEST/linux-sunxi" ]
|
|
|
|
then
|
2014-02-26 12:06:35 +01:00
|
|
|
cd $DEST/linux-sunxi; git pull -f; cd $SRC
|
2014-01-02 11:33:32 +01:00
|
|
|
else
|
2014-02-26 12:06:35 +01:00
|
|
|
git clone https://github.com/patrickhwood/linux-sunxi $DEST/linux-sunxi
|
2014-02-17 08:53:07 +01:00
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
###PATCH kernel CONFIG_HZ, Arm dfault is hardcoded 100hz (10ms latency!). For mulitimedia and desktop a higher frequency is recomended.
|
|
|
|
test -f $SRC/patch/$CONFIG_HZ.patch && patch -f $DEST/linux-sunxi/arch/arm/Kconfig < $SRC/patch/$CONFIG_HZ.patch
|
2014-02-24 19:44:00 +01:00
|
|
|
fi
|
2014-02-17 08:53:07 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
#--------------------------------------------------------------------------------
|
|
|
|
# Compiling everything
|
|
|
|
#--------------------------------------------------------------------------------
|
2014-01-02 11:33:32 +01:00
|
|
|
echo "------ Compiling kernel boot loaderb"
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
# Copying Kernel config
|
|
|
|
cp $SRC/config/kernel.config $DEST/linux-sunxi/
|
|
|
|
|
|
|
|
# echo "------ Compiling mkimage"
|
|
|
|
# cd $DEST/u-boot
|
|
|
|
# touch include/autoconf.mk
|
|
|
|
# touch include/autoconf.mk.dep
|
|
|
|
# mkdir include/generated
|
|
|
|
# touch include/generated/generic-asm-offsets.h
|
|
|
|
# touch lib/asm-offsets.s
|
|
|
|
# touch {arch/arm/cpu/arm926ejs,examples/standalone,tools,tools/env}/.depend
|
|
|
|
# make tools HOSTCC="gcc $SLKCFLAGS" HOSTSTRIP=/bin/true CROSS_COMPILE=""
|
|
|
|
# export PATH=$PATH:$(pwd)/tools/
|
|
|
|
|
|
|
|
echo "------ Compiling boot loader"
|
2013-12-29 12:01:02 +01:00
|
|
|
cd $DEST/u-boot-sunxi
|
2014-02-26 12:06:35 +01:00
|
|
|
make clean && make -j2 'cubietruck' CROSS_COMPILE=$CROSS_COMPILE
|
|
|
|
|
2014-01-02 11:33:32 +01:00
|
|
|
echo "------ Compiling sunxi tools"
|
|
|
|
cd $DEST/sunxi-tools
|
2014-01-15 18:37:59 +01:00
|
|
|
make clean && make fex2bin && make bin2fex
|
2014-02-26 12:06:35 +01:00
|
|
|
mkdir -p $CWD/bin/
|
|
|
|
cp fex2bin bin2fex $CWD/bin/
|
2013-12-29 12:01:02 +01:00
|
|
|
# hardware configuration
|
2014-02-26 12:06:35 +01:00
|
|
|
$CWD/bin/fex2bin $DEST/cubie_configs/sysconfig/linux/ct-vga.fex $DEST/output/script-vga.bin
|
|
|
|
$CWD/bin/fex2bin $DEST/cubie_configs/sysconfig/linux/ct-hdmi.fex $DEST/output/script-hdmi.bin
|
2014-01-02 11:33:32 +01:00
|
|
|
|
|
|
|
echo "------ Compiling kernel"
|
2014-02-26 12:06:35 +01:00
|
|
|
if [ "$COMPILE" = "true" ]; then
|
|
|
|
# kernel image
|
|
|
|
echo "------ Compiling kernel"
|
|
|
|
cd $DEST/linux-sunxi
|
|
|
|
make clean
|
|
|
|
|
|
|
|
# Adding wlan firmware to kernel source
|
|
|
|
cd $DEST/linux-sunxi/firmware;
|
|
|
|
unzip -o $SRC/bin/ap6210.zip
|
|
|
|
cd $DEST/linux-sunxi
|
|
|
|
|
|
|
|
make -j2 ARCH=arm CROSS_COMPILE=$CROSS_COMPILE sun7i_defconfig
|
|
|
|
|
|
|
|
# get proven config
|
|
|
|
cp $DEST/linux-sunxi/kernel.config $DEST/linux-sunxi/.config
|
|
|
|
make -j2 ARCH=arm CROSS_COMPILE=$CROSS_COMPILE uImage modules
|
|
|
|
make -j2 ARCH=arm CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH=output modules_install
|
|
|
|
make -j2 ARCH=arm CROSS_COMPILE=$CROSS_COMPILE INSTALL_HDR_PATH=output headers_install
|
2014-02-10 13:36:25 +01:00
|
|
|
fi
|
2014-02-26 12:06:35 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
#--------------------------------------------------------------------------------
|
|
|
|
# Creating SD Images
|
|
|
|
#--------------------------------------------------------------------------------
|
2014-01-02 11:33:32 +01:00
|
|
|
echo "------ Creating SD Images"
|
2013-12-29 12:01:02 +01:00
|
|
|
cd $DEST/output
|
2014-01-24 09:38:38 +01:00
|
|
|
# create 2Gb image and mount image to next free loop device
|
2014-02-26 12:06:35 +01:00
|
|
|
dd if=/dev/zero of=slackware_rootfs.raw bs=1M count=$IMAGE_SIZE_MB
|
2014-01-07 20:21:03 +01:00
|
|
|
LOOP0=$(losetup -f)
|
2014-02-24 19:44:00 +01:00
|
|
|
losetup $LOOP0 slackware_rootfs.raw
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-01-02 11:33:32 +01:00
|
|
|
echo "------ Partitionning and mounting filesystem"
|
2013-12-29 12:01:02 +01:00
|
|
|
# make image bootable
|
2014-01-07 20:21:03 +01:00
|
|
|
dd if=$DEST/u-boot-sunxi/u-boot-sunxi-with-spl.bin of=$LOOP0 bs=1024 seek=8
|
2013-12-29 12:01:02 +01:00
|
|
|
|
|
|
|
# create one partition starting at 2048 which is default
|
2014-01-07 20:21:03 +01:00
|
|
|
(echo n; echo p; echo 1; echo; echo; echo w) | fdisk $LOOP0 >> /dev/null || true
|
2014-02-26 12:06:35 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
# just to make sure
|
2014-01-07 20:27:30 +01:00
|
|
|
partprobe $LOOP0
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-01-07 20:21:03 +01:00
|
|
|
LOOP1=$(losetup -f)
|
2013-12-29 12:01:02 +01:00
|
|
|
# 2048 (start) x 512 (block size) = where to mount partition
|
2014-02-24 19:44:00 +01:00
|
|
|
losetup -o 1048576 $LOOP1 $LOOP0
|
2014-02-26 12:06:35 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
# create filesystem
|
2014-01-07 20:21:03 +01:00
|
|
|
mkfs.ext4 $LOOP1
|
2014-02-26 12:06:35 +01:00
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
# create mount point and mount image
|
2013-12-29 12:01:02 +01:00
|
|
|
mkdir -p $DEST/output/sdcard/
|
2014-01-07 20:21:03 +01:00
|
|
|
mount $LOOP1 $DEST/output/sdcard/
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
echo "------ Get basic Slackware System"
|
2014-01-24 17:44:16 +01:00
|
|
|
cd $DEST/output/sdcard/
|
2014-02-26 12:06:35 +01:00
|
|
|
wget -c ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/roots/slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz
|
|
|
|
tar xf slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz
|
2014-01-26 10:26:06 +01:00
|
|
|
sync
|
2014-02-26 12:06:35 +01:00
|
|
|
rm slack-$SLACKWARE_VERSION-miniroot_$ROOTFS_VERSION.tar.xz
|
2014-01-02 11:33:32 +01:00
|
|
|
|
2014-01-10 15:08:31 +01:00
|
|
|
cat > $DEST/output/sdcard/etc/motd <<EOF
|
2014-02-24 19:44:00 +01:00
|
|
|
_ _ _ _
|
2014-01-10 15:08:31 +01:00
|
|
|
___ _ _ | |__ (_) ___ | |_ _ __ _ _ ___ | | __
|
|
|
|
/ __|| | | || '_ \ | | / _ \| __|| '__|| | | | / __|| |/ /
|
2014-02-24 19:44:00 +01:00
|
|
|
| (__ | |_| || |_) || || __/| |_ | | | |_| || (__ | <
|
2014-01-10 15:08:31 +01:00
|
|
|
\___| \__,_||_.__/ |_| \___| \__||_| \__,_| \___||_|\_\
|
2014-02-24 19:44:00 +01:00
|
|
|
Slackware
|
2014-01-10 15:08:31 +01:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2014-01-01 19:34:06 +01:00
|
|
|
# script to turn off the LED blinking
|
2014-01-24 17:44:16 +01:00
|
|
|
cp $SRC/scripts/disable_led.sh $DEST/output/sdcard/bin/disable_led.sh
|
2014-01-01 19:34:06 +01:00
|
|
|
|
|
|
|
# make it executable
|
2014-01-24 17:44:16 +01:00
|
|
|
chmod +x $DEST/output/sdcard/bin/disable_led.sh
|
2014-01-01 19:34:06 +01:00
|
|
|
# and startable on boot
|
2014-02-26 12:06:35 +01:00
|
|
|
echo disable_led.sh > $DEST/output/sdcard/etc/rc.d/rc.local
|
2014-01-01 19:34:06 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
# scripts for autoresize at first boot from cubian
|
2014-02-26 12:06:35 +01:00
|
|
|
cp $SRC/scripts/resize2fs-arch.sh $DEST/output/sdcard/root/resize2fs-root.sh
|
2014-01-28 09:01:44 +01:00
|
|
|
# make it executable
|
2014-02-26 12:06:35 +01:00
|
|
|
chmod +x $DEST/output/sdcard/root/resize2fs-root.sh
|
2014-01-28 09:01:44 +01:00
|
|
|
# and startable on boot just execute it once not on every boot!!!
|
|
|
|
#echo cubian-resize2fs > $DEST/output/sdcard/etc/rc.conf
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-01-12 13:57:42 +01:00
|
|
|
# script to install to NAND
|
2014-01-28 09:01:44 +01:00
|
|
|
cp $SRC/scripts/nand-install.sh $DEST/output/sdcard/root
|
2014-02-15 15:22:33 +01:00
|
|
|
cp $SRC/bin/nand1-boot-cubietruck-arch.tgz $DEST/output/sdcard/root
|
2014-01-12 13:57:42 +01:00
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
# install and configure locales
|
|
|
|
#echo LANG='$DEST_LANG'.UTF-8 > $DEST/output/sdcard/etc/default.conf
|
|
|
|
#echo KEYMAP=us > $DEST/output/sdcard/etc/vconsole.conf
|
2014-01-26 09:15:13 +01:00
|
|
|
#use this command when System runs
|
2014-01-28 09:01:44 +01:00
|
|
|
# sudo timedatectl set-timezone Zone/SubZone
|
|
|
|
# when setup preferred gui like openbox then use loadkeys de
|
2014-01-02 11:33:32 +01:00
|
|
|
|
2014-01-26 10:28:03 +01:00
|
|
|
# i recommend you to change this urgently + add a proper user for the System!!!
|
2014-02-24 19:44:00 +01:00
|
|
|
# default passwort for user "root" is "root"
|
2014-01-26 09:15:13 +01:00
|
|
|
#echo 1234;echo 1234; | passwd root
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
# set hostname
|
2014-02-26 12:06:35 +01:00
|
|
|
echo darkstar > $DEST/output/sdcard/etc/HOSTNAME
|
2014-01-29 19:33:14 +01:00
|
|
|
|
2014-02-26 12:06:35 +01:00
|
|
|
### declare root partition in fstab
|
|
|
|
echo '/dev/mmcblk0p1 / ext4 defaults 1 1' >> $DEST/output/sdcard/etc/fstab
|
2014-02-15 15:22:33 +01:00
|
|
|
|
|
|
|
### mount /tmp as tmpfs
|
2014-02-26 12:06:35 +01:00
|
|
|
echo 'tmpfs /tmp tmpfs defaults,nosuid,size=30% 0 0' >> $DEST/output/sdcard/etc/fstab
|
2014-02-15 15:22:33 +01:00
|
|
|
|
|
|
|
### Optional /var/log
|
|
|
|
#echo 'tmpfs /var/log tmpfs defaults,nosuid 0 0' >> $DEST/output/sdcard/etc/fstab
|
|
|
|
|
|
|
|
##disable IPV6 and reduce timeout from 30s to 5 on dhcp daemon
|
|
|
|
|
|
|
|
#echo "ipv4only" >> /etc/dhcpcd.conf
|
|
|
|
#echo "noipv6rs" >> /etc/dhcpcd.conf
|
|
|
|
echo "timeout 5" >> /etc/dhcpcd.conf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-26 09:15:13 +01:00
|
|
|
# load modules you may load them per sysctl
|
2014-02-26 12:06:35 +01:00
|
|
|
cat >> $DEST/output/sdcard/etc/rc.d/rc.modules <<EOT
|
|
|
|
#!/bin/sh
|
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
/sbin/modprobe hci_uart
|
|
|
|
/sbin/modprobe gpio_sunxi
|
|
|
|
/sbin/modprobe bcmdhd
|
|
|
|
/sbin/modprobe ump
|
|
|
|
/sbin/modprobe mali
|
|
|
|
#/sbin/modprobe sunxi_gmac
|
2014-01-25 11:03:52 +01:00
|
|
|
EOT
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-01-26 09:15:13 +01:00
|
|
|
# edit this to your personal needs/network configs take the ones from /etc/netctl/examples/ folder
|
2013-12-29 12:01:02 +01:00
|
|
|
# create interfaces configuration
|
2014-01-28 09:01:44 +01:00
|
|
|
#cat > $DEST/output/sdcard/etc/netctl/interfaces/eth0 <<EOT
|
|
|
|
#auto eth0
|
|
|
|
#allow-hotplug eth0
|
|
|
|
#iface eth0 inet dhcp
|
|
|
|
# hwaddress ether #for AP use
|
|
|
|
#
|
|
|
|
#EOT
|
2014-01-25 12:10:05 +01:00
|
|
|
|
2014-01-28 09:01:44 +01:00
|
|
|
#use wifi-menu wlan0 to configure
|
2014-02-05 12:49:28 +01:00
|
|
|
#cat > $DEST/output/sdcard/etc/netctl/wlan0 <<EOT
|
|
|
|
#auto wlan0
|
|
|
|
#allow-hotplug wlan0
|
|
|
|
#iface wlan0 inet dhcp
|
2014-02-24 19:44:00 +01:00
|
|
|
# wpa-ssid SSID
|
2014-01-10 09:22:30 +01:00
|
|
|
# wpa-psk xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
2013-12-29 12:01:02 +01:00
|
|
|
# to generate proper encrypted key: wpa_passphrase yourSSID yourpassword
|
|
|
|
|
2014-02-05 12:49:28 +01:00
|
|
|
#EOT
|
2014-01-18 17:41:11 +01:00
|
|
|
|
|
|
|
# create interfaces if you want to have AP. /etc/modules must be: bcmdhd op_mode=2
|
2014-01-22 11:47:48 +01:00
|
|
|
#cat <<EOT >> $DEST/output/sdcard/etc/network/interfaces.hostapd
|
|
|
|
#auto lo br0
|
|
|
|
#iface lo inet loopback
|
2014-01-18 17:41:11 +01:00
|
|
|
|
2014-01-22 11:47:48 +01:00
|
|
|
#allow-hotplug eth0
|
|
|
|
#iface eth0 inet manual
|
2014-01-18 17:41:11 +01:00
|
|
|
|
2014-01-22 11:47:48 +01:00
|
|
|
#allow-hotplug wlan0
|
|
|
|
#iface wlan0 inet manual
|
2014-01-18 17:41:11 +01:00
|
|
|
|
2014-01-22 11:47:48 +01:00
|
|
|
#iface br0 inet dhcp
|
|
|
|
#bridge_ports eth0 wlan0
|
2014-01-28 09:01:44 +01:00
|
|
|
#hwaddress ether # will be added at first boot
|
2014-01-22 11:47:48 +01:00
|
|
|
#EOT
|
2014-01-18 17:41:11 +01:00
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
# enable serial console (Debian/sysvinit way)
|
2014-01-24 17:44:16 +01:00
|
|
|
#echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> $DEST/output/sdcard/etc/inittab
|
2013-12-29 12:01:02 +01:00
|
|
|
|
2014-01-22 11:47:48 +01:00
|
|
|
#remove the preconfigured boot from the image and use the one we want
|
|
|
|
rm -rf $DEST/output/sdcard/boot/
|
2014-02-26 12:06:35 +01:00
|
|
|
mkdir -p $DEST/output/sdcard/boot/
|
2013-12-29 12:01:02 +01:00
|
|
|
cp $DEST/output/uEnv.txt $DEST/output/sdcard/boot/
|
|
|
|
cp $DEST/linux-sunxi/arch/arm/boot/uImage $DEST/output/sdcard/boot/
|
|
|
|
|
2014-01-15 18:03:53 +01:00
|
|
|
# copy proper bin file
|
2014-01-16 08:13:28 +01:00
|
|
|
if [ $DISPLAY = 4 ]; then
|
2014-02-26 12:06:35 +01:00
|
|
|
cp $DEST/output/script-vga.bin $DEST/output/sdcard/boot/script.bin
|
2014-01-15 18:03:53 +01:00
|
|
|
else
|
2014-02-26 12:06:35 +01:00
|
|
|
cp $DEST/output/script-hdmi.bin $DEST/output/sdcard/boot/script.bin
|
2014-01-15 18:03:53 +01:00
|
|
|
fi
|
|
|
|
|
2013-12-29 12:01:02 +01:00
|
|
|
cp -R $DEST/linux-sunxi/output/lib/modules $DEST/output/sdcard/lib/
|
|
|
|
cp -R $DEST/linux-sunxi/output/lib/firmware/ $DEST/output/sdcard/lib/
|
|
|
|
|
2014-01-10 09:06:38 +01:00
|
|
|
# USB redirector tools http://www.incentivespro.com
|
2014-02-05 12:49:28 +01:00
|
|
|
#cd $DEST
|
|
|
|
#wget http://www.incentivespro.com/usb-redirector-linux-arm-eabi.tar.gz
|
|
|
|
#tar xvfz usb-redirector-linux-arm-eabi.tar.gz
|
|
|
|
#rm usb-redirector-linux-arm-eabi.tar.gz
|
|
|
|
#cd $DEST/usb-redirector-linux-arm-eabi/files/modules/src/tusbd
|
2014-02-26 12:06:35 +01:00
|
|
|
#make -j2 ARCH=arm CROSS_COMPILE=$CROSS_COMPILE KERNELDIR=$DEST/linux-sunxi/
|
2014-01-10 09:06:38 +01:00
|
|
|
# configure USB redirector
|
2014-02-05 12:49:28 +01:00
|
|
|
#sed -e 's/%INSTALLDIR_TAG%/\/usr\/local/g' $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd > $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1
|
|
|
|
#sed -e 's/%PIDFILE_TAG%/\/var\/run\/usbsrvd.pid/g' $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1 > $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
|
|
|
|
#sed -e 's/%STUBNAME_TAG%/tusbd/g' $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd > $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1
|
|
|
|
#sed -e 's/%DAEMONNAME_TAG%/usbsrvd/g' $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd1 > $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
|
|
|
|
#chmod +x $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd
|
2014-01-10 09:06:38 +01:00
|
|
|
# copy to root
|
2014-02-24 19:44:00 +01:00
|
|
|
#cp $DEST/usb-redirector-linux-arm-eabi/files/usb* $DEST/output/sdcard/usr/local/bin/
|
|
|
|
#cp $DEST/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/tusbd.ko $DEST/output/sdcard/usr/local/bin/
|
2014-02-05 12:49:28 +01:00
|
|
|
#cp $DEST/usb-redirector-linux-arm-eabi/files/rc.usbsrvd $DEST/output/sdcard/etc/modules-load.d/
|
2014-01-28 09:01:44 +01:00
|
|
|
# started by default
|
2014-01-10 09:06:38 +01:00
|
|
|
|
2014-01-18 17:41:11 +01:00
|
|
|
# hostapd from testing binary replace.
|
2014-02-26 12:06:35 +01:00
|
|
|
# cd $DEST/output/sdcard/usr/sbin/
|
|
|
|
# tar xvfz $SRC/bin/hostapd21.tgz
|
|
|
|
# cp $SRC/config/hostapd.conf $DEST/output/sdcard/etc/
|
2014-01-18 17:41:11 +01:00
|
|
|
|
2014-01-02 11:33:32 +01:00
|
|
|
# sunxi-tools
|
|
|
|
cd $DEST/sunxi-tools
|
2014-02-26 12:06:35 +01:00
|
|
|
make clean
|
2014-02-26 12:36:44 +01:00
|
|
|
make -j2 'fex2bin' CC=${CROSS_COMPILE}gcc
|
|
|
|
make -j2 'bin2fex' CC=${CROSS_COMPILE}gcc
|
|
|
|
make -j2 'nand-part' CC=${CROSS_COMPILE}gcc
|
2014-02-26 12:06:35 +01:00
|
|
|
|
|
|
|
mkdir -p $DEST/output/sdcard/usr/bin/
|
2014-02-24 19:44:00 +01:00
|
|
|
cp fex2bin $DEST/output/sdcard/usr/bin/
|
2014-01-02 11:33:32 +01:00
|
|
|
cp bin2fex $DEST/output/sdcard/usr/bin/
|
2014-01-06 13:17:16 +01:00
|
|
|
cp nand-part $DEST/output/sdcard/usr/bin/
|
2014-01-01 17:40:05 +01:00
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
# umount images
|
|
|
|
umount $DEST/output/sdcard/
|
2014-01-07 20:21:03 +01:00
|
|
|
losetup -d $LOOP1
|
|
|
|
losetup -d $LOOP0
|
2014-02-26 12:06:35 +01:00
|
|
|
sync
|
|
|
|
|
2014-02-24 19:44:00 +01:00
|
|
|
# compress image
|
2014-01-01 17:12:16 +01:00
|
|
|
gzip $DEST/output/*.raw
|