if [ -z "${BUILD_HOSTNAME}" ]; then
. ./rpi2-settings.sh
fi
# Set up hosts
echo ubuntu >${R}/etc/hostname
cat <<EOM >${R}/etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOM
echo "127.0.1.1 ${BUILD_HOSTNAME}" >> ${R}/etc/hosts
# Set up interfaces
cat <<EOM >${R}/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
## enable for DHCP:
allow-hotplug eth0
iface eth0 inet dhcp
## enable and edit for static konfiguration:
#auto eth0
#iface eth0 inet static
# address 192.168.1.252
# netmask 255.255.255.0
# gateway 192.168.1.1
# mtu 1492
# dns-nameservers 192.168.1.2 8.8.8.8
# dns-search home box
EOM
# Setup Proxy for apt-get
cat <<EOM >${R}/etc/apt/apt.conf.d/40Proxy
#Acquire::http::Proxy "http://192.168.1.50:3142";
EOM
# Set up firmware config
cat <<EOM >${R}/boot/firmware/config.txt
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
# This (arm_freq=800) will destroy your device if you have not installed heatsink!
#arm_freq=800
## Video "tuning":
#If set to 1, don't show the rainbow splash screen on boot. The default value is 0.
disable_splash=1
#128M GPU split (use this for heavy 3D work, possibly also required for some video decoding):
#gpu_mem=128
#64M GPU split (this is the default)
#gpu_mem=64
# 32M GPU split (use this for Linux only with no 3D or video processing. Its enough for the 1080p framebuffer, but not much else)
#gpu_mem=32
#16M GPU split (use this for headless mode only. It is enough to boot the system, but you can not use video at all.)
gpu_mem=16
#########################################################
# #
# Overclocking #
# #
# Beware! You lost all warranties for the raspberry! #
# #
#########################################################
### Raspberry 1 ###
#Uncomment to overclock the arm. 700 MHz is the default.
#No overclocking (default):
#arm_freq=700
#core_freq=250
#sdram_freq=400
#over_voltage=0
##modest_overclocking
#arm_freq=800
#core_freq=300
#sdram_freq=400
#over_voltage=0
##medium_overclocking:
#arm_freq=900
#core_freq=333
#sdram_freq=450
#over_voltage=2
##high_overclocking:
#arm_freq=950
#core_freq=333
#sdram_freq=450
#over_voltage=6
##devil__overclocking:
#arm_freq=1000
#core_freq=500
#sdram_freq=500
#over_voltage=6
### Raspberry 2 ###
#uncomment to overclock the arm. 900 MHz is the default.
#Beware! You lost all warranties for the raspberry!
##No overclocking (default):
#arm_freq=900
#core_freq=250
#sdram_freq=450
#over_voltage=0
##medium_overclocking:
#boot_delay=1
#arm_freq=1000
#sdram_freq=500
#core_freq=500
#over_voltage=2
#temp_limit=80 #Will throttle to default clock speed if hit.
##devil__overclocking:
##force_turbo=1 #Voids Warranty!
#boot_delay=1 #helps to avoid sdcard corruption when force_turbo is enabled.
#arm_freq=1100
#sdram_freq=500
#core_freq=500
#over_voltage=2
temp_limit=80 #Will throttle to default clock speed if hit.
EOM
ln -sf firmware/config.txt ${R}/boot/config.txt
echo 'dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait' > ${R}/boot/firmware/cmdline.txt
# else, if you wand to boot from a usb-hd, use this:
# echo 'dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline rootwait' > ${R}/boot/firmware/cmdline.txt
ln -sf firmware/cmdline.txt ${R}/boot/cmdline.txt
# Blacklist platform modules not applicable to the RPi2
cat <<EOM >${R}/etc/modprobe.d/rpi2.conf
blacklist snd_soc_pcm512x_i2c
blacklist snd_soc_pcm512x
blacklist snd_soc_tas5713
blacklist snd_soc_wm8804
EOM
# Load sound module on boot
cat <<EOM >${R}/lib/modules-load.d/rpi2.conf
## Enable snd_bcm2835 if you need sound:
#snd_bcm2835
bcm2708_rng
EOM
## OR:
# blacklist sound module on boot (headless_mode)
cat <<EOM >> ${R}/etc/modprobe.d/rpi2.conf
# blacklist sound module on boot (headless_mode)
## Disable the blacklisting of snd_bcm2835 if you need sound:
blacklist snd_bcm2835
#blacklist bcm2708_rng
EOM