Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimantal Odroid-N2 Support added #335

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ out/base_images/raspi4_base.img.gz:
out/base_images/rock64_base.img.gz:
@mkdir -p out/base_images/
@wget http://mynodebtc.com/device/mynode_images/rock64_base.img.gz -O out/base_images/rock64_base.img.gz
out/base_images/odroidn2_base.img.gz:
@mkdir -p out/base_images/
@wget http://bitcorn.wtf/mynode/odroidn2_base.img.gz -O out/base_images/odroidn2_base.img.gz
out/base_images/rockpro64_base.img.gz:
@mkdir -p out/base_images/
@wget http://mynodebtc.com/device/mynode_images/rockpro64_base.img.gz -O out/base_images/rockpro64_base.img.gz
Expand All @@ -63,6 +66,11 @@ setup_new_rockpro64: start_file_server out/base_images/rockpro64_base.img.gz roo
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_rockpro64.sh

.PHONY: setup_new_odroidn2
setup_new_odroidn2: start_file_server out/base_images/odroidn2_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
@/bin/bash scripts/setup_new_odroidn2.sh

.PHONY: setup_new_raspi3
setup_new_raspi3: start_file_server out/base_images/raspi3_base.img.gz rootfs
@cp -f setup/setup_device.sh out/setup_device.sh
Expand Down Expand Up @@ -99,4 +107,4 @@ beta: clean_rootfs release.sh
.PHONY: clean
clean: stop_file_server
@rm -rf out/
@rm -rf release.sh
@rm -rf release.sh
44 changes: 44 additions & 0 deletions doc/setup_base_image_odroidn2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Setup Base Image (ODROID-N2)

1. After Armbian Flash

- Login with root / 1234
- Change root password to something longish like boltbolt
- Create admin user with password bolt

2. Login as admin

3. Delete root password

```sh
sudo passwd -d root
```

4. Set hostname

```sh
echo "myNode" | sudo tee /etc/hostname
sudo sed -i 's/odroidn2/myNode/g' /etc/hosts
# OR armbian-config -> Personal -> Hostname
```

5. Update packages

```sh
sudo apt-get update
sudo apt-get -y upgrade
```

6. Install some necessary tools

```sh
sudo apt-get -y install network-manager tmux
```

7. Sync

```sh
sync
```

8. Make image now (if imaging)
Binary file added rootfs/odroidn2/usr/bin/electrs
Binary file not shown.
8 changes: 4 additions & 4 deletions rootfs/standard/etc/systemd/system/bitcoind.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Description=Bitcoin daemon
After=network.target mynode.service

[Service]
ExecStartPre=/usr/bin/is_not_shutting_down.sh
ExecStartPre=/usr/bin/wait_on_uploader.sh
ExecStartPre=/bin/sh -c 'cat /mnt/hdd/mynode/quicksync/.quicksync_complete'
ExecStartPre=+/usr/bin/is_not_shutting_down.sh
ExecStartPre=+/usr/bin/wait_on_uploader.sh
ExecStartPre=+/bin/sh -c 'cat /mnt/hdd/mynode/quicksync/.quicksync_complete'
EnvironmentFile=/mnt/hdd/mynode/bitcoin/env
ExecStart=/usr/local/bin/bitcoind -daemon $BTCARGS -deprecatedrpc=accounts -par=-1 -conf=/home/bitcoin/.bitcoin/bitcoin.conf -printtoconsole -pid=/home/bitcoin/.bitcoin/bitcoind.pid
ExecStartPost=+/usr/bin/mynode_post_bitcoin.sh
Expand All @@ -28,4 +28,4 @@ StandardError=syslog
SyslogIdentifier=bitcoind

[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
49 changes: 49 additions & 0 deletions scripts/setup_new_odroidn2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

LOCAL_IP=$(python ./scripts/get_local_ip.py)

echo ""
echo "Finished updating rootfs and other files!"
echo ""

clear
echo "Step 1: "
echo " Flash SD Card with Odroid-N2 Image: out/base_images/odroidn2.img.gz"
echo " OR"
echo " If you would rather create your own base image, follow the"
echo " manual instructions in doc/setup_base_image_odroidn2.md"
echo ""
echo "Press a key when complete..."
read -n 1

clear
echo "Step 2: "
echo " Insert SD Card into your Odroid-N2 and boot the device"
echo ""
echo "Press a key when complete..."
read -n 1

clear
echo "Step 3: "
echo " Login to device with username 'admin' and password 'bolt'"
echo " Run the following commands. Use bolt at password prompts."
echo " wget http://${LOCAL_IP}:8000/setup_device.sh -O setup_device.sh"
echo " chmod +x setup_device.sh"
echo " tmux new-session -s mynode sudo ./setup_device.sh ${LOCAL_IP}"
echo ""
echo "Press a key when complete..."
read -n 1

clear
echo "Step 4:"
echo " Reboot your device."
echo ""
echo "Press a key when complete..."
read -n 1

clear
echo "Congratulations! Your device is now ready!"
echo " Access it via a web browser at http://mynode.local/ or http://<device ip>/"
echo " Access it via SSH using the default credentials: admin / bolt"
echo " You should change your password on the settings page in the web GUI"
echo ""
10 changes: 8 additions & 2 deletions setup/setup_device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ SERVER_IP=$1
IS_ARMBIAN=0
IS_ROCK64=0
IS_ROCKPRO64=0
IS_ODROIDN2=0
IS_RASPI=0
IS_RASPI3=0
IS_RASPI4=0
IS_X86=0
IS_UNKNOWN=0
DEVICE_TYPE="unknown"
MODEL=$(cat /proc/device-tree/model) || IS_UNKNOWN=1
MODEL=$(tr -d '\0' </proc/device-tree/model) || IS_UNKNOWN=1
uname -a | grep amd64 && IS_X86=1 || true
if [[ $MODEL == *"Rock64"* ]]; then
IS_ARMBIAN=1
IS_ROCK64=1
elif [[ $MODEL == *"RockPro64"* ]]; then
IS_ARMBIAN=1
IS_ROCKPRO64=1
elif [[ $MODEL == *"ODROID-N2"* ]]; then
IS_ARMBIAN=1
IS_ODROIDN2=1
elif [[ $MODEL == *"Raspberry Pi 3"* ]]; then
IS_RASPI=1
IS_RASPI3=1
Expand Down Expand Up @@ -73,6 +77,8 @@ if [ $IS_ROCK64 = 1 ]; then
TARBALL="mynode_rootfs_rock64.tar.gz"
elif [ $IS_ROCKPRO64 = 1 ]; then
TARBALL="mynode_rootfs_rockpro64.tar.gz"
elif [ $IS_ODROIDN2 = 1 ]; then
TARBALL="mynode_rootfs_odroidn2.tar.gz"
elif [ $IS_RASPI3 = 1 ]; then
TARBALL="mynode_rootfs_raspi3.tar.gz"
elif [ $IS_RASPI4 = 1 ]; then
Expand Down Expand Up @@ -227,7 +233,7 @@ BTC_VERSION="0.20.0"
ARCH="UNKNOWN"
if [ $IS_RASPI = 1 ]; then
ARCH="arm-linux-gnueabihf"
elif [ $IS_ROCK64 = 1 ] || [ $IS_ROCKPRO64 = 1 ]; then
elif [ $IS_ROCK64 = 1 ] || [ $IS_ROCKPRO64 = 1 ] || [ $IS_ODROIDN2 = 1 ]; then
ARCH="aarch64-linux-gnu"
elif [ $IS_X86 = 1 ]; then
ARCH="x86_64-linux-gnu"
Expand Down