diff --git a/Makefile b/Makefile index 068802983..88aaf7e4b 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -99,4 +107,4 @@ beta: clean_rootfs release.sh .PHONY: clean clean: stop_file_server @rm -rf out/ - @rm -rf release.sh \ No newline at end of file + @rm -rf release.sh diff --git a/doc/setup_base_image_odroidn2.md b/doc/setup_base_image_odroidn2.md new file mode 100644 index 000000000..7d7f9801a --- /dev/null +++ b/doc/setup_base_image_odroidn2.md @@ -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) diff --git a/rootfs/odroidn2/usr/bin/electrs b/rootfs/odroidn2/usr/bin/electrs new file mode 100755 index 000000000..3f6c1220f Binary files /dev/null and b/rootfs/odroidn2/usr/bin/electrs differ diff --git a/rootfs/standard/etc/systemd/system/bitcoind.service b/rootfs/standard/etc/systemd/system/bitcoind.service index f10c9c6b4..2a85b1b6f 100644 --- a/rootfs/standard/etc/systemd/system/bitcoind.service +++ b/rootfs/standard/etc/systemd/system/bitcoind.service @@ -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 @@ -28,4 +28,4 @@ StandardError=syslog SyslogIdentifier=bitcoind [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/scripts/setup_new_odroidn2.sh b/scripts/setup_new_odroidn2.sh new file mode 100755 index 000000000..af70e9eca --- /dev/null +++ b/scripts/setup_new_odroidn2.sh @@ -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:///" +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 "" diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 83f64c048..1d0b2eed7 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -18,13 +18,14 @@ 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'