no message

This commit is contained in:
Igor Pecovnik
2014-10-08 07:39:24 +02:00
parent 416a9e0c79
commit 0b37356d17
32 changed files with 9933 additions and 0 deletions

1387
config/cubieboard2.fex Normal file

File diff suppressed because it is too large Load Diff

1402
config/cubietruck.fex Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
ssid=BANANA
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

View File

@@ -0,0 +1,19 @@
ssid=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

View File

@@ -0,0 +1,17 @@
ssid=CUBOX
interface=wlan0
hw_mode=g
channel=1
bridge=br0
driver=nl80211
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
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,64 @@
# generated by devinput.sh
begin remote
name devinput
bits 16
eps 30
aeps 100
pre_data_bits 16
pre_data 0x0001
post_data_bits 32
post_data 0x00000001
gap 132799
toggle_bit 0
begin codes
POWER 87
MUTE 92
HELP 5
PREFS 9
FAVS 21
R2C1 4
R2C2 8
R2C3 20
VOLUME+ 255
VOLUME- 93
INFO 16
MOUSE 17
ZOOM+ 12
ZOOM- 88
R5C1 84
R5C2 91
R5C3 23
MENU 22
HOME 71
BACK 79
LEFT 6
RIGHT 14
UP 67
DOWN 10
OK 2
STOP 19
PLAY 80
SEARCH 13
REV 7
FWD 3
PREV 15
NEXT 11
RED 85
GREEN 78
YELLOW 73
BLUE 72
1 26
2 1
3 69
4 89
5 77
6 64
7 82
8 83
9 65
0 90
AUDIO 68
SUBTITLE 70
end codes
end remote

127
config/lirc.conf.cubox-i Normal file
View File

@@ -0,0 +1,127 @@
#
# this config file was automatically generated
# using lirc-0.8.3(default) on Thu Jun 4 11:04:55 2009
#
# contributed by Maarten Platjes
#
# brand: LG
# model no. of remote control: MKJ40653802
# devices being controlled by this remote:
# LG 2008 LCD TVs like 19LS4D , 22LS4D ,
# 19LG30 , 22LG30 , 26LG30 , 32LG30 , 37LG30 ,
# 42LG30 , 32LG50 , 37LG50 , 42LG50 , 47LG50 ,
# 52LG50and variants of these models (xxLGx000)
#
# Note: The MKJ40653802 in STB mode does not
# output all keys, the ones that are not
# mapped do not work in STB mode (remote simply
# doesn't output anything when pressing the keys)
#
begin remote
name MKJ40653802-TV
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9061 4473
one 591 1660
zero 591 521
ptrail 590
pre_data_bits 16
pre_data 0x20DF
gap 108029
toggle_bit_mask 0x0
begin codes
KEY_POWER 0x10EF # Was: power
input 0xD02F
tv/radio 0x0FF0
q.menu 0xA25D
KEY_MENU 0xC23D # Was: menu
KEY_INFO 0xD52A # Was: guide
KEY_UP 0x02FD # Was: up
KEY_LEFT 0xE01F # Was: left
KEY_RIGHT 0x609F # Was: right
KEY_DOWN 0x827D # Was: down
KEY_OK 0x22DD # Was: ok
KEY_EXIT 0x14EB # Was: return/exit
KEY_INFO 0x55AA # Was: info
av_mode 0x0CF3
KEY_VOLUMEUP 0x40BF # Was: vol_up
KEY_VOLUMEDOWN 0xC03F # Was: vol_down
mark/fav 0x7887
KEY_MUTE 0x906F # Was: mute
KEY_PAGEUP 0x00FF # Was: page_up
KEY_PAGEDOWN 0x807F # Was: page_down
KEY_1 0x8877 # Was: 1
KEY_2 0x48B7 # Was: 2
KEY_3 0xC837 # Was: 3
KEY_4 0x28D7 # Was: 4
KEY_5 0xA857 # Was: 5
KEY_6 0x6897 # Was: 6
KEY_7 0xE817 # Was: 7
KEY_8 0x18E7 # Was: 8
KEY_9 0x9867 # Was: 9
KEY_0 0x08F7 # Was: 0
KEY_LIST 0xCA35 # Was: list
q.view 0x58A7
KEY_RED 0x4EB1 # Was: red
green/stop 0x8E71
yellow/play 0xC639
blue/pause 0x8679
KEY_TEXT 0x04FB # Was: text
t.opt/rev 0x847B
KEY_SUBTITLE 0x9C63 # Was: subtitle/ffw
KEY_RECORD 0xBD42 # Was: rec
simplink 0x7E81
end codes
end remote
begin remote
name MKJ40653802-STB
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9062 4467
one 589 1662
zero 589 522
ptrail 587
pre_data_bits 16
pre_data 0xEF10
gap 107967
toggle_bit_mask 0x0
begin codes
input 0xD02F
KEY_POWER 0x10EF # Was: power
KEY_MENU 0xC23D # Was: menu
KEY_UP 0x02FD # Was: up
KEY_DOWN 0x827D # Was: down
KEY_RIGHT 0x609F # Was: right
KEY_LEFT 0xE01F # Was: left
KEY_OK 0x22DD # Was: ok
KEY_1 0x8877 # Was: 1
KEY_2 0x48B7 # Was: 2
KEY_3 0xC837 # Was: 3
KEY_4 0x28D7 # Was: 4
KEY_5 0xA857 # Was: 5
KEY_6 0x6897 # Was: 6
KEY_7 0xE817 # Was: 7
KEY_8 0x18E7 # Was: 8
KEY_9 0x9867 # Was: 9
KEY_0 0x08F7 # Was: 0
KEY_VOLUMEUP 0x40BF # Was: vol_up
KEY_VOLUMEDOWN 0xC03F # Was: vol_down
KEY_MUTE 0x906F # Was: mute
KEY_PAGEUP 0x00FF # Was: page_up
KEY_PAGEDOWN 0x807F # Was: page_down
end codes
end remote

View File

@@ -0,0 +1 @@
brcmfmac

20
config/modules.cubietruck Normal file
View File

@@ -0,0 +1,20 @@
hci_uart
gpio_sunxi
bt_gpio
wifi_gpio
rfcomm
hidp
sunxi-ir
sunx_ss
bonding
spi_sun7i
bcmdhd
# if you want access point mode, load wifi module this way: bcmdhd op_mode=2
# and edit /etc/init.d/hostapd change DAEMON_CONF=/etc/hostapd.conf ; edit your wifi net settings in hostapd.conf ; reboot
#
# w1_sunxi
#
# Advanced LIRC driver: https://github.com/matzrh/sunxi-lirc
#
# lirc_gpio
# sunxi_lirc

1
config/modules.cubox-i Normal file
View File

@@ -0,0 +1 @@
brcmfmac

View File

@@ -0,0 +1,8 @@
deb http://ftp.de.debian.org/debian testing main contrib non-free
deb-src http://ftp.de.debian.org/debian testing main contrib non-free
deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

View File

@@ -0,0 +1,9 @@
deb http://ftp.de.debian.org/debian stable main contrib non-free
deb-src http://ftp.de.debian.org/debian stable main contrib non-free
deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

5
config/uEnv.cubieboard2 Normal file
View File

@@ -0,0 +1,5 @@
console=ttyS0,115200
root=/dev/mmcblk0p1 rootwait
extraargs=rootfstype=ext4 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p60 panic=10 consoleblank=0
script=cubieboard2.bin
kernel=uImage

5
config/uEnv.cubietruck Normal file
View File

@@ -0,0 +1,5 @@
console=ttyS0,115200
root=/dev/mmcblk0p1 rootwait
extraargs=rootfstype=ext4 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p60 panic=10 consoleblank=0
script=cubietruck.bin
kernel=uImage

1
config/uEnv.cubox-i Normal file
View File

@@ -0,0 +1 @@
mmcargs=setenv bootargs root=/dev/mmcblk0p1 rootfstype=ext4 rootwait console=ttymxc0,115200n8 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi quiet

104
patch/hb-i2c-spi.patch Normal file
View File

@@ -0,0 +1,104 @@
--- linux-linaro-stable-mx6/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi 2014-09-16 12:27:09.500971944 -0500
+++ linux-imx6-3.14/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi 2014-09-16 10:11:41.773085665 -0500
@@ -128,6 +128,31 @@
};
};
+&i2c3 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hummingboard_i2c3>;
+ status = "okay";
+};
+
+&ecspi2 {
+ fsl,spi-num-chipselects = <2>;
+ cs-gpios = <&gpio2 26 1>, <&gpio2 27 1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hummingboard_spi>;
+ status = "okay";
+ spidev@0x00 {
+ compatible = "spidev";
+ spi-max-frequency = <5000000>;
+ reg = <0>;
+ };
+ spidev@0x01 {
+ compatible = "spidev";
+ spi-max-frequency = <5000000>;
+ reg = <1>;
+ };
+};
+
&audmux {
status = "okay";
};
@@ -153,8 +178,8 @@
sgtl5000: sgtl5000@0a {
clocks = <&clks 201>;
compatible = "fsl,sgtl5000";
- pinctrl-0 = <&pinctrl_hummingboard_sgtl5000>;
pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hummingboard_sgtl5000>;
reg = <0x0a>;
VDDA-supply = <&reg_3p3v>;
VDDIO-supply = <&reg_3p3v>;
@@ -195,6 +220,17 @@
>;
};
+ pinctrl_hummingboard_spi: hummingboard_spi {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_OE__ECSPI2_MISO 0x100b1
+ MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI 0x100b1
+ MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK 0x100b1
+ /* MX6QDL_PAD_EIM_RW__ECSPI2_SS0 0x100b1 */
+ MX6QDL_PAD_EIM_RW__GPIO2_IO26 0x100b1
+ MX6QDL_PAD_EIM_LBA__ECSPI2_SS1 0x100b1
+ >;
+ };
+
pinctrl_hummingboard_gpio3_5: hummingboard-gpio3_5 {
fsl,pins = <
MX6QDL_PAD_EIM_DA5__GPIO3_IO05 0x80000000
@@ -221,6 +257,13 @@
>;
};
+ pinctrl_hummingboard_i2c3: hummingboard-i2c3 {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_D17__I2C3_SCL 0x4001b8b1
+ MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+ >;
+ };
+
pinctrl_hummingboard_sgtl5000: hummingboard-sgtl5000 {
fsl,pins = <
MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x130b0 /*brk*/
@@ -267,12 +310,6 @@
MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x13059
>;
};
-
- pinctrl_hummingboard_pcie_reset: hummingboard-pcie-reset {
- fsl,pins = <
- MX6QDL_PAD_EIM_DA4__GPIO3_IO04 0x80000000
- >;
- };
};
};
@@ -328,14 +365,3 @@
fsl,cpu_pdnscr_iso2sw = <0x1>;
fsl,cpu_pdnscr_iso = <0x1>;
};
-
-&pcie {
- pinctrl-names = "default";
- pinctrl-0 = <
- &pinctrl_hummingboard_pcie_reset
- >;
- reset-gpio = <&gpio3 4 0>;
- status = "okay";
- no-msi;
-};
-

18
scripts/02periodic Normal file
View File

@@ -0,0 +1,18 @@
// Enable the update/upgrade script (0=disable)
APT::Periodic::Enable "1";
// Do "apt-get update" automatically every n-days (0=disable)
APT::Periodic::Update-Package-Lists "1";
// Do "apt-get upgrade --download-only" every n-days (0=disable)
APT::Periodic::Download-Upgradeable-Packages "1";
// Run the "unattended-upgrade" security upgrade script
// every n-days (0=disabled)
// Requires the package "unattended-upgrades" and will write
// a log in /var/log/unattended-upgrades
APT::Periodic::Unattended-Upgrade "1";
// Do "apt-get autoclean" every n-days (0=disable)
APT::Periodic::AutocleanInterval "7";

View File

@@ -0,0 +1,59 @@
// Automatically upgrade packages from these origin patterns
Unattended-Upgrade::Origins-Pattern {
// Archive or Suite based matching:
// Note that this will silently match a different release after
// migration to the specified archive (e.g. testing becomes the
// new stable).
// "o=Debian,a=stable";
// "o=Debian,a=stable-updates";
// "o=Debian,a=proposed-updates";
"origin=Debian,archive=stable,label=Debian-Security";
};
// List of packages to not update
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
// This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run
// dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed
//Unattended-Upgrade::AutoFixInterruptedDpkg "false";
// Split the upgrade into the smallest possible chunks so that
// they can be interrupted with SIGUSR1. This makes the upgrade
// a bit slower but it has the benefit that shutdown while a upgrade
// is running is possible (with a small delay)
//Unattended-Upgrade::MinimalSteps "true";
// Install all unattended-upgrades when the machine is shuting down
// instead of doing it in the background while the machine is running
// This will (obviously) make shutdown slower
//Unattended-Upgrade::InstallOnShutdown "true";
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides
// 'mailx' must be installed. E.g. "user@example.com"
//Unattended-Upgrade::Mail "root";
// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
//Unattended-Upgrade::MailOnlyOnError "true";
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
//Unattended-Upgrade::Remove-Unused-Dependencies "false";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false";
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";

54
scripts/armhwinfo Normal file
View File

@@ -0,0 +1,54 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: armhwinfo
# Required-Start:
# Required-Stop: glibc
# Default-Start: S
# Default-Stop:
# Short-Description: Get some info about hardware for some ARM boards
### END INIT INFO
CORES=$(grep -c ^processor /proc/cpuinfo)
MEMTOTAL=$(awk 'BEGIN { printf "%.0f\n", '$(grep MemTotal /proc/meminfo | awk '{print $2}')'/1024/1024 }')
ARCH=$(lscpu | grep Architecture | awk '{print $2}')
RTC=$(dmesg | grep rtc0 | awk '{print $(NF)}')
HB_PCI=$(dmesg | grep '16c3:abcd')
HARDWARE=$(cat /proc/cpuinfo | grep Hardware | awk '{print $3}')
GMAC=$(dmesg | grep "sunxi_gmac-0:00")
# ARM
if [ "$ARCH" = "armv7l" ]; then
if [ "$HARDWARE" = "sun7i" ]; then
ID="Allwinner"
if [ "$MEMTOTAL" = 2 ]; then
ID="Cubietruck"
else
if [ -n "$GMAC" ]; then
ID="Banana PI"
else
ID="Cubieboard"
fi
fi
fi
if [ "$HARDWARE" = "Freescale" ]; then
ID="Freescale"
if [ "$MEMTOTAL" = 2 ]; then
ID="Cubox i4"
else
if [ "$HB_PCI" != "" ]; then
ID="HB i2eX"
else
if [ "$RTC" = "rtc0" ]; then
ID="Cubox i2eX"
else
ID="HB i2"
if [ "$CORES" = 1 ]; then ID="HB i1"; fi
fi
fi
fi
fi
fi
echo "" > /var/run/motd.dynamic
toilet -f standard -F metal "$ID" >> /var/run/motd.dynamic
echo "" >> /var/run/motd.dynamic

58
scripts/bashrc Normal file
View File

@@ -0,0 +1,58 @@
if [ ${TERM} == "dumb" ]; then
return
fi
OUT=""
LOAD=$(w | sed -n 1p | awk '{print $(NF-2), $(NF-1),$(NF-0)}')
OUT="${OUT}Load: ${LOAD} "
## getting temperature from USB termometer
## http://www.dx.com/p/81105
##
if which temper >/dev/null; then
TEMPER=$(temper -c)
if echo $TEMPER | egrep -qv "Couldn't find the USB device"; then
TEMPER=$(echo "scale=1;${TEMPER}/1" | bc)
TEMPER="- Ambient: ${TEMPER}"
else
TEMPER=""
fi
fi
CEL=$(awk 'BEGIN { print "\302\260C"; }')
if [ -d "/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/" ]; then
TEMP=$(cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input)
TEMP=$(echo "scale=1;${TEMP}/1000" | bc)
OUT="${OUT}- Board: ${TEMP}${CEL} "
fi
if [[ -n $TEMPER ]]; then
OUT=$OUT"${TEMPER}${CEL} "
fi
# if we have a hard drive
if [ -e '/dev/sda' ]; then
HDDTEMP=$(/usr/sbin/hddtemp /dev/sda 2>&1)
if [ $? -eq 0 ]; then
HDDTEMP=$(echo ${HDDTEMP} | awk '{print $NF}')
HDDFREE=$(df -h /dev/sda1 | grep sda | awk '{ print " / " $(NF-2)}')
if [ "${HDDFREE}" != "" ]; then
HDDFREE="${HDDFREE}"b
fi
OUT="${OUT}- Drive: ${HDDTEMP}${HDDFREE} "
fi
fi
MEMFREE=$(free | sed -n 2p | awk '{print $(NF-3)}')
MEMBUFFERS=$(free | sed -n 2p | awk '{print $(NF-1)}')
MEMCACHED=$(free | sed -n 2p | awk '{print $(NF)}')
MEM=$(echo "(${MEMFREE}+${MEMBUFFERS}+${MEMCACHED})/1024" | bc)
OUT="${OUT}- Memory: ${MEM}Mb"
echo ""
echo ${OUT}
echo ""

15
scripts/bootsplash Normal file
View File

@@ -0,0 +1,15 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: bootsplash
# Required-Start:
# Required-Stop: glibc
# Default-Start: S
# Default-Stop:
# Short-Description: Show this to console during boot
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
echo "Booting Debian ..." >> /dev/tty0
# display boot image
#fbi -vt 1 -noverbose -d /dev/fb0 /etc/bootsplash.png

34
scripts/brcm40183 Normal file
View File

@@ -0,0 +1,34 @@
#
# Default it is called to be uncertain wich MAC address the chipset has.
# Therefore it is recommendable to set the MAC address manually.
# This can be done by setting the variable MAC_ADDR with a chosen value.
# If this variable is empty or not set the default 11:22:33:44:55:66 will be chosen.
# Needless to say, if more cubietrucks are used chose different adresses for them.
MAC_ADDR=43:29:B1:55:01:01
#
# The PORT value has to be set with the tty port name connected to the brcm40183 chip.
# For the cubietruck this chip is connected to uart2.
# If this port can not be found probebly you have to enable the uart2 using setup.bin
#
# For example:
#
# [uart_para2]
# uart_used = 1
# uart_port = 2
# uart_type = 4
# uart_tx = port:PI18<3><1><default><default>
# uart_rx = port:PI19<3><1><default><default>
# uart_rts = port:PI16<3><1><default><default>
# uart_cts = port:PI17<3><1><default><default>
#
#
# The correct portname can be found by using the command:
#
# ls /sys/devices/platform/sunxi-uart.2/tty/
#
# Usually for Cubian it is ttyS1
#
PORT=ttyS1

82
scripts/brcm40183-patch Normal file
View File

@@ -0,0 +1,82 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: brcm40183-patch
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: bluetooth
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Patch firmware for brcm40183 Bluetooth adapter
# Description: Patch firmware for brcm40183 Bluetooth adapter
### END INIT INFO
DEFAULTS="/etc/default/brcm40183"
# Include brcm40183 defaults if available
if [ -r "${DEFAULTS}" ]
then
. "${DEFAULTS}"
fi
. /lib/lsb/init-functions
do_start () {
if [ ! -z $(/usr/sbin/hciconfig | /bin/grep UART | /usr/bin/cut -d: -f1) ]
then
log_action_begin_msg "brcm40183 device allready initialized"
log_action_end_msg 0
/usr/bin/hcitool dev
else
# Select MAC address
if [ -z "$MAC_ADDR" ]; then
log_warning_msg "No MAC_ADDR set in /etc/default/brcm40183, will use MAC 11:22:33:44:55:66"
MAC_OPTIONS="--bd_addr 11:22:33:44:55:66"
else
MAC_OPTIONS="--bd_addr $MAC_ADDR"
fi
# Select tty port
if [ -z "$PORT" ]; then
log_warning_msg "No PORT set in /etc/default/brcm40183, will use ttyS1"
PORT="ttyS1"
fi
# Start patching
/bin/echo -en "" > /dev/$PORT # pull down RTS on UART
log_action_begin_msg "Start pushing firmware to device and waiting max. 60sec to complete"
/usr/bin/timeout 60s /usr/local/bin/brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci --no2bytes --tosleep 1000 $MAC_OPTIONS /dev/$PORT > /tmp/brcm40183.firmware 2>&1
case "$?" in
0) log_action_end_msg 0
# Enable interfaces
/usr/sbin/hciattach /dev/$PORT any
;;
*) log_action_end_msg 1
/bin/echo "Check /tmp/brcm40183.firmware for messages."
;;
esac
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
status)
/usr/bin/hcitool dev
;;
*)
echo "Usage: brcm40183-patch.sh [start|stop|status]" >&2
exit 3
;;
esac

11
scripts/brcm4330 Normal file
View File

@@ -0,0 +1,11 @@
#
# Default it is called to be uncertain wich MAC address the chipset has.
# Therefore it is recommendable to set the MAC address manually.
# This can be done by setting the variable MAC_ADDR with a chosen value.
# If this variable is empty or not set the default 11:22:33:44:55:66 will be chosen.
MAC_ADDR=43:29:B1:55:01:01
#
PORT=ttymxc3

94
scripts/brcm4330-patch Normal file
View File

@@ -0,0 +1,94 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: brcm4330-patch
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: bluetooth
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Patch firmware for brcm4330 Bluetooth adapter
# Description: Patch firmware for brcm4330 Bluetooth adapter
### END INIT INFO
DEFAULTS="/etc/default/brcm4330"
# Include brcm4330 defaults if available
if [ -r "${DEFAULTS}" ]
then
. "${DEFAULTS}"
fi
. /lib/lsb/init-functions
do_start () {
if [ ! -z $(/usr/sbin/hciconfig | /bin/grep UART | /usr/bin/cut -d: -f1) ]
then
log_action_begin_msg "brcm4330 device allready initialized"
log_action_end_msg 0
/usr/bin/hcitool dev
else
a=`cat /sys/class/mmc_host/mmc0/mmc0\:0001/mmc0\:0001\:1/device`
# check if the chip id is correct
if [ "$a" = "0x4330" ] ; then
echo "ok"
else
log_warning_msg "Not correct BT chip"
exit
fi
# Select MAC address
if [ -z "$MAC_ADDR" ]; then
log_warning_msg "No MAC_ADDR set in /etc/default/brcm4330, will use MAC 11:22:33:44:55:66"
MAC_OPTIONS="--bd_addr 11:22:33:44:55:66"
else
MAC_OPTIONS="--bd_addr $MAC_ADDR"
fi
# Select tty port
if [ -z "$PORT" ]; then
log_warning_msg "No PORT set in /etc/default/brcm4330, will use ttymxc3"
PORT="ttymxc3"
fi
# Start patching
/bin/echo -en "" > /dev/$PORT # pull down RTS on UART
log_action_begin_msg "Start pushing BRCM4330 bluetooth firmware to device and waiting 5 sec to complete"
/usr/local/bin/brcm_patchram_plus -d --patchram /lib/firmware/brcm/bcm4330.hcd --baudrate 3000000 --use_baudrate_for_download /dev/$PORT --enable_hci --no2bytes --tosleep 1000 $MAC_OPTIONS > /tmp/brcm4330.firmware > /dev/null 2>&1 &
sleep 5
case "$?" in
0) log_action_end_msg 0
# Enable interfaces
/usr/sbin/hciconfig hci0 up
#/usr/sbin/hciattach /dev/$PORT any
;;
*) log_action_end_msg 1
/bin/echo "Check /tmp/brcm4330.firmware for messages."
;;
esac
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
status)
/usr/bin/hcitool dev
;;
*)
echo "Usage: brcm4330-patch.sh [start|stop|status]" >&2
exit 3
;;
esac

16
scripts/disable_led.sh Normal file
View File

@@ -0,0 +1,16 @@
### BEGIN INIT INFO
# Provides: Disable bright leds from Cubietruck
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: CT Led disabler
# Description: Disable bright leds from cubietruck using /sys/class/leds
### END INIT INFO
#
# Turn off bright flashing LEDs!!
echo 0 > /sys/class/leds/blue:ph21:led1/brightness
echo 0 > /sys/class/leds/orange:ph20:led2/brightness
echo 0 > /sys/class/leds/white:ph11:led3/brightness
echo 0 > /sys/class/leds/green:ph07:led4/brightness

View File

@@ -0,0 +1,13 @@
### BEGIN INIT INFO
# Provides: Disable blinking leds from Banana
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Banana Led disabler
# Description: Disable bright leds using /sys/class/leds
### END INIT INFO
#
# Turn off bright flashing LEDs!!
echo none > /sys/class/leds/green\:ph24\:led1/trigger

94
scripts/firstrun Normal file
View File

@@ -0,0 +1,94 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: firstrun
# Required-Start: $remote_fs
# Required-Stop:
# Should-Start:
# Default-Start: S
# Default-Stop:
# Short-Description: Script to run when first starting
# Description: Something needs to be done when is
# starting at first time.
#
# 1. regenerate ssh host key
### END INIT INFO
N=/etc/init.d/firstrun
MEMTOTAL=$(awk 'BEGIN { printf "%.0f\n", '$(grep MemTotal /proc/meminfo | awk '{print $2}')'/1024/1024 }')
set -e
do_expand_rootfs(){
device="/dev/mmcblk0"
(echo d; echo n; echo p; echo 1; echo ; echo; echo w;) | fdisk $device
return 0
}
case "$1" in
start)
reboot=false
#
sed -e 's/#fbi/fbi/g' -i /etc/init.d/bootsplash
#
# if we have 1G ram reduce RAMLOG size
if [ "$MEMTOTAL" = 1 ]; then
sed -e 's/TMPFS_RAMFS_SIZE=512m/TMPFS_RAMFS_SIZE=256m/g' -i /etc/default/ramlog
# for cubieboard disable some services
if [ -f "/boot/cubieboard2.bin" ]; then
/sbin/insserv -r brcm40183-patch
/sbin/insserv -r disable_led.sh
fi
fi
#
#
#
echo "First run. This process takes around 2 minutes to finish..." >> /dev/tty0
echo "Creating ssh keys..." >> /dev/tty0
NEWMAC=00:01:43:`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`
sed -e 's/ether/ether '$NEWMAC'/g' -i /etc/network/interfaces.default
sed -e 's/ether/ether '$NEWMAC'/g' -i /etc/network/interfaces.hostapd
# Cubietruck exception
# if HDMI is attached during boot, set default screen output to HDMI
if [ -n "$(dmesg | grep ParseEDID)" ] && [ -n "/boot/cubietruck.bin" ]; then
bin2fex /boot/cubietruck.bin /tmp/tmp.fex
sed -e 's/screen0_output_type.*/screen0_output_type = 3/g' -i /tmp/tmp.fex
fex2bin /tmp/tmp.fex /boot/cubietruck.bin
fi
rm -f /etc/ssh/ssh_host*
dpkg-reconfigure openssh-server >> /dev/tty0
set +e
#echo "Creating local sources list..." >> /dev/tty0
#netselect-apt -s -n -o /etc/apt/sources.list >/dev/null 2>&1
if [ "$(fping 8.8.8.8 | grep alive)" != "" ]; then
echo "Downloading packages list..." >> /dev/tty0
apt-get update >/dev/null 2>&1
#echo "Updating all packages..." >> /dev/tty0
#apt-get -y upgrade >/dev/null 2>&1
#apt-get -y clean >/dev/null 2>&1
fi
echo "Expanding rootfs..." >> /dev/tty0
if do_expand_rootfs;then
echo "Expanding rootfs success, rebooting automatically." >> /dev/tty0
/sbin/insserv resize2fs
reboot=true
else
echo "Expanding rootfs has failed, see log files." >> /dev/tty0
fi
set -e
update-rc.d bootsplash defaults
/sbin/insserv -r firstrun
if $reboot;then
/sbin/reboot
fi
;;
*)
echo "Usage: $N {start}" >&2
exit 1
;;
esac
exit 0

108
scripts/nand-install.sh Normal file
View File

@@ -0,0 +1,108 @@
#!/bin/bash
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script."
exit 1
fi
cat > .install-exclude <<EOF
/dev/*
/proc/*
/sys/*
/media/*
/mnt/*
/run/*
/tmp/*
/boot/*
/root/nand-install.sh
EOF
exec 2>/dev/null
umount /mnt
exec 2>&1
clear_console
echo "
# # ## ##### # # # # # ####
# # # # # # ## # # ## # # #
# # # # # # # # # # # # # #
# ## # ###### ##### # # # # # # # # ###
## ## # # # # # ## # # ## # #
# # # # # # # # # # # ####
This script will NUKE / erase your NAND partition and copy content of SD card to it
"
echo -n "Proceed (y/n)? (default: y): "
read nandinst
if [ "$nandinst" == "n" ]
then
exit 0
fi
FLAG=".reboot-nand-install.pid"
if [ ! -f $FLAG ]; then
echo "Partitioning"
apt-get -y -qq install dosfstools
(echo y;) | nand-part -f a20 /dev/nand 32768 'bootloader 32768' 'rootfs 0' >> /dev/null || true
echo "
Press a key to reboot than run this script again!
"
touch $FLAG
read zagon
reboot
exit 0
fi
echo "Formatting and optimizing NAND rootfs ... up to 30 sec"
mkfs.vfat /dev/nand1 >> /dev/null
mkfs.ext4 /dev/nand2 >> /dev/null
tune2fs -o journal_data_writeback /dev/nand2 >> /dev/null
# tune2fs -O ^has_journal /dev/nand2 >> /dev/null
e2fsck -f /dev/nand2
echo "Creating NAND bootfs ... few seconds"
mount /dev/nand1 /mnt
tar xfz nand1-cubietruck-debian-boot.tgz -C /mnt/
#rm nand1-cubietruck-debian-boot.tgz
#rm nand_mbr.backup
# choose proper kernel configuration for CB2 or CT
if [ $(cat /proc/meminfo | grep MemTotal | grep -o '[0-9]\+') -ge 1531749 ]; then
cp /boot/uEnv.ct /mnt/uEnv.txt
cp /boot/cubietruck.bin /mnt/script.bin
else
cp /boot/uEnv.cb2 /mnt/uEnv.txt
cp /boot/cubieboard2.bin /mnt/script.bin
fi
cp /boot/uImage /mnt/
# change root from sd card to nand in both configs
sed -e 's/root=\/dev\/mmcblk0p1/nand_root=\/dev\/nand2/g' -i /mnt/uEnv.txt
# different path
sed -e 's/\/boot\///g' -i /mnt/uEnv.txt
umount /mnt
echo "Creating NAND rootfs ... up to 5 min"
mount /dev/nand2 /mnt
rsync -aH --exclude-from=.install-exclude / /mnt
# change sysfs
sed -e 's/mmcblk0/nand/g' -i /mnt/etc/sysfs.conf
# change fstab
sed -e 's/mmcblk0p1/nand2/g' -i /mnt/etc/fstab
echo "/dev/nand1 /boot vfat defaults 0 0" >> /mnt/etc/fstab
umount /mnt
echo "All done. Press a key to power off, then remove SD to boot from NAND"
rm $FLAG
rm .install-exclude
read konec
poweroff

30
scripts/resize2fs Normal file
View File

@@ -0,0 +1,30 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: resize2fs
# Required-Start: $local_fs
# Required-Stop:
# Should-Start:
# Default-Start: S
# Default-Stop:
# Short-Description: Resize the root filesystem to fill partition
# Description:
### END INIT INFO
set -e
N=/etc/init.d/resize2fs
case "$1" in
start)
/sbin/resize2fs /dev/mmcblk0p1 &&
/sbin/insserv -r resize2fs &&
rm $N
;;
*)
echo "Usage: $N {start}" >&2
exit 1
;;
esac
exit 0

71
scripts/sata-install.sh Normal file
View File

@@ -0,0 +1,71 @@
#!/bin/bash
#
# Configuration
DEST=/dev/sda1
FORMAT=yes
#
clear_console
figlet -f banner "warning"
#echo "Edit file !!!"; exit 0; # DELETE OR COMMENT THIS LINE TO CONTINUE
#
#
# Do not modify anything below
#
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script."
exit 1
fi
cat > .install-exclude <<EOF
/dev/*
/proc/*
/sys/*
/media/*
/mnt/*
/run/*
/tmp/*
/boot/*
/root/*
EOF
clear_console
figlet -f banner "warning"
echo "
This script might erase your Hard drive and copy content of SD card to it
"
echo -n "Proceed (y/n)? (default: y): "
read nandinst
if [ "$nandinst" == "n" ]
then
exit 0
fi
if [ "$FORMAT" == "yes" ]
then
mkfs.ext4 $DEST
fi
mount $DEST /mnt
sed -e 's,root=\/dev\/mmcblk0p1,root='"$DEST"',g' -i /boot/uEnv.ct
sed -e 's,root=\/dev\/mmcblk0p1,root='"$DEST"',g' -i /boot/uEnv.cb2
echo "Creating hard drive rootfs ... up to 5 min"
rsync -aH --exclude-from=.install-exclude / /mnt
# change fstab
sed -e 's,\/dev\/mmcblk0p1,'"$DEST"',g' -i /mnt/etc/fstab
umount /mnt
figlet -f banner "warning"
echo "All done. Press a key to reboot! System needs SD card for boot process! Can't boot directly from hard drive"
rm .install-exclude
read konec
reboot