From c328be44123babf1b5f1226a149b8555694ad26c Mon Sep 17 00:00:00 2001 From: Lorenz Cuno Klopfenstein Date: Tue, 24 Sep 2019 12:27:36 +0200 Subject: [PATCH 01/10] Grammar check --- sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/voice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/voice.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/voice.py index c92be18..714d315 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/voice.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/voice.py @@ -35,7 +35,7 @@ def on_bored(): def on_motivated(reward): - return 'This is best day\nof my life!' + return 'This is the best\nday of my life!' def on_demotivated(reward): From 83aef1fc757a54610c252adfa204df277cc607db Mon Sep 17 00:00:00 2001 From: evilsocket Date: Tue, 24 Sep 2019 15:46:33 +0200 Subject: [PATCH 02/10] added monstart and monstop scripts --- sdcard/rootfs/usr/bin/monstart | 2 ++ sdcard/rootfs/usr/bin/monstop | 2 ++ 2 files changed, 4 insertions(+) create mode 100755 sdcard/rootfs/usr/bin/monstart create mode 100755 sdcard/rootfs/usr/bin/monstop diff --git a/sdcard/rootfs/usr/bin/monstart b/sdcard/rootfs/usr/bin/monstart new file mode 100755 index 0000000..112c65e --- /dev/null +++ b/sdcard/rootfs/usr/bin/monstart @@ -0,0 +1,2 @@ +#!/bin/bash +iw phy phy0 interface add mon0 type monitor && ifconfig mon0 up diff --git a/sdcard/rootfs/usr/bin/monstop b/sdcard/rootfs/usr/bin/monstop new file mode 100755 index 0000000..8ca7f89 --- /dev/null +++ b/sdcard/rootfs/usr/bin/monstop @@ -0,0 +1,2 @@ +#!/bin/bash +ifconfig mon0 down && iw dev mon0 del From fb3ddfe2ceafd54b2383e80e015782d5f4ba4551 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Tue, 24 Sep 2019 15:50:27 +0200 Subject: [PATCH 03/10] scripts folder --- README.md | 6 +++++- create_sibling.sh => scripts/create_sibling.sh | 0 scripts/linux_connection_share.sh | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) rename create_sibling.sh => scripts/create_sibling.sh (100%) create mode 100755 scripts/linux_connection_share.sh diff --git a/README.md b/README.md index 6936837..7493613 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ For hackers to learn reinforcement learning, WiFi networking and have an excuse #### Automatically create an image -You can use the `create_sibling.sh` script to create an - ready to flash - rasbian image with pwnagotchi. +You can use the `scripts/create_sibling.sh` script to create an - ready to flash - rasbian image with pwnagotchi. ```shell usage: ./create_sibling.sh [OPTIONS] @@ -56,6 +56,10 @@ usage: ./create_sibling.sh [OPTIONS] -h # Show this help ``` +#### Host Connection Share + +If you connect to the unit via `usb0` (thus using the data port), you might want to use the `scripts/linux_connection_share.sh` script to bring the interface up on your end and share internet connectivity from another interface, so you can update the unit and generally download things from the internet on it. + ### UI The UI is available either via display if installed, or via http://10.0.0.2:8080/ if you connect to the unit via `usb0` and set a static address on the network interface. diff --git a/create_sibling.sh b/scripts/create_sibling.sh similarity index 100% rename from create_sibling.sh rename to scripts/create_sibling.sh diff --git a/scripts/linux_connection_share.sh b/scripts/linux_connection_share.sh new file mode 100755 index 0000000..e8e94dd --- /dev/null +++ b/scripts/linux_connection_share.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# name of the ethernet gadget interface on the host +USB_IFACE=${1:-enp0s20f0u1} +USB_IFACE_IP=10.0.0.1 +USB_IFACE_NET=10.0.0.0/24 +# host interface to use for upstream connection +UPSTREAM_IFACE=${2:-enxe4b97aa99867} + +ip addr add $USB_IFACE_IP/24 dev $USB_IFACE +ifconfig $USB_IFACE up + +iptables -A FORWARD -o $UPSTREAM_IFACE -i $USB_IFACE -s $USB_IFACE_NET -m conntrack --ctstate NEW -j ACCEPT +iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT +iptables -t nat -F POSTROUTING +iptables -t nat -A POSTROUTING -o $UPSTREAM_IFACE -j MASQUERADE + +echo 1 > /proc/sys/net/ipv4/ip_forward From 5bac6ba5c0ee2a8f5df455ffc2c3b653e33b7e8c Mon Sep 17 00:00:00 2001 From: evilsocket Date: Tue, 24 Sep 2019 15:54:41 +0200 Subject: [PATCH 04/10] misc: small fix or general refactoring i did not bother commenting --- README.md | 27 ++------------------------- scripts/create_sibling.sh | 6 +++--- scripts/linux_connection_share.sh | 2 +- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 7493613..5494b88 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,10 @@ For hackers to learn reinforcement learning, WiFi networking and have an excuse You can use the `scripts/create_sibling.sh` script to create an - ready to flash - rasbian image with pwnagotchi. ```shell -usage: ./create_sibling.sh [OPTIONS] +usage: ./scripts/create_sibling.sh [OPTIONS] Options: - -n # Name of the pwnagotchi (default: alpha) + -n # Name of the pwnagotchi (default: pwnagotchi) -o # Name of the img-file (default: pwnagotchi.img) -s # Size which should be added to second partition (in Gigabyte) (default: 4) -p # Only run provisioning (assumes the image is already mounted) @@ -81,29 +81,6 @@ The UI is available either via display if installed, or via http://10.0.0.2:8080 - if connected to a laptop via usb data port, with internet connectivity shared, magic things will happen. - checkout the `ui.video` section of the `config.yml` - if you don't want to use a display, you can connect to it with the browser and a cable. -Magic scripts that makes it talk to the internet: - -```sh -#!/bin/bash - -# name of the ethernet gadget interface on the host -USB_IFACE=${1:-enp0s20f0u1} -USB_IFACE_IP=10.0.0.1 -USB_IFACE_NET=10.0.0.0/24 -# host interface to use for upstream connection -UPSTREAM_IFACE=enxe4b97aa99867 - -ip addr add $USB_IFACE_IP/24 dev $USB_IFACE -ip link set $USB_IFACE up - -iptables -A FORWARD -o $UPSTREAM_IFACE -i $USB_IFACE -s $USB_IFACE_NET -m conntrack --ctstate NEW -j ACCEPT -iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT -iptables -t nat -F POSTROUTING -iptables -t nat -A POSTROUTING -o $UPSTREAM_IFACE -j MASQUERADE - -echo 1 > /proc/sys/net/ipv4/ip_forward -``` - ## License `pwnagotchi` is made with ♥ by [@evilsocket](https://twitter.com/evilsocket) and it's released under the GPL3 license. diff --git a/scripts/create_sibling.sh b/scripts/create_sibling.sh index d0e29dd..16b9257 100755 --- a/scripts/create_sibling.sh +++ b/scripts/create_sibling.sh @@ -5,7 +5,7 @@ REQUIREMENTS=( wget gunzip git dd e2fsck resize2fs parted losetup qemu-system-x86_64 ) SCRIPT_DIR="$(dirname "$(realpath "$0")")" -PWNI_NAME="alpha" +PWNI_NAME="pwnagotchi" PWNI_OUTPUT="pwnagotchi.img" PWNI_SIZE="4" @@ -96,7 +96,7 @@ function provision_raspbian() { # configure pwnagotchi echo -e "$PWNI_NAME" > /etc/hostname sed -i "s@^127\.0\.0\.1 .*@127.0.0.1 localhost "$PWNI_NAME" "$PWNI_NAME".local@g" /etc/hosts - sed -i "s@alpha@$PWNI_NAME@g" /etc/motd + sed -i "s@pwnagotchi@$PWNI_NAME@g" /etc/motd chmod +x /etc/rc.local @@ -157,7 +157,7 @@ function usage() { usage: $0 [OPTIONS] Options: - -n # Name of the pwnagotchi (default: alpha) + -n # Name of the pwnagotchi (default: pwnagotchi) -o # Name of the img-file (default: pwnagotchi.img) -s # Size which should be added to second partition (in Gigabyte) (default: 4) -p # Only run provisioning (assumes the image is already mounted) diff --git a/scripts/linux_connection_share.sh b/scripts/linux_connection_share.sh index e8e94dd..57fe718 100755 --- a/scripts/linux_connection_share.sh +++ b/scripts/linux_connection_share.sh @@ -8,7 +8,7 @@ USB_IFACE_NET=10.0.0.0/24 UPSTREAM_IFACE=${2:-enxe4b97aa99867} ip addr add $USB_IFACE_IP/24 dev $USB_IFACE -ifconfig $USB_IFACE up +ip link set $USB_IFACE up iptables -A FORWARD -o $UPSTREAM_IFACE -i $USB_IFACE -s $USB_IFACE_NET -m conntrack --ctstate NEW -j ACCEPT iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT From c76c85b8615ca0f4288226469e5705259af2737c Mon Sep 17 00:00:00 2001 From: dadav <33197631+dadav@users.noreply.github.com> Date: Tue, 24 Sep 2019 21:23:56 +0200 Subject: [PATCH 05/10] Script improvement and bugfixes --- .gitignore | 1 - scripts/create_sibling.sh | 78 ++++++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 393fe2b..1ed1207 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,3 @@ _utils config.laptop.yml .idea tmp -mnt diff --git a/scripts/create_sibling.sh b/scripts/create_sibling.sh index 16b9257..5d7aaa7 100755 --- a/scripts/create_sibling.sh +++ b/scripts/create_sibling.sh @@ -2,8 +2,12 @@ # based on: https://wiki.debian.org/RaspberryPi/qemu-user-static ## and https://z4ziggy.wordpress.com/2015/05/04/from-bochs-to-chroot/ +set -eu + REQUIREMENTS=( wget gunzip git dd e2fsck resize2fs parted losetup qemu-system-x86_64 ) -SCRIPT_DIR="$(dirname "$(realpath "$0")")" +REPO_DIR="$(dirname "$(dirname "$(realpath "$0")")")" +TMP_DIR="${REPO_DIR}/tmp" +MNT_DIR="${TMP_DIR}/mnt" PWNI_NAME="pwnagotchi" PWNI_OUTPUT="pwnagotchi.img" @@ -12,6 +16,11 @@ PWNI_SIZE="4" OPT_PROVISION_ONLY=0 OPT_CHECK_DEPS_ONLY=0 +if [[ "$EUID" -ne 0 ]]; then + echo "Run this script as root!" + exit 1 +fi + function check_dependencies() { echo "[+] Checking dependencies" for REQ in "${REQUIREMENTS[@]}"; do @@ -27,55 +36,56 @@ function check_dependencies() { fi if ! systemctl is-active systemd-binfmt.service >/dev/null 2>&1; then - sudo mkdir -p "/lib/binfmt.d" - sudo sh -c "echo ':qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:F' >> /lib/binfmt.d/qemu-arm-static.conf" - sudo systemctl restart systemd-binfmt.service + mkdir -p "/lib/binfmt.d" + echo ':qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:F' > /lib/binfmt.d/qemu-arm-static.conf + systemctl restart systemd-binfmt.service fi } function get_raspbian() { echo "[+] Downloading raspbian.zip" - mkdir -p "${SCRIPT_DIR}/tmp/" - wget -qcN -O "${SCRIPT_DIR}/tmp/rasbian.zip" "https://downloads.raspberrypi.org/raspbian_lite_latest" + mkdir -p "${TMP_DIR}" + wget --show-progress -qcO "${TMP_DIR}/raspbian.zip" "https://downloads.raspberrypi.org/raspbian_lite_latest" echo "[+] Unpacking raspbian.zip to raspbian.img" - gunzip -c "${SCRIPT_DIR}/tmp/rasbian.zip" > "${SCRIPT_DIR}/tmp/raspbian.img" + gunzip -c "${TMP_DIR}/raspbian.zip" > "${TMP_DIR}/raspbian.img" } function setup_raspbian(){ echo "[+] Resize image" - dd if=/dev/zero bs=1G count="$PWNI_SIZE" >> "${SCRIPT_DIR}/tmp/raspbian.img" + dd if=/dev/zero bs=1G count="$PWNI_SIZE" >> "${TMP_DIR}/raspbian.img" echo "[+] Setup loop device" - mkdir -p "${SCRIPT_DIR}/mnt" - LOOP_PATH="$(sudo losetup --find --partscan --show "${SCRIPT_DIR}/tmp/raspbian.img")" - PART2_START="$(sudo parted -s "$LOOP_PATH" -- print | awk '$1==2{ print $2 }')" - sudo parted -s "$LOOP_PATH" rm 2 - sudo parted -s "$LOOP_PATH" mkpart primary "$PART2_START" 100% + mkdir -p "${MNT_DIR}" + LOOP_PATH="$(losetup --find --partscan --show "${TMP_DIR}/raspbian.img")" + PART2_START="$(parted -s "$LOOP_PATH" -- print | awk '$1==2{ print $2 }')" + parted -s "$LOOP_PATH" rm 2 + parted -s "$LOOP_PATH" mkpart primary "$PART2_START" 100% echo "[+] Check FS" - sudo e2fsck -f "${LOOP_PATH}p2" + e2fsck -f "${LOOP_PATH}p2" echo "[+] Resize FS" - sudo resize2fs "${LOOP_PATH}p2" + resize2fs "${LOOP_PATH}p2" echo "[+] Device is ${LOOP_PATH}" echo "[+] Unmount if already mounted with other img" - sudo umount -r "${SCRIPT_DIR}/mnt" || true + mountpoint -q "${MNT_DIR}" && umount -R "${MNT_DIR}" echo "[+] Mount /" - sudo mount -o rw "${LOOP_PATH}p2" "${SCRIPT_DIR}/mnt" + mount -o rw "${LOOP_PATH}p2" "${MNT_DIR}" echo "[+] Mount /boot" - sudo mount -o rw "${LOOP_PATH}p1" "${SCRIPT_DIR}/mnt/boot" - sudo mount --bind /dev "${SCRIPT_DIR}/mnt/dev/" - sudo mount --bind /sys "${SCRIPT_DIR}/mnt/sys/" - sudo mount --bind /proc "${SCRIPT_DIR}/mnt/proc/" - sudo mount --bind /dev/pts "${SCRIPT_DIR}/mnt/dev/pts" - sudo mount --bind /etc/ssl/certs "${SCRIPT_DIR}/mnt/etc/ssl/certs" - sudo mount --bind /etc/ca-certificates "${SCRIPT_DIR}/mnt/etc/ca-certificates" - sudo cp /usr/bin/qemu-arm-static "${SCRIPT_DIR}/mnt/usr/bin" + mount -o rw "${LOOP_PATH}p1" "${MNT_DIR}/boot" + mount --bind /dev "${MNT_DIR}/dev/" + mount --bind /sys "${MNT_DIR}/sys/" + mount --bind /proc "${MNT_DIR}/proc/" + mount --bind /dev/pts "${MNT_DIR}/dev/pts" + mount --bind /etc/ssl/certs "${MNT_DIR}/etc/ssl/certs" + mount --bind /etc/ca-certificates "${MNT_DIR}/etc/ca-certificates" + cp /usr/bin/qemu-arm-static "${MNT_DIR}/usr/bin" } function provision_raspbian() { - cd "${SCRIPT_DIR}/mnt/" || exit 1 - sudo sed -i'' 's/^\([^#]\)/#\1/g' etc/ld.so.preload # add comments + cd "${MNT_DIR}" + sed -i'' 's/^\([^#]\)/#\1/g' etc/ld.so.preload # add comments echo "[+] Run chroot commands" - sudo LANG=C chroot . bin/bash -x < Date: Wed, 25 Sep 2019 19:39:40 -0400 Subject: [PATCH 06/10] Update create_sibling.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for “dependencies checks” flag option. --- scripts/create_sibling.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create_sibling.sh b/scripts/create_sibling.sh index 5d7aaa7..e4f0db9 100755 --- a/scripts/create_sibling.sh +++ b/scripts/create_sibling.sh @@ -171,7 +171,7 @@ usage: $0 [OPTIONS] -o # Name of the img-file (default: pwnagotchi.img) -s # Size which should be added to second partition (in Gigabyte) (default: 4) -p # Only run provisioning (assumes the image is already mounted) - -p # Only run dependencies checks + -d # Only run dependencies checks -h # Show this help EOF From a7d149ae75c8fe9c67707e333ba0d4f0adf9ca91 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Thu, 26 Sep 2019 11:23:40 +0200 Subject: [PATCH 07/10] added cpuusage and memusage scripts --- sdcard/rootfs/usr/bin/cpuusage | 51 ++++++++++++++++++++++++++++++++++ sdcard/rootfs/usr/bin/memusage | 1 + 2 files changed, 52 insertions(+) create mode 100755 sdcard/rootfs/usr/bin/cpuusage create mode 100755 sdcard/rootfs/usr/bin/memusage diff --git a/sdcard/rootfs/usr/bin/cpuusage b/sdcard/rootfs/usr/bin/cpuusage new file mode 100755 index 0000000..ea9e63a --- /dev/null +++ b/sdcard/rootfs/usr/bin/cpuusage @@ -0,0 +1,51 @@ +#!/usr/bin/gawk -f +#------------------------------------------------------------------------------- +# ~/bin/cpustat : display cpu utilization +# +# usage : normally used as a GNU/screen backtick +# +# notes : 1. Works on the assumption that /proc/stat's first line +# : has the total "jiffies" since boot up used by the +# : different types of tasks in the system. See the +# : filesystems/proc.txt document in kernel source tree +# : +# : 2. Displays a total CPU% (user+system+nice) as well as +# : user CPU% system CPU% and nice CPU% +#------------------------------------------------------------------------------- +BEGIN { + file = "/proc/stat" + while (getline < file) { # read first line + # extract jiffies: + user=$2-user_saved; # . user + nice=$3-nice_saved; # . nice user + syst=$4-syst_saved; # . system + idle=$5-idle_saved; # . idle + wait=$6-wait_saved; # . iowait + irqs=$7-irqs_saved; # . irq + sirq=$8-sirq_saved; # . softirq + + cact=user+syst+nice; # what counts + ctot=user+nice+syst+idle+wait+irqs+sirq; # total activity + + tcpu=cact/ctot*100; # total % cpu utilization + ucpu=user/ctot*100; # user % cpu utilization + scpu=syst/ctot*100; # system % cpu utilization + ncpu=nice/ctot*100; # nice % cpu utilization + + printf "%.1f %%\n",tcpu + + + user_saved=$2; # save the current jiffies + nice_saved=$3; # values for the next loop + syst_saved=$4; + idle_saved=$5; + wait_saved=$6; + irqs_saved=$7; + sirq_saved=$8; + + close(file) # re-read file + + system("sleep 3") + } +} + diff --git a/sdcard/rootfs/usr/bin/memusage b/sdcard/rootfs/usr/bin/memusage new file mode 100755 index 0000000..14efdb1 --- /dev/null +++ b/sdcard/rootfs/usr/bin/memusage @@ -0,0 +1 @@ +free -m | grep Mem | awk {'printf( "%.1f %", $3 / $2 * 100 )'} From d959e9394dcca114eb6860907216f0f8962743ef Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Thu, 26 Sep 2019 14:41:02 +0200 Subject: [PATCH 08/10] fixed bettercap version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5494b88..96ab106 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Depending on the status of the unit, several states and states transitions are c If instead you are a boring person, you can disable the AI and have the algorithm run just with the preconfigured default parameters and enjoy a very portable bettercap + webui dedicated hardware. -**NOTE:** The software **requires bettercap compiled from master**. +**NOTE:** The software **requires bettercap v2.25**. ![units](https://i.imgur.com/MStjXZF.png) From 3b24d27d6bdd05b8ef7a0fde9754e5c0c809b9d4 Mon Sep 17 00:00:00 2001 From: Periklis Fregkos Date: Thu, 26 Sep 2019 17:15:26 +0300 Subject: [PATCH 09/10] Added ability to provide path to raspbian.img For people that are testing and don't want to download it again. --- scripts/create_sibling.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/create_sibling.sh b/scripts/create_sibling.sh index e4f0db9..6b8ea34 100755 --- a/scripts/create_sibling.sh +++ b/scripts/create_sibling.sh @@ -15,6 +15,7 @@ PWNI_SIZE="4" OPT_PROVISION_ONLY=0 OPT_CHECK_DEPS_ONLY=0 +OPT_IMAGE_PROVIDED=0 if [[ "$EUID" -ne 0 ]]; then echo "Run this script as root!" @@ -50,6 +51,13 @@ function get_raspbian() { gunzip -c "${TMP_DIR}/raspbian.zip" > "${TMP_DIR}/raspbian.img" } +function provide_raspbian() { + echo "[+] Providing path of raspbian file" + mkdir -p "${TMP_DIR}" + echo "[+] Unpacking raspbian.zip to raspbian.img" + gunzip -c "${PWNI_INPUT}" > "${TMP_DIR}/raspbian.img" +} + function setup_raspbian(){ echo "[+] Resize image" dd if=/dev/zero bs=1G count="$PWNI_SIZE" >> "${TMP_DIR}/raspbian.img" @@ -168,6 +176,7 @@ usage: $0 [OPTIONS] Options: -n # Name of the pwnagotchi (default: pwnagotchi) + -i # Provide the path of an already downloaded raspbian image -o # Name of the img-file (default: pwnagotchi.img) -s # Size which should be added to second partition (in Gigabyte) (default: 4) -p # Only run provisioning (assumes the image is already mounted) @@ -179,11 +188,15 @@ EOF exit 0 } -while getopts ":n:o:s:dph" o; do +while getopts ":n:i:o:s:dph" o; do case "${o}" in n) PWNI_NAME="${OPTARG}" ;; + i) + PWNI_INPUT="${OPTARG}" + OPT_IMAGE_PROVIDED=1 + ;; o) PWNI_OUTPUT="${OPTARG}" ;; @@ -215,7 +228,13 @@ elif [[ "$OPT_CHECK_DEPS_ONLY" -eq 1 ]]; then fi check_dependencies -get_raspbian + +if [[ "$OPT_IMAGE_PROVIDED" -eq 1 ]]; then + provide_raspbian +else + get_raspbian +fi + setup_raspbian provision_raspbian From e256d18da8774b0e52bf77bd97daf1ce097ef152 Mon Sep 17 00:00:00 2001 From: Periklis Fregkos Date: Thu, 26 Sep 2019 20:31:03 +0300 Subject: [PATCH 10/10] Update README.md * Added the -i option in Usage section for create_sibling.sh * Added troubleshooting for a special case when creating a sibling, incorrect PARTUUIDs are saved in /etc/fstab, resulting in mount error while booting. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 96ab106..7bb826d 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ usage: ./scripts/create_sibling.sh [OPTIONS] Options: -n # Name of the pwnagotchi (default: pwnagotchi) + -i # Provide the path of an already downloaded raspbian image -o # Name of the img-file (default: pwnagotchi.img) -s # Size which should be added to second partition (in Gigabyte) (default: 4) -p # Only run provisioning (assumes the image is already mounted) @@ -80,6 +81,8 @@ The UI is available either via display if installed, or via http://10.0.0.2:8080 - `/var/log/pwnagotchi.log` is your friend. - if connected to a laptop via usb data port, with internet connectivity shared, magic things will happen. - checkout the `ui.video` section of the `config.yml` - if you don't want to use a display, you can connect to it with the browser and a cable. +- If you get `[FAILED] Failed to start Remount Root and Kernel File Systems.` while booting pwnagotchi, make sure +the `PARTUUID`s for `rootfs` and `boot` partitions are the same in `/etc/fstab`. Use `sudo blkid` to find those values when you are using `create_sibling.sh`. ## License