Skip to content
This repository has been archived by the owner on Jan 19, 2020. It is now read-only.

Setting up OSID v1.0 on Arch Linux ARM

Francis Hart edited this page May 14, 2015 · 1 revision

We recommend using Arch Linux ARM due to it's small foot print and quick boot time when compared to Raspbian:

Currently these instructions are un-tested but will be updated when time permits, if you would like to provide feedback or amends to these instructions please contact us through Github:

  1. Write latest Arch Linux ARM to a 2Gb or larger SD card.
  2. Run hostnamectl set-hostname osid to change the hostname.
  3. Make the imgroot directory mkdir /etc/osid/imgroot -p.
  4. Download the latest code wget https://github.com/rockandscissor/osid/archive/master.zip.
  5. Update the system and install the unzip utility pacman -Syu unzip.
  6. Run unzip master.zip and then mv osid-master/* /etc/osid to move the contents to the osid directory.
  7. Install Nginx pacman -S nginx and then run systemctl enable nginx to enable it to run on startup.
  8. Install PHP-FPM pacman -S php-fpm and then run systemctl enable php-fpm to enable it to run on startup.
  9. Edit /etc/nginx/nginx.conf and replace the contents with the configuration information at the bottom of this page.
  10. Edit /etc/php/php.ini and add :/etc/osid/www/public_html/ to the end of the open_basedir line.
  11. Run chown http:http /etc/osid/imgroot -R and sudo chown http:http /etc/osid/www -R to ensure the web server and samba have access to the OSID files.
  12. You will also need to install the dcfldd package using pacman -S dcfldd.
  13. Add a cron job to the root crontab by typing crontab -e and then putting in this rule: * * * * * /etc/osid/system/write.sh. N.B. If you want to use nano on Arch Linx run export EDITOR="nano" before editing the crontab.
  14. You will also need to install the samba package using pacman -S samba (you will save images to be written to the Pi at \\osid\Images (Windows) or smb://osid/Images (Mac/Linux). Make sure your /etc/samba/smb.conf matches the configuration at the bottom of this page and once this is done restart the raspberry pi.
  15. Make sure Samba starts on boot systemctl enable samba.
  16. If you're SD card is bigger than 2Gb you will need to expand the filesystem to fill the card. Follow the guide at http://raspberry-hosting.com/faq/how-expand-arch-linux-root-partition to do this.
  17. Your done! Upload your image file(s) to your samba share and then visit http://osid in your web browser to get started!

/etc/nginx/nginx.conf:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen 80;
        server_name localhost;
        root /etc/osid/www/public_html;
        location / {
            index index.html index.htm index.php;
        }

        location ~ \.php$ {
            #fastcgi_pass 127.0.0.1:9000; (depending on your php-fpm socket configuration)
            fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }
    }

}

/etc/samba/smb.conf:

[global]
workgroup = WORKGROUP
server string = Open Source Image Duplicator
map to guest = Bad User
security = user

log file = /var/log/samba/%m.log
max log size = 50

interfaces = lo eth0
guest account = http

dns proxy = no

[Images]
path = /etc/osid/imgroot
public = yes
only guest = yes
writable = yes