mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
bac62bc4aa | |||
f7a5f2a554 | |||
6921fd14a3 | |||
0dbd611ed5 | |||
18b9093f70 | |||
26913016b9 | |||
0786b6757e | |||
0f4eda8039 |
6
Makefile
6
Makefile
@ -48,15 +48,11 @@ $(PACKER):
|
|||||||
rm $(PACKER).zip
|
rm $(PACKER).zip
|
||||||
chmod +x $@
|
chmod +x $@
|
||||||
|
|
||||||
SDIST := dist/pwnagotchi-$(PWN_VERSION).tar.gz
|
|
||||||
$(SDIST): setup.py pwnagotchi
|
|
||||||
python3 setup.py sdist
|
|
||||||
|
|
||||||
# Building the image requires packer, but don't rebuild the image just because packer updated.
|
# Building the image requires packer, but don't rebuild the image just because packer updated.
|
||||||
pwnagotchi: | $(PACKER)
|
pwnagotchi: | $(PACKER)
|
||||||
|
|
||||||
# If the packer or ansible files are updated, rebuild the image.
|
# If the packer or ansible files are updated, rebuild the image.
|
||||||
pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $(shell find builder/data -type f)
|
pwnagotchi: builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $(shell find builder/data -type f)
|
||||||
|
|
||||||
cd builder && $(PACKER) init pwnagotchi.json.pkr.hcl && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json.pkr.hcl
|
cd builder && $(PACKER) init pwnagotchi.json.pkr.hcl && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json.pkr.hcl
|
||||||
|
|
||||||
|
15
builder/data/etc/default/zramswap
Normal file
15
builder/data/etc/default/zramswap
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Specifies amount of zram devices to create.
|
||||||
|
# By default, zramswap-start will use all available cores.
|
||||||
|
#CORES=1
|
||||||
|
|
||||||
|
# Specifies the amount of RAM that should be used for zram
|
||||||
|
# based on a percentage the total amount of available memory
|
||||||
|
PERCENTAGE=60
|
||||||
|
|
||||||
|
# Specifies a static amount of RAM that should be used for
|
||||||
|
# the ZRAM devices, this is in MiB
|
||||||
|
#ALLOCATION=256
|
||||||
|
|
||||||
|
# Specifies the priority for the swap devices, see swapon(2)
|
||||||
|
# for more details.
|
||||||
|
#PRIORITY=100
|
@ -1,26 +0,0 @@
|
|||||||
# /etc/dphys-swapfile - user settings for dphys-swapfile package
|
|
||||||
# author Neil Franklin, last modification 2010.05.05
|
|
||||||
# copyright ETH Zuerich Physics Departement
|
|
||||||
# use under either modified/non-advertising BSD or GPL license
|
|
||||||
|
|
||||||
# this file is sourced with . so full normal sh syntax applies
|
|
||||||
|
|
||||||
# the default settings are added as commented out CONF_*=* lines
|
|
||||||
|
|
||||||
|
|
||||||
# where we want the swapfile to be, this is the default
|
|
||||||
#CONF_SWAPFILE=/var/swap
|
|
||||||
|
|
||||||
# set size to absolute value, leaving empty (default) then uses computed value
|
|
||||||
# you most likely don't want this, unless you have an special disk situation
|
|
||||||
CONF_SWAPSIZE=2048
|
|
||||||
|
|
||||||
# set size to computed value, this times RAM size, dynamically adapts,
|
|
||||||
# guarantees that there is enough swap without wasting disk space on excess
|
|
||||||
#CONF_SWAPFACTOR=2
|
|
||||||
|
|
||||||
# restrict size (computed and absolute!) to maximally this limit
|
|
||||||
# can be set to empty for no limit, but beware of filled partitions!
|
|
||||||
# this is/was a (outdated?) 32bit kernel limit (in MBytes), do not overrun it
|
|
||||||
# but is also sensible on 64bit to prevent filling /var or even / partition
|
|
||||||
#CONF_MAXSWAP=2048
|
|
@ -39,8 +39,10 @@ reload_brcm() {
|
|||||||
start_monitor_interface() {
|
start_monitor_interface() {
|
||||||
rfkill unblock all
|
rfkill unblock all
|
||||||
ifconfig wlan0 up
|
ifconfig wlan0 up
|
||||||
|
sleep 3
|
||||||
iw dev wlan0 set power_save off
|
iw dev wlan0 set power_save off
|
||||||
iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add wlan0mon type monitor
|
iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add wlan0mon type monitor
|
||||||
|
sleep 2
|
||||||
rfkill unblock all
|
rfkill unblock all
|
||||||
ifconfig wlan0 down
|
ifconfig wlan0 down
|
||||||
ifconfig wlan0mon up
|
ifconfig wlan0mon up
|
||||||
@ -54,7 +56,7 @@ stop_monitor_interface() {
|
|||||||
ifconfig wlan0 up
|
ifconfig wlan0 up
|
||||||
}
|
}
|
||||||
|
|
||||||
# returns 0 if the specificed network interface is up
|
# returns 0 if the specified network interface is up
|
||||||
is_interface_up() {
|
is_interface_up() {
|
||||||
if grep -qi 'up' /sys/class/net/"$1"/operstate; then
|
if grep -qi 'up' /sys/class/net/"$1"/operstate; then
|
||||||
return 0
|
return 0
|
||||||
|
@ -23,21 +23,17 @@
|
|||||||
services:
|
services:
|
||||||
enable:
|
enable:
|
||||||
- bettercap.service
|
- bettercap.service
|
||||||
- dphys-swapfile.service
|
|
||||||
- fstrim.timer
|
- fstrim.timer
|
||||||
- pwnagotchi.service
|
- pwnagotchi.service
|
||||||
- pwngrid-peer.service
|
- pwngrid-peer.service
|
||||||
|
- zramswap.service
|
||||||
disable:
|
disable:
|
||||||
- apt-daily-upgrade.service
|
- apt-daily-upgrade.service
|
||||||
- apt-daily-upgrade.timer
|
- apt-daily-upgrade.timer
|
||||||
- apt-daily.service
|
- apt-daily.service
|
||||||
- apt-daily.timer
|
- apt-daily.timer
|
||||||
- avahi-daemon.service
|
|
||||||
- avahi-daemon.socket
|
|
||||||
- bluetooth.service
|
- bluetooth.service
|
||||||
- ifup@wlan0.service
|
- ifup@wlan0.service
|
||||||
- triggerhappy.service
|
|
||||||
- wpa_supplicant.service
|
|
||||||
packages:
|
packages:
|
||||||
caplets:
|
caplets:
|
||||||
source: "https://github.com/jayofelony/caplets.git"
|
source: "https://github.com/jayofelony/caplets.git"
|
||||||
@ -61,6 +57,7 @@
|
|||||||
- libpcap0.8-dbg
|
- libpcap0.8-dbg
|
||||||
remove:
|
remove:
|
||||||
- avahi-daemon
|
- avahi-daemon
|
||||||
|
- dhpys-swapfile
|
||||||
- nfs-common
|
- nfs-common
|
||||||
- triggerhappy
|
- triggerhappy
|
||||||
- wpasupplicant
|
- wpasupplicant
|
||||||
@ -73,7 +70,6 @@
|
|||||||
- build-essential
|
- build-essential
|
||||||
- curl
|
- curl
|
||||||
- dkms
|
- dkms
|
||||||
- dphys-swapfile
|
|
||||||
- fbi
|
- fbi
|
||||||
- flex
|
- flex
|
||||||
- fonts-dejavu
|
- fonts-dejavu
|
||||||
@ -161,17 +157,62 @@
|
|||||||
- wl
|
- wl
|
||||||
- xxd
|
- xxd
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
|
- zram-tools
|
||||||
environment:
|
environment:
|
||||||
ARCHFLAGS: "-arch aarch64"
|
ARCHFLAGS: "-arch aarch64"
|
||||||
QEMU_UNAME: "{{ kernel.full }}"
|
QEMU_UNAME: "{{ kernel.full }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
# First we install and remove unnecessary packages
|
||||||
|
- name: install packages
|
||||||
|
apt:
|
||||||
|
name: "{{ packages.apt.install }}"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
install_recommends: false
|
||||||
|
|
||||||
|
- name: remove unnecessary apt packages
|
||||||
|
apt:
|
||||||
|
name: "{{ packages.apt.remove }}"
|
||||||
|
state: absent
|
||||||
|
purge: yes
|
||||||
|
register: removed
|
||||||
|
|
||||||
|
# Now we set up /boot/firmware
|
||||||
- name: Create pi user
|
- name: Create pi user
|
||||||
copy:
|
copy:
|
||||||
dest: /boot/firmware/userconf
|
dest: /boot/firmware/userconf
|
||||||
content: |
|
content: |
|
||||||
pi:$6$3jNr0GA9KIyt4hmM$efeVIopdMQ8DGgEPCWWlbx3mJJNAYci1lEXGdlky0xPyjqwKNbwTL5SrCcpb4144C4IvzWjn7Iv.QjqmU7iyT/
|
pi:$6$3jNr0GA9KIyt4hmM$efeVIopdMQ8DGgEPCWWlbx3mJJNAYci1lEXGdlky0xPyjqwKNbwTL5SrCcpb4144C4IvzWjn7Iv.QjqmU7iyT/
|
||||||
|
|
||||||
|
- name: enable ssh on boot
|
||||||
|
file:
|
||||||
|
path: /boot/firmware/ssh
|
||||||
|
state: touch
|
||||||
|
|
||||||
|
- name: adjust /boot/firmware/config.txt
|
||||||
|
lineinfile:
|
||||||
|
dest: /boot/firmware/config.txt
|
||||||
|
insertafter: EOF
|
||||||
|
line: '{{ item }}'
|
||||||
|
with_items: "{{ system.boot_options }}"
|
||||||
|
|
||||||
|
- name: change root partition
|
||||||
|
replace:
|
||||||
|
dest: /boot/firmware/cmdline.txt
|
||||||
|
backup: no
|
||||||
|
regexp: "root=PARTUUID=[a-zA-Z0-9\\-]+"
|
||||||
|
replace: "root=/dev/mmcblk0p2"
|
||||||
|
|
||||||
|
- name: configure /boot/firmware/cmdline.txt
|
||||||
|
lineinfile:
|
||||||
|
path: /boot/firmware/cmdline.txt
|
||||||
|
backrefs: True
|
||||||
|
state: present
|
||||||
|
backup: no
|
||||||
|
regexp: '(.*)$'
|
||||||
|
line: '\1 modules-load=dwc2,g_ether'
|
||||||
|
|
||||||
- name: change hostname
|
- name: change hostname
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/hostname
|
dest: /etc/hostname
|
||||||
@ -189,6 +230,7 @@
|
|||||||
state: present
|
state: present
|
||||||
when: hostname.changed
|
when: hostname.changed
|
||||||
|
|
||||||
|
# Now we disable sap and a2dp, we don't use them on rpi
|
||||||
- name: disable sap plugin for bluetooth.service
|
- name: disable sap plugin for bluetooth.service
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /lib/systemd/system/bluetooth.service
|
dest: /lib/systemd/system/bluetooth.service
|
||||||
@ -196,19 +238,6 @@
|
|||||||
line: 'ExecStart=/usr/libexec/bluetooth/bluetoothd --noplugin=sap,a2dp'
|
line: 'ExecStart=/usr/libexec/bluetooth/bluetoothd --noplugin=sap,a2dp'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: configure dphys-swapfile
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/dphys-swapfile
|
|
||||||
regexp: "^CONF_SWAPSIZE=.*$"
|
|
||||||
line: "CONF_SWAPSIZE=2048"
|
|
||||||
|
|
||||||
- name: install packages
|
|
||||||
apt:
|
|
||||||
name: "{{ packages.apt.install }}"
|
|
||||||
state: present
|
|
||||||
update_cache: yes
|
|
||||||
install_recommends: false
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
#
|
#
|
||||||
# libpcap v1.9 - build from source
|
# libpcap v1.9 - build from source
|
||||||
@ -477,41 +506,6 @@
|
|||||||
state: absent
|
state: absent
|
||||||
path: /etc/update-motd.d/10-uname
|
path: /etc/update-motd.d/10-uname
|
||||||
|
|
||||||
- name: enable ssh on boot
|
|
||||||
file:
|
|
||||||
path: /boot/firmware/ssh
|
|
||||||
state: touch
|
|
||||||
|
|
||||||
- name: adjust /boot/config.txt
|
|
||||||
lineinfile:
|
|
||||||
dest: /boot/firmware/config.txt
|
|
||||||
insertafter: EOF
|
|
||||||
line: '{{ item }}'
|
|
||||||
with_items: "{{ system.boot_options }}"
|
|
||||||
|
|
||||||
- name: adjust /etc/modules
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/modules
|
|
||||||
insertafter: EOF
|
|
||||||
line: '{{ item }}'
|
|
||||||
with_items: "{{ system.modules }}"
|
|
||||||
|
|
||||||
- name: change root partition
|
|
||||||
replace:
|
|
||||||
dest: /boot/firmware/cmdline.txt
|
|
||||||
backup: no
|
|
||||||
regexp: "root=PARTUUID=[a-zA-Z0-9\\-]+"
|
|
||||||
replace: "root=/dev/mmcblk0p2"
|
|
||||||
|
|
||||||
- name: configure /boot/cmdline.txt
|
|
||||||
lineinfile:
|
|
||||||
path: /boot/cmdline.txt
|
|
||||||
backrefs: True
|
|
||||||
state: present
|
|
||||||
backup: no
|
|
||||||
regexp: '(.*)$'
|
|
||||||
line: '\1 modules-load=dwc2,g_ether'
|
|
||||||
|
|
||||||
- name: Add pwnlog alias
|
- name: Add pwnlog alias
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /home/pi/.bashrc
|
dest: /home/pi/.bashrc
|
||||||
@ -563,13 +557,6 @@
|
|||||||
group: pi
|
group: pi
|
||||||
recurse: true
|
recurse: true
|
||||||
|
|
||||||
- name: remove unnecessary apt packages
|
|
||||||
apt:
|
|
||||||
name: "{{ packages.apt.remove }}"
|
|
||||||
state: absent
|
|
||||||
purge: yes
|
|
||||||
register: removed
|
|
||||||
|
|
||||||
- name: clean apt cache
|
- name: clean apt cache
|
||||||
apt:
|
apt:
|
||||||
autoclean: true
|
autoclean: true
|
||||||
|
@ -1 +1 @@
|
|||||||
__version__ = '2.7.1'
|
__version__ = '2.7.2'
|
||||||
|
@ -212,7 +212,7 @@ class AutoUpdate(plugins.Plugin):
|
|||||||
if install(display, update):
|
if install(display, update):
|
||||||
num_installed += 1
|
num_installed += 1
|
||||||
else:
|
else:
|
||||||
prev_status = '%d new update%c available!' % (num_updates, 's' if num_updates > 1 else '')
|
prev_status = '%d new update%s available!' % (num_updates, 's' if num_updates > 1 else '')
|
||||||
|
|
||||||
logging.info("[update] done")
|
logging.info("[update] done")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user