From d8d8ba5b0f7f790acad28d588cba50dde9cdab31 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 5 Jan 2017 14:12:08 +0000 Subject: [PATCH] Image target for the Beaglebone Black Wireless --- doc/EN/beaglebone.org | 10 +++++----- man/freedombone.1.gz | Bin 5155 -> 5164 bytes src/freedombone-image-customise | 28 ++++++++++++++++++++++++++- src/freedombone-image-hardware-setup | 15 ++++++++++---- src/freedombone-image-make | 13 +++++++++++++ src/freedombone-image-makefile | 11 +++++++++++ src/freedombone-utils-wifi | 21 ++++++++++++-------- website/EN/beaglebone.html | 16 +++++++-------- 8 files changed, 88 insertions(+), 26 deletions(-) diff --git a/doc/EN/beaglebone.org b/doc/EN/beaglebone.org index 555bbf63..54b26977 100644 --- a/doc/EN/beaglebone.org +++ b/doc/EN/beaglebone.org @@ -16,7 +16,7 @@ #+END_EXPORT -The Beaglebone Black is small, cheap, a fully open hardware design, has a hardware random number generator and consumes very little electrical power, making it suitable for all kinds of uses. +The Beaglebone Black is small, cheap, a fully open hardware design, has a hardware random number generator and consumes very little electrical power, making it suitable for all kinds of uses. There is also a wireless version. You can easily use one to run your own internet services from home. @@ -28,7 +28,7 @@ You will need: * A Beaglebone Black. The exact revision of the hardware isn't very important, but it should have an ethernet socket. * Optionally a plastic or metal case to protect the electronics. - * An ethernet cable. Typically these are colour coded either blue or yellow. Either colour will do. + * An ethernet cable. Typically these are colour coded either blue or yellow. Either colour will do. If you're using the Wireless version of the Beaglebone Black then you don't need this. * Either a 5v power supply with 5.5mm barrel plug, or a miniUSB type B cable (typically supplied with the Beaglebone) and USB to mains adaptor. * A microSD card at least 8 gigabytes in size. In tests Sandisk class 10 works well. Prefer smaller but faster I/O rating to larger but slower. * A microSD card adaptor for your laptop or desktop system, so that you can copy the disk image to the card. @@ -73,8 +73,6 @@ freedombone-image -t beaglebone --onion yes Onion addresses have the advantage of being difficult to censor and you don't need to buy a domain or have a dynamic DNS account. An onion based system also means you don't need to think about NAT traversal type issues. -Connect the power and ethernet cable and plug it into your internet router. - #+BEGIN_CENTER [[file:images/bbb_back.jpg]] #+END_CENTER @@ -85,8 +83,10 @@ Now follow the [[./homeserver.html][instructions given here to copy the image to [[file:images/bbb_front.jpg]] #+END_CENTER +Connect the power and for the non-wireless versions of the Beaglebone Black also connect the ethernet cable and plug it into your internet router. + Now power cycle by removing the power plug and then inserting it again. It should boot from the microSD drive and you should see the blue LEDs on the board flashing. If they don't fash at all for a few minutes then try copying the image to the microSD card again. -Follow the rest of the [[./homeserver.html][instructions given here]] to log in via ssh and install the system. The microSD drive /should remain inside the Beaglebone/ and not be removed. This will be its main drive, with the internal EMMC not being used at all. +Follow the rest of the [[./homeserver.html][instructions given here]] to log in via ssh and install the system. The microSD drive /should remain inside the Beaglebone/ and not be removed. This will be its main drive, with the internal EMMC not being used at all. For the Beaglebone Black Wireless ssh back in on the usual 192.168.7.2 address with the USB cable connected so that your wifi login parameters can be set. There are many apps available within the Freedombone system and trying to install them all is probably not a good idea, since this hardware is very resource constrained on CPU and especially on RAM. If the system seems to be becoming unstable and crashing then the most likely cause is running out of RAM, in which case you can try uninstalling some apps. It is possible to monitor RAM usage by logging in with ssh, exiting to the command line and then running the /top/ command. diff --git a/man/freedombone.1.gz b/man/freedombone.1.gz index 6288bd1ad30ec5d297474f300f40fe68bc81bbc4..c7cadaba155287d28957ba18e7db6d1dabb9e3b6 100644 GIT binary patch delta 2603 zcmV+`3e@$ZD6A+4ABzY8XHjmk2mc9wQH1;IQ!Z{j>VQ}6_8%C0)yt^yjg)>m=v8L~ z#~a_cgvj4UWeV8@P+mlP1sfszYo`c_?-a{6oqn3^rp(tkb9`(j;(}(f)5WQ zjip}uNJu<`z^IYjL1`Zlf{Y__nj?JMA77uVV)kRa9pKK7zFhbVg{He7XK+$Y8C#Nk zC95FoM`Pj{d)O$K8)Lpj>JT7*luG1N{UuTKqCryWSAK=1LOw11y5y>23T4P?#_9+X z^O;gSHKUdzXV$cX(g3n+HLrOz&Q8pL`GVrgMO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ppKV)l2wO%MMW`d1Hk+GQuLBZ(mUATN%j>xo+)pHD6()9aHfdTn(5=|oL`#b4)J^u9pn^x(j5Y)r>& zS`S4kN;DhxbkV@~5tyJT&Z5`BKw`WY9l_SZug5<@ld3AU}@LA3ej^EHZj8 zUYUkpu+ihzx&?A+duw}tv3OYBCN{*kxs}hg`6Y>^5{Qq<#8ZMXazyfkoDUyNZ`rY> $rootdir/etc/network/interfaces + echo 'iface lo inet loopback' >> $rootdir/etc/network/interfaces + echo '' >> $rootdir/etc/network/interfaces + echo 'iface usb0 inet static' >> $rootdir/etc/network/interfaces + echo ' address 192.168.7.2' >> $rootdir/etc/network/interfaces + echo ' netmask 255.255.255.252' >> $rootdir/etc/network/interfaces + echo ' network 192.168.7.0' >> $rootdir/etc/network/interfaces + echo ' gateway 192.168.7.1' >> $rootdir/etc/network/interfaces + return + fi + if [[ $DEBIAN_INSTALL_ONLY != "no" ]]; then return fi @@ -459,6 +473,10 @@ continue_installation() { } atheros_wifi() { + if [[ "$MACHINE" == "beaglebonewifi" ]]; then + return + fi + firmware_filename="open-ath9k-htc-firmware_1.3-1_all.deb" firmware_hash='5fea58ffefdf0ef15b504db7fbe3bc078c03e0d927bba64085e4b6f2546102f5' @@ -1036,11 +1054,12 @@ rm $rootdir/usr/sbin/policy-rc.d # Set up HRNG for systems known to have one # Otherwise install haveged -if [[ "$MACHINE" != "beaglebone" ]]; then +if [[ "$MACHINE" != "beaglebone"* ]]; then chroot $rootdir apt-get -yq install haveged else chroot $rootdir apt-get -yq install rng-tools sed -i 's|#HRNGDEVICE=/dev/hwrng|HRNGDEVICE=/dev/hwrng|g' $rootdir/etc/default/rng-tools + fi # copy u-boot to beginning of image @@ -1051,6 +1070,13 @@ case "$MACHINE" in dd if=$rootdir/usr/lib/u-boot/am335x_boneblack/u-boot.img of="$image" \ count=2 seek=1 conv=notrunc bs=384k ;; + beaglebonewifi) + touch $rootdir/root/.wifi-only + dd if=$rootdir/usr/lib/u-boot/am335x_boneblack/MLO of="$image" \ + count=1 seek=1 conv=notrunc bs=128k + dd if=$rootdir/usr/lib/u-boot/am335x_boneblack/u-boot.img of="$image" \ + count=2 seek=1 conv=notrunc bs=384k + ;; cubieboard2) dd if=$rootdir/usr/lib/u-boot/Cubieboard2/u-boot-sunxi-with-spl.bin of="$image" \ seek=8 conv=notrunc bs=1k diff --git a/src/freedombone-image-hardware-setup b/src/freedombone-image-hardware-setup index 14347140..de098a43 100755 --- a/src/freedombone-image-hardware-setup +++ b/src/freedombone-image-hardware-setup @@ -190,12 +190,19 @@ EOF echo "rtc_sunxi" >> /etc/initramfs-tools/modules } +function generic_beaglebone_steup { + beaglebone_setup_boot + beaglebone_flash + beaglebone_repack_kernel + enable_serial_console ttyO0 +} + case "$MACHINE" in beaglebone) - beaglebone_setup_boot - beaglebone_flash - beaglebone_repack_kernel - enable_serial_console ttyO0 + generic_beaglebone_steup + ;; + beaglebonewifi) + generic_beaglebone_steup ;; cubietruck) a20_setup_boot sun7i-a20-cubietruck.dtb diff --git a/src/freedombone-image-make b/src/freedombone-image-make index 5ba5fe77..9e165ff4 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -115,6 +115,19 @@ case "$MACHINE" in --no-extlinux \ --foreign /usr/bin/qemu-arm-static \ --roottype btrfs \ +" + ;; + beaglebonewifi) + extra_pkgs="$beaglebone_pkgs" + extra_opts="\ + --variant minbase \ + --bootoffset=2mib \ + --bootsize 128M \ + --boottype ext2 \ + --no-kernel \ + --no-extlinux \ + --foreign /usr/bin/qemu-arm-static \ + --roottype btrfs \ " ;; cubietruck | a20-olinuxino-lime | a20-olinuxino-lime2 | a20-olinuxino-micro | cubieboard2) diff --git a/src/freedombone-image-makefile b/src/freedombone-image-makefile index 7239304b..fe9a5634 100755 --- a/src/freedombone-image-makefile +++ b/src/freedombone-image-makefile @@ -97,6 +97,17 @@ beaglebone: prep $(SIGN) @echo "Build complete." +# build Beaglebone Black Wireless SD card image +beaglebonewifi: prep + $(eval ARCHITECTURE = armhf) + $(eval MACHINE = beaglebonewifi) + $(MAKE_IMAGE) + @rm -f $(ARCHIVE) + $(XZ) $(IMAGE) + @echo "" + $(SIGN) + @echo "Build complete." + # build Cubieboard2 SD card image cubieboard2: prep $(eval ARCHITECTURE = armhf) diff --git a/src/freedombone-utils-wifi b/src/freedombone-utils-wifi index 086d0c3a..44973925 100755 --- a/src/freedombone-utils-wifi +++ b/src/freedombone-utils-wifi @@ -482,6 +482,7 @@ function create_networks_interactive { wifi_ctr=0 wifi_networks_done= + wifi_settings_defined= while [ ! $wifi_networks_done ] do data=$(tempfile 2>/dev/null) @@ -502,14 +503,18 @@ function create_networks_interactive { WIFI_TYPE=$(cat $data | sed -n 2p) WIFI_PASSPHRASE=$(cat $data | sed -n 3p) - # if these fields are empty then there are no more wifi networks - if [ ${#WIFI_SSID} -lt 2 ]; then - wifi_networks_done='yes' - continue - fi - if [ ${#WIFI_TYPE} -lt 2 ]; then - wifi_networks_done='yes' - continue + # If the wifi-only indicator is present then wifi details must + # be specified, otherwise they're optional + if [ ! -f /root/.wifi-only ]; then + # if these fields are empty then there are no more wifi networks + if [ ${#WIFI_SSID} -lt 2 ]; then + wifi_networks_done='yes' + continue + fi + if [ ${#WIFI_TYPE} -lt 2 ]; then + wifi_networks_done='yes' + continue + fi fi if [ ! -f $WIFI_NETWORKS_FILE ]; then diff --git a/website/EN/beaglebone.html b/website/EN/beaglebone.html index 427d8a85..f81eab6c 100644 --- a/website/EN/beaglebone.html +++ b/website/EN/beaglebone.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -248,7 +248,7 @@ for the JavaScript code in this tag.

-The Beaglebone Black is small, cheap, a fully open hardware design, has a hardware random number generator and consumes very little electrical power, making it suitable for all kinds of uses. +The Beaglebone Black is small, cheap, a fully open hardware design, has a hardware random number generator and consumes very little electrical power, making it suitable for all kinds of uses. There is also a wireless version.

@@ -270,7 +270,7 @@ You will need: