]> git.plutz.net Git - rpi_small/commitdiff
generalize setup
authorPaul Hänsch <paul@plutz.net>
Mon, 4 Mar 2019 22:14:31 +0000 (23:14 +0100)
committerPaul Hänsch <paul@plutz.net>
Mon, 4 Mar 2019 22:14:31 +0000 (23:14 +0100)
16 files changed:
.gitmodules
Makefile
README.md [deleted file]
files/boot/config.txt
files/etc/default/nodm
files/etc/dnsmasq.conf [deleted file]
files/etc/hostname
files/etc/network/interfaces.d/btnap [deleted file]
files/etc/rc.local [deleted file]
gummikraken [deleted submodule]
gummikraken.mk [deleted file]
sensors/hatch.sh [deleted file]
sensors/sensor_temp.sh [deleted file]
teesock [deleted submodule]
teesock.mk [deleted file]
wifi.tmpl

index 4849930de349d36889153d9da6cadae549cb40fe..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,6 +0,0 @@
-[submodule "gummikraken"]
-       path = gummikraken
-       url = https://git.tools.f4.htw-berlin.de/phaensch/gummikraken.git
-[submodule "teesock"]
-       path = teesock
-       url = https://git.tools.f4.htw-berlin.de/phaensch/teesock.git
index 72176cfa4ee1de7eadf3eef88267d7c929bde9b7..26126d6a02923fe1366a7c9e4b6564076bd0f18e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ deb   http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi\
 deb    http://archive.raspberrypi.org/debian stretch main\n
 endef
 
 deb    http://archive.raspberrypi.org/debian stretch main\n
 endef
 
-PACKAGES := apt bluez bluez-firmware bluez-tools bridge-utils btrfs-tools busybox-static bzip2 ca-certificates cron deborphan dnsmasq firmware-brcm80211 firmware-linux-free firmware-misc-nonfree gzip htop ifupdown init iptables iputils-ping irqbalance isc-dhcp-client less libraspberrypi-bin libraspberrypi0 make net-tools nmap ntpdate openbsd-inetd openssh-client openssh-server pi-bluetooth rpi-update rsync ssh sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip xserver-xorg-video-fbturbo xserver-xorg nodm chromium-browser
+PACKAGES := apt bluez bluez-firmware bluez-tools btrfs-tools busybox-static bzip2 ca-certificates cron deborphan firmware-brcm80211 firmware-linux-free firmware-misc-nonfree gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less libraspberrypi-bin libraspberrypi0 make net-tools nmap ntpdate openssh-client openssh-server pi-bluetooth rpi-update rsync ssh sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip xserver-xorg-video-fbturbo xserver-xorg nodm xfce4 xvkbd xfce4-terminal
 
 # Do not change, only override in config.mk
 WIFI-SSID = 
 
 # Do not change, only override in config.mk
 WIFI-SSID = 
@@ -74,8 +74,6 @@ files/root/.ssh/authorized_keys: id_rsa.pub
        chmod 700 files/root/ files/root/.ssh/
        chmod 600 '$@'
 
        chmod 700 files/root/ files/root/.ssh/
        chmod 600 '$@'
 
-# include gummikraken.mk
-# include teesock.mk
 include *.mk
 
 raspi.img: raspi_root/ files/ partitions files/root/.ssh/authorized_keys files/etc/network/interfaces.d/wifi
 include *.mk
 
 raspi.img: raspi_root/ files/ partitions files/root/.ssh/authorized_keys files/etc/network/interfaces.d/wifi
diff --git a/README.md b/README.md
deleted file mode 100644 (file)
index bc9bb95..0000000
--- a/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# Oktopus Boot
-
-Generator for Oktopus boot media.
-
-## Purpose
-The Oktopus sensor computer displays data on devices connected via Bluetooth. To enable this it opens a Bluetooth network access point. This AP allows connections by any device. To enable IP connectivity a DHCP server will be started on Oktopus. Oktopus identifies itself as an internet gateway to connecting devices. All attempts by those clients to connect to any websites will be directed to the local sensor display. This is enabled by a "fake" DNS server running on Oktopus, which resolves all domain names to the sensor computer itself.
-
-In order to provide the necessary combination of Bluetooth, DHCP, and DNS settings, we provide a custom operating system image. This git repository contains the scripts and configuration files to assemble this image.
-
-## Requirements and Compatibility:
-The build system must support Linux style loopback devices. The script as it is will only run on Linux OSes, and it strictly requires the `losetup` utility from the GNU userland package. In addition the main script is a GNU style makefile. This software will _not_ work on BSD or Mac OS X, without modification. It will also not work on `busybox` based Linux OSes.
-
-The Raspberry environment is configured via ARM CPU emulation using qemu. A static qemu binary for ARM emulation must be provided, as well as the accompanying binfmt support in the kernel.
-
-Required Programs are:
- * a Linux Kernel with loop support (almost always available)
- * `make` (GNU flavour)
- * `losetup` (GNU flavour)
- * `qemu-arm-static` (e.g. from the `qemu-user-static` Debian package)
- *  a C compiler for the ARM platform (i.e. `gcc-arm-linux-gnueabi`, see submodule `teesock`)
- * `mkfs.ext4`
- * `mkfs.fat`
- * `sfdisk`
- * `debootstrap`
- * `ssh-keygen` (optional)
-
-`debootstrap` is available in all Debian derivatives, including Ubuntu. It can be installed in some Non-Debian distributions as well.
-
-## Usage
-The script must be run as root. The target is `raspi.img`. I.e. you should run (as root):
-
-    make raspi.img
-
-The resulting `raspi.img` file can be written to an SD-Card using `dd`. And a Raspberry Pi can be booted from this SD-Card.
-
-Some configuration options can be set in `config.mk`. See `config.example` as a template, but do not edit `config.example`directly, as it is tracked by git.
-`config.mk` is particularly useful to set up an APT-Proxy, and to set up Wifi credentials. If Wifi credentials are set up, the Oktopus computer will attempt to connect to the specified wireless network to provide SSH access. Network configuration on the Wifi network is derived via DHCP, the Oktopus DHCP server will not interfere with the wifi network.
-
-## Log in on the Sensor Computer
-Oktopus provides only a root login using SSH key authentication. There is no user account, no `sudo`, and no password login. You can provide an SSH public key before staring the build, which can later be used for the root login. In order to do this you just need to copy your public key to `id_rsa.pub` in the root folder of this repository. Note that even EC, or DSA keys should be named `id_rsa.pub`.
-If you do not provide your own SSH key, the build script will conveniently generate one. You can then later login to Oktopus, by typing:
-
-    ssh -i id_rsa root@oktopus
-
-## Function outline
-
-### OS Image
-The Makefile uses `debootstrap` to set up a Raspbian environment. Package signatures will be verified. Operations within the Raspbian environment are performed using `qemu`. Thus building on a x86 host platform is possible. The environment is then copied to an image file using loopback mounting. The `files` directory contains an overlay of Raspbian config files, which are copied into the image file at this stage. Since this happens at _image_ creation, the debootstrapped root _directory_ is modified as little as possible. 
-
-The list of raspbian packages which are installed in the chroot environmant can be extended in `config.mk`.
-
-### Bluetooth and Wifi Networking
-DHCP and DNS services on Oktopus are provided by `dnsmasq`. Bluetooth networking is provided by the regular Linux Bluetooth stack using hci, bridge, and ip/ifup utilities. All attempts to connect to the Bluetooth network ap are trusted automatically, this is facilitated by a shell loop in (`files/`)`etc/rc.local` (autotrust is not otherwise provided by the Bluetooth stack).
-As a matter of convenience during testing and debugging the sensor computer can also join an existing Wifi network. Wifi credentials can be provided in `config.mk`. Because Oktopus will not provide DHCP and DNS on Wifi, the name resolution for Oktopus services will not work on Wifi and the sensor webapp may not be usable. Only Bluetooth networking is intended for this kind of operation.
-
-### Sensor readout and Webapp
-
-> The sensor application is currently under development. The `gummikraken` submodule provides virtual sensors with simulation data. Gummikraken will be gradually replaced by working sensor drivers.
-
-> The display application (oktopus_frontend) is developed as a separate project. See its respective repository for a detailed documentation.
-
-Also see git submodules:
-  * gummikraken (to be removed)
-  * teesock
-  * gummikraken/oktopus_frontend (submodule to be moved to the main repo)
-
-The sensor application resides under `/srv/` in the generated system image. Each sensor is read periodically by a distinct program. Each sensor program provides sensor readout on stdout in a short time interval of its own choosing. All sensor programs are launched in parallel by `hatch.sh`. The sensor data is accumulated and provided on a Unix socket (`/tmp/oktopus.sock`) by the program `teesock`. Each connection to this socket will yield a copy of the current sensor stream.
-
-The display application is served over HTTP by the busybox httpd, which is launched from inetd. The display reads the sensor data as an HTTP Event Stream from port 8200 (Okt-Two-pus ;-). The Event Stream is generated from the sensor stream on the aforementioned Unix socket. Conversion of the seonsor readout to the HTTP Event Stream format is done by `tentacles.sh`, which is also launched via inetd.
-
-## ToDo
- * include the sensor driver and utilities (so far: temperature, ...)
- * ~~include the display application~~ (done)
- * ~~provide the display application via web server~~ (done)
- * possibly counter DNS rebind protection by identifying as gateway and redirect via `iptables` (may not be necessary)
-
-## Legal
-This program was originally developed on behalf of the Hochschule für Technik und Wirtschaft Berlin. The program is licensed under the GNU Affero General Public License. See LICENSE.TXT for details.
index 53d5a7bbaab71581c3cac279af35a6334bf24f49..f829476855c3161a85018efdbd1af648ebd8c4ab 100644 (file)
@@ -4,4 +4,5 @@
 # see config.example for the Oktopus build config
 
 dtparam=audio=on
 # see config.example for the Oktopus build config
 
 dtparam=audio=on
-dtoverlay=w1-gpio
+# dtoverlay=w1-gpio
+hfmi_safe=1
index f1662664099e8c715c2d32f6030cdb6a8580ecc0..504f4b60c466f0d2b89c78fcd98d2752af632c2e 100644 (file)
@@ -10,8 +10,7 @@ NODM_USER=local
 NODM_FIRST_VT=7
 
 # X session
 NODM_FIRST_VT=7
 
 # X session
-#NODM_XSESSION=/etc/X11/Xsession
-NODM_XSESSION=/usr/bin/chromium-browser --app=http://localhost/
+NODM_XSESSION=/etc/X11/Xsession
 
 # Options for nodm itself
 NODM_OPTIONS=
 
 # Options for nodm itself
 NODM_OPTIONS=
diff --git a/files/etc/dnsmasq.conf b/files/etc/dnsmasq.conf
deleted file mode 100644 (file)
index 38b9bbb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-listen-address=192.168.82.1
-bind-interfaces
-
-dhcp-authoritative
-dhcp-range=192.168.82.16,192.168.82.254,48h
-
-address=/#/192.168.82.1
index 09277c915a979a307fab1b718f6695dd72ad7bbd..efe3def60cbdb0c6b4b6714f43128c6404687e14 100644 (file)
@@ -1 +1 @@
-Oktopus
+rpismall
diff --git a/files/etc/network/interfaces.d/btnap b/files/etc/network/interfaces.d/btnap
deleted file mode 100644 (file)
index 000716f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-auto br0
-iface br0 inet static
-       address 192.168.82.1
-       netmask 255.255.255.0
-       bridge_ports    none
-       bridge_fd       5
-       bridge_stp      no
diff --git a/files/etc/rc.local b/files/etc/rc.local
deleted file mode 100755 (executable)
index 05ff1c3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-modprobe w1-gpio pullup=1
-modprobe w1-therm
-
-bt-network -s nap br0 &
-hciconfig hci0 up
-hciconfig hci0 sspmode 1
-hciconfig hci0 piscan
-
-while sleep 5; do
-  bt-device -l \
-  | grep -oE '[0-9A-F:]{17}' \
-  | while read mac; do
-    bt-device --set "$mac" Trusted 1
-  done
-done &
-
-/srv/gummikraken/hatch.sh &
diff --git a/gummikraken b/gummikraken
deleted file mode 160000 (submodule)
index 0bedab2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 0bedab200a6c2b0018bae205cf7678060008f111
diff --git a/gummikraken.mk b/gummikraken.mk
deleted file mode 100644 (file)
index 0acc1e0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-files/srv/gummikraken/: gummikraken/ sensors/ .FORCE
-       mkdir -p "$@"
-       cp -av "$</." sensors/. "$@/."
-       chmod a+rX -R "$@"
-       cp gummikraken/inetd.conf files/etc/inetd.conf
-       sed -ri 's;http://[0-9\.]+:8200;http://oktopus:8200;g' "$@/oktopus_frontend/dist/bundle.js"
-
-raspi.img: files/srv/gummikraken/
diff --git a/sensors/hatch.sh b/sensors/hatch.sh
deleted file mode 100755 (executable)
index 6cf7560..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-sock=/tmp/oktopus.sock
-
-rm "$sock"
-
-( cd "${0%/*}/"
-  for n in ./sensor_*.sh; do
-    $n &
-  done
-  for n in ekg pulse oxygen heartrate systole diastole; do
-    ./gummikraken.sh ./gummikraken.data $n &
-  done
-) | teesock "$sock" &
-
-for n in 1 2 3 4 5 6 7 8 9 0; do [ ! -S "$sock" ] && sleep 1; done
-chmod a+rw "$sock"
diff --git a/sensors/sensor_temp.sh b/sensors/sensor_temp.sh
deleted file mode 100755 (executable)
index b78e05f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-while sleep 1; do
-  sed -nr 's;^.*t=([0-9]{3})[0-9]{2};temperature \1;p' /sys/bus/w1/devices/28-*/w1_slave
-done
diff --git a/teesock b/teesock
deleted file mode 160000 (submodule)
index 7f2916d..0000000
--- a/teesock
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 7f2916d1960ad00d156f1d354f9402def32c0848
diff --git a/teesock.mk b/teesock.mk
deleted file mode 100644 (file)
index f3165c1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-teesock/teesock.arm: teesock/teesock.c teesock/Makefile
-       make -C "$(dir $@)" "$(notdir $@)"
-       chmod 755 "$@"
-
-files/usr/local/bin/teesock: teesock/teesock.arm
-       mkdir -p files/usr/local/bin
-       chmod 755 files/usr/ files/usr/local/ files/usr/local/bin/
-       cp -av "$<" "$@"
-
-raspi.img: files/usr/local/bin/teesock
index ec196f36c7a95f86dfc4dceccd83027d86bb2d1e..d9cac5da0cb40ad273f6a58e93a83faa0366ed72 100644 (file)
--- a/wifi.tmpl
+++ b/wifi.tmpl
@@ -4,4 +4,3 @@ allow-hotplug wlan0
 iface wlan0 inet dhcp
        wpa-ssid        "#WIFI-SSID#"
        wpa-psk         "#WIFI-PASS#"
 iface wlan0 inet dhcp
        wpa-ssid        "#WIFI-SSID#"
        wpa-psk         "#WIFI-PASS#"
-       hostname        "Oktopus"