- Install DietPi on the device, remember to set WiFi in dietpi-wifi.txt on FAT32 partition.
- Find in your router (or via avahi) and SSH to dietpi@hostname.
- Update and everything what DietPi wants, change the SSH client to OpenSSH.
- Reboot.
- Remove bloat
sudo apt purge dropbear lighttpd
- Install useful software for the future
sudo apt -y install openssh-server git net-tools avahi-daemon
. - Reboot.
- On host machine, edit ~/.ssh/known_hosts and remove the position with Pi's IP, connect via SSH again.
- Clean up login routines from DietPi checks:
sudo nano /etc/bashrc.d/dietpi-login.sh
and comment out everything (or just delete). - Disable all the DietPi system checks
sudo systemctl disable dietpi-boot ; sudo systemctl disable dietpi-postboot ; sudo systemctl disable dietpi-preboot
sudo mkdir /usr/lib/jvm
- Get JDK8 https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html for ARM 32.
- Copy JDK with scp to /home/dietpi.
- Extract
cd; tar xf oracle-jdk.tar.gz
- Copy JDK
sudo mv jdk1.8.0_123 /usr/lib/jvm/
- Add permissions
sudo chmod -R o+r,o+x /usr/lib/jvm
- Create environment variable for JAVA_HOME
sudo su -c 'echo "export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_123/" > /etc/bashrc.d/java.sh'
- Link java as global executable
sudo ln -s /usr/lib/jvm/jdk1.8.0_191/bin/java /usr/bin/java
.
- Clone repo:
cd; git clone https://github.com/RaspberryWallet/RaspberryWallet.git
- Copy application directory:
sudo cp -r RaspberryWallet/opt/* /opt/
- Create user wallet:
sudo useradd -M wallet
- Lock user wallet from logging in:
sudo usermod -L wallet
- Change home directory:
sudo nano /etc/passwd
and in the last line change/home/wallet
to/opt/wallet
. - Add wallet to group netdev and gpio
sudo usermod -a -G netdev wallet; sudo usermod -a -G gpio wallet
. - Move wpa_supplicant config and make it accessible to wallet
sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /opt/wallet; sudo chown wallet:wallet /opt/wallet/wpa_supplicant.conf; sudo ln -s /opt/wallet/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
- Allow wallet/netdev to do naughty things
sudo sh -c 'echo " " >> /etc/sudoers; grep "%netdev" RaspberryWallet/etc/sudoers >> /etc/sudoers'
. - Create service
sudo cp -r RaspberryWallet/etc/systemd /etc/
- Upload Manager.jar using scp to /home/dietpi/.
sudo cp /home/dietpi/Manager-1.0-SNAPSHOT.jar /opt/wallet/Manager.jar
- Upload signed modules using scp to /home/dietpi.
- Copy modules
sudo mkdir /opt/wallet/modules; sudo cp *Module.jar /opt/wallet/modules/
. - Get the config
wget https://github.com/RaspberryWallet/Backend/raw/master/config.yaml; sudo mv config.yaml /opt/wallet/
- Get keystore
wget https://github.com/RaspberryWallet/Backend/raw/master/RaspberryWallet.keystore; sudo mv RaspberryWallet.keystore /opt/wallet/
. - Set permissions:
sudo chown -R wallet:wallet /opt/wallet; sudo chmod -R o-r,o-x /opt/wallet
.
- Edit kernel config
sudo nano /boot/cmdline.txt
, add at the endmodules-load=dwc2,g_ether
and in/boot/config.txt
setdtparam=audio=off
(audio is not needed) and add a linedtoverlay=dwc2
. - Install a DHCP server
sudo apt -y install isc-dhcp-server
- Copy DHCP config
cd; sudo cp -r RaspberryWallet/etc/dhcp /etc/; sudo cp -r RaspberryWallet/etc/network /etc/
. - Move hostnames so avahi sets up wallet.local
sudo mv RaspberryWallet/etc/hosts /etc/; sudo mv RaspberryWallet/etc/hostname /etc/
- Reboot.
- Now you should be able to SSH to dietpi@10.7.7.2 or dietpi@wallet.local.
- Not working, investigating.
- Check name of USB card (should be usb0)
ifconfig -a
. - Edit
nano RaspberryWallet/etc/iptables/rules.v4
and change all of 192.168.0.0/24 to your home subnet. - a. (Probably skip) Change all of
-i usb0
to-i yourUSBnetworkCard
. - Install
sudo apt -y install iptables-persistent
and select "Yes", save rules!. - Replace tables
sudo cp -r RaspberryWallet/etc/iptables /etc/
- BE WARNED this can lock you out forever till reflash (or try via UART console if something goes wrong). Reboot.