- Notifications
You must be signed in to change notification settings - Fork4
functionland/fula-ota
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
curl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.sh
Optionally, manage Docker as a non-root user by following the instructions atManage Docker as a non-root user.
sudo groupadd dockersudo usermod -aG docker$USERnewgrp docker
Install Docker Compose 1.29.2
sudo curl -L"https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-composesudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Clone the repository to your system:
git clone https://github.com/functionland/fula-ota
Install NetworkManager and set it to start automatically on boot
sudo systemctl start NetworkManagersudo systemctlenable NetworkManager
If your OS does not support auto-mounting you need to do this step. On raspberry pi, it is not needed as raspbian supports auto-mount, but on Armbian it is needed.
sudo apt install net-tools dnsmasq-base rfkill git
sudo nano /usr/local/bin/automount.sh
And then fill it with:
#!/bin/bashMOUNTPOINT="/media/pi"DEVICE="/dev/$1"MOUNTNAME=$(echo$1| sed's/[^a-zA-Z0-9]//g')mkdir -p${MOUNTPOINT}/${MOUNTNAME}# Determine filesystem typeFSTYPE=$(blkid -o value -s TYPE${DEVICE})if [${FSTYPE}="ntfs" ];then# If filesystem is NTFS# uid and gid specify the owner and the group of files.# dmask and fmask control the permissions for directories and files. 0000 gives everyone read and write access. mount -t ntfs -o uid=pi,gid=pi,dmask=0000,fmask=0000${DEVICE}${MOUNTPOINT}/${MOUNTNAME}elif [${FSTYPE}="vfat" ];then# If filesystem is FAT32 mount -t vfat -o uid=pi,gid=pi,dmask=0000,fmask=0000${DEVICE}${MOUNTPOINT}/${MOUNTNAME}else# For other filesystem types mount${DEVICE}${MOUNTPOINT}/${MOUNTNAME}# Changing owner for non-NTFS and non-FAT32 filesystems chown pi:pi${MOUNTPOINT}/${MOUNTNAME}fi
And make it executable:
sudo chmod +x /usr/local/bin/automount.sh
sudo nano /etc/udev/rules.d/99-automount.rules
and fill it with:
ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="automount@%k.service"ACTION=="add", KERNEL=="nvme[0-9]n[0-9]p[0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="automount@%k.service" ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/systemctl stop automount@%k.service"ACTION=="remove", KERNEL=="nvme[0-9]n[0-9]p[0-9]", RUN+="/bin/systemctl stop automount@%k.service"
Create file:
sudo nano /etc/systemd/system/automount@.service
and add content:
[Unit]Description=Automount disksBindsTo=dev-%i.deviceAfter=dev-%i.device [Service]Type=oneshotRemainAfterExit=yesExecStart=/usr/local/bin/automount.sh %IExecStop=/usr/bin/sh -c'/bin/umount /media/pi/$(echo %I | sed's/[^a-zA-Z0-9]//g'); /bin/rmdir /media/pi/$(echo %I | sed's/[^a-zA-Z0-9]//g')'
And now restart the service with
sudo udevadm control --reload-rulessudo systemctl daemon-reload
And you can check the status of each service (that is created per attached device):
systemctl status automount@sda1.service
First install dependencies:
sudo apt-get install gcc python3-dev python-is-python3 python3-pipsudo apt-get install python3-gi python3-gi-cairo gir1.2-gtk-3.0sudo apt install net-tools dnsmasq-base rfkill lshw
For board installation Navigate to thefula
directory and give it permission to execute:
cd docker/fxsupport/linuxsudo bash ./fula.sh rebuildsudo bash ./fula.sh start
THIS IS THE END OF INSTALLATION ON THE BOARD
If you want to build images and push to docker (not on the client) you can follow the below steps.
Run following commands
cd docker#for testing#source env_test.sh#for releasingsource env_release.shbash ./build_and_push_images.sh
this command will push docker images into docker.io
Command | Description |
---|---|
install | Start the installer. |
start | Start all containers. |
restart | Restart all containers (same as start). |
stop | Stop all containers. |
rebuild | Rebuild generated installation assets. |
update | Pull latest docker images. |
help | List all commands. |
About
This repository contains the fula dockers that runs on Linux and is responsible for managing the over the air update, blockchain and protocol services