code.fastix.org

Dateiansicht:

Datei:Projekte -> Linux:ubuntu-for-raspberry-installer -> rpi2-extra-files.sh
md5:f4ac2b66cd0c9ff92f1bd4e9a397fe69
sha1:0d6f3834561796052451fd603467fab5d22c868b
  1. if [ -z "${BUILD_HOSTNAME}" ]; then
  2. . ./rpi2-settings.sh
  3. fi
  4.  
  5. # Set up hosts
  6. echo ubuntu >${R}/etc/hostname
  7. cat <<EOM >${R}/etc/hosts
  8. 127.0.0.1       localhost
  9. ::1             localhost ip6-localhost ip6-loopback
  10. ff02::1         ip6-allnodes
  11. ff02::2         ip6-allrouters
  12.  
  13. EOM
  14. echo "127.0.1.1       ${BUILD_HOSTNAME}" >> ${R}/etc/hosts
  15.  
  16. # Set up interfaces
  17. cat <<EOM >${R}/etc/network/interfaces
  18. # interfaces(5) file used by ifup(8) and ifdown(8)
  19. # Include files from /etc/network/interfaces.d:
  20. source-directory /etc/network/interfaces.d
  21.  
  22. # The loopback network interface
  23. auto lo
  24. iface lo inet loopback
  25.  
  26. # The primary network interface
  27.  
  28. ## enable for DHCP:
  29. allow-hotplug eth0
  30. iface eth0 inet dhcp
  31.  
  32. ## enable and edit for static konfiguration:
  33. #auto eth0
  34. #iface eth0 inet static
  35. #    address 192.168.1.252
  36. #    netmask 255.255.255.0
  37. #    gateway 192.168.1.1
  38. #    mtu 1492
  39. #    dns-nameservers 192.168.1.2 8.8.8.8
  40. #    dns-search home box
  41.  
  42. EOM
  43.  
  44.  
  45. # Setup Proxy for apt-get
  46. cat <<EOM >${R}/etc/apt/apt.conf.d/40Proxy
  47. #Acquire::http::Proxy "http://192.168.1.50:3142";
  48.  
  49. EOM
  50.  
  51.  
  52. # Set up firmware config
  53. cat <<EOM >${R}/boot/firmware/config.txt
  54. # For more options and information see
  55. # http://www.raspberrypi.org/documentation/configuration/config-txt.md
  56. # Some settings may impact device functionality. See link above for details
  57.  
  58. # uncomment if you get no picture on HDMI for a default "safe" mode
  59. #hdmi_safe=1
  60.  
  61. # uncomment this if your display has a black border of unused pixels visible
  62. # and your display can output without overscan
  63. #disable_overscan=1
  64.  
  65. # uncomment the following to adjust overscan. Use positive numbers if console
  66. # goes off screen, and negative if there is too much border
  67. #overscan_left=16
  68. #overscan_right=16
  69. #overscan_top=16
  70. #overscan_bottom=16
  71.  
  72. # uncomment to force a console size. By default it will be display's size minus
  73. # overscan.
  74. #framebuffer_width=1280
  75. #framebuffer_height=720
  76.  
  77. # uncomment if hdmi display is not detected and composite is being output
  78. #hdmi_force_hotplug=1
  79.  
  80. # uncomment to force a specific HDMI mode (this will force VGA)
  81. #hdmi_group=1
  82. #hdmi_mode=1
  83.  
  84. # uncomment to force a HDMI mode rather than DVI. This can make audio work in
  85. # DMT (computer monitor) modes
  86. #hdmi_drive=2
  87.  
  88. # uncomment to increase signal to HDMI, if you have interference, blanking, or
  89. # no display
  90. #config_hdmi_boost=4
  91.  
  92. # uncomment for composite PAL
  93. #sdtv_mode=2
  94.  
  95. #uncomment to overclock the arm. 700 MHz is the default.
  96. # This (arm_freq=800) will destroy your device if you have not installed heatsink!
  97. #arm_freq=800
  98.  
  99. ## Video "tuning":
  100. #If set to 1, don't show the rainbow splash screen on boot. The default value is 0.
  101. disable_splash=1
  102.  
  103. #128M GPU split (use this for heavy 3D work, possibly also required for some video decoding):
  104. #gpu_mem=128
  105.  
  106. #64M GPU split (this is the default)
  107. #gpu_mem=64
  108.  
  109. # 32M GPU split (use this for Linux only with no 3D or video processing. Its enough for the 1080p framebuffer, but not much else)
  110. #gpu_mem=32
  111.  
  112. #16M GPU split (use this for headless mode only. It is enough to boot the system, but you can not use video at all.)
  113. gpu_mem=16
  114.  
  115. #########################################################
  116. #                                                       #
  117. #                     Overclocking                      #
  118. #                                                       #
  119. #  Beware! You lost all warranties for the raspberry!   #
  120. #                                                       #
  121. #########################################################
  122.  
  123. ### Raspberry 1 ###
  124. #Uncomment to overclock the arm. 700 MHz is the default.
  125.  
  126. #No overclocking (default):
  127. #arm_freq=700
  128. #core_freq=250
  129. #sdram_freq=400
  130. #over_voltage=0
  131.  
  132. ##modest_overclocking
  133. #arm_freq=800
  134. #core_freq=300
  135. #sdram_freq=400
  136. #over_voltage=0
  137.  
  138. ##medium_overclocking:
  139. #arm_freq=900
  140. #core_freq=333
  141. #sdram_freq=450
  142. #over_voltage=2
  143.  
  144. ##high_overclocking:
  145. #arm_freq=950
  146. #core_freq=333
  147. #sdram_freq=450
  148. #over_voltage=6
  149.  
  150. ##devil__overclocking:
  151. #arm_freq=1000
  152. #core_freq=500
  153. #sdram_freq=500
  154. #over_voltage=6
  155.  
  156. ### Raspberry 2 ###
  157. #uncomment to overclock the arm. 900 MHz is the default.
  158. #Beware! You lost all warranties for the raspberry!
  159.  
  160. ##No overclocking (default):
  161. #arm_freq=900
  162. #core_freq=250
  163. #sdram_freq=450
  164. #over_voltage=0
  165.  
  166. ##medium_overclocking:
  167. #boot_delay=1
  168. #arm_freq=1000
  169. #sdram_freq=500
  170. #core_freq=500
  171. #over_voltage=2
  172. #temp_limit=80 #Will throttle to default clock speed if hit.
  173.  
  174. ##devil__overclocking:
  175. ##force_turbo=1 #Voids Warranty!
  176. #boot_delay=1 #helps to avoid sdcard corruption when force_turbo is enabled.
  177. #arm_freq=1100
  178. #sdram_freq=500
  179. #core_freq=500
  180. #over_voltage=2
  181. temp_limit=80 #Will throttle to default clock speed if hit.
  182.  
  183. EOM
  184.  
  185. ln -sf firmware/config.txt ${R}/boot/config.txt
  186.  
  187. echo 'dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait' > ${R}/boot/firmware/cmdline.txt
  188. # else, if you wand to boot from a usb-hd, use this:
  189. # echo 'dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline rootwait' > ${R}/boot/firmware/cmdline.txt
  190.  
  191. ln -sf firmware/cmdline.txt ${R}/boot/cmdline.txt
  192.  
  193.  
  194. # Blacklist platform modules not applicable to the RPi2
  195. cat <<EOM >${R}/etc/modprobe.d/rpi2.conf
  196. blacklist snd_soc_pcm512x_i2c
  197. blacklist snd_soc_pcm512x
  198. blacklist snd_soc_tas5713
  199. blacklist snd_soc_wm8804
  200. EOM
  201.  
  202. # Load sound module on boot
  203. cat <<EOM >${R}/lib/modules-load.d/rpi2.conf
  204. ## Enable snd_bcm2835 if you need sound:
  205. #snd_bcm2835
  206. bcm2708_rng
  207. EOM
  208.  
  209. ## OR:
  210.  
  211. # blacklist sound module on boot (headless_mode)
  212. cat <<EOM >> ${R}/etc/modprobe.d/rpi2.conf
  213. # blacklist sound module on boot (headless_mode)
  214. ## Disable the blacklisting of snd_bcm2835 if you need sound:
  215. blacklist snd_bcm2835
  216. #blacklist bcm2708_rng
  217. EOM
  218.