TJWS, Arch Linux, Pidora, and Raspberry Pi
  1. Preparing SD card
  2. Download the latest Arch ARM Linux zipped image, and then open it using:
    $tar -xzf <file>
    $gunzip <file>
    Copy image to SD card using command
    $sudo dd bs=4M if=~/archlinux-hf-2013-02-11.img of=/dev/sdX
    Replace sdX with your SD card drive, like sdc
  3. Initial setup
    Unfortunately here is no single resource covering all steps of Arch Linux setup for Raspberry Pi, so follow the resources:
    Initial common setup guide
    Raspberry Pi specific
    For timezone
    For locale
  4. Network / wireless setup
    This resource provides good coverage of network setup including wireless.
  5. Resize SD
    More likely size of SD card is greater than 2Gb, so you need to resize the card to utilize all capacity. Follow the resource for resize guide.
    You can also follow the steps below:
    #fdisk -c -u /dev/mmcblk0
    #shutdown -r now
    note that you need two times press enter to confirm default answers.
    And then you write changes back and do reboot. Now you need expand file system to allocated partition.
    #resize2fs /dev/mmcblk0p2
    The command will take some time to complete processing.
  6. Java install
    Download Java 8 from here. Select Linux ARMv6/7 VFP, HardFP ABI
    And then extract content
    #tar -xzf jdk-8-linux-arm-vfp-hflt.tar.gz -C /opt
  7. TJWS install
    The standard was taken in consideration to install TJWS. The following directories were used:
    Just create the directories and copy TJWS components in corresponding locations. WebFolder is a convenient tool for copying TJWS components to Raspberry Pi. Open browser to WebFolder and terminal window to Raspberry Pi. Select links to TJWS components in WebFolder and then copy the links to Raspberry Pi wget command arguments.
  8. TJWS as service
    create file /usr/lib/systemd/system/tjwserv.service with content:
    Description=TJWS Daemon

    ExecStart=/opt/tjws/tjwserv start
    ExecStop=/opt/tjws/tjwserv stop
    ExecReload=/opt/tjws/tjwserv restart

    Script tjwserv can be download from TJWS download page. You may need edit the file to reflect actual TJWS installation placement. Enable service
    #systemctl enable tjwserv
    For disabling
    #systemctl disable tjwserv
    For start and stop the enabled service
    #systemctl [start|stop] tjwserv
  9. Enabling Audio
    It seems Java runtime is using Alsa, however it doesn't come installed out of the box. Use the resource to install Alsa and configure audio output analog or digital (HDMI).
  10. Install and run MySQL
    #pacman -S mysql
    #systemctl start mysqld
    Now you can deploy and enjoy your favorite web applications on Raspberry Pi.
    Do not miss the Music Barrel as first useful web application on your Raspberry Pi
  11. MySQL Java connector for Java 8
    Standard MySQL Java connector will fail to initialize under Java 8 (JDK1.8). Solution is obtaining Java 8 port of the driver from GitHub .
    A download link to prebuilt version will be available soon.
  12. Other maintainance tips
    Use the command for checking integrity file system. Can be required at frequent crashes.
    shutdown -rF now
    Use the command to upgrade all installed packages. Do not do it frequently especialy if not observing any problems
    pacman -Syu
Pidora and Raspberry Pi
Recently Fedora branch created Raspberry Pi version named Pidora. The OS has certain similarity in setup and use with Arch Linux, so I decided to add few points helping to setup Pidora and TJWS on it
  1. Firewall setup
    Pidora is coming with firewall on, so after installing and running TJWS similarly to Arch Linux, you need open firewall to acess the server from network. Pidora introduces several firewall profiles, so perhaps any knowledge of managing iptables will be useless unless applied for currently active profile. But good news is that you can just select suitable profile and avoid direct modification of iptables rules. Run command for interactive firewall configuration:
    And then follow screen guides to configure firewall. If you didn't succeed for some reason, then you can simplify the task if you want Raspberry Pi was accessed just inside your local network
    #firewall-cmd --set-default-zone=trusted
  2. NTP setup
    Raspberry PI doesn't have internal hardware clock so NTP synchronization is really important. Unfortunatelly current Pidora messed up with NTP services, perhaps they are trying to migrade from NTPD deamon to chrono. So if time synchronization didn't happen you need manually configure and enable NTP service. Edit /etc/ntp.config first. Use Nano, VIM or WebFolder web text editor for the task.
    1. Add server (other server entries can be commented out)
    2. Uncomment line restrict mask nomodify notrap (you may need to change IP) to your network base)
    Now you can enable NTP service
    #systemctl enable ntpd.service
    And then start it
    #systemctl start ntpd.service
    And check configuration
    #ntpq -p
  3. Using external hard USB drive
    If you plan use Raspberry Pi as media server then it can be valuable to connect some high capicity storage as WD Passport HD drive. It is recommended to format it to ext3 using gParted first. Connect the drive to a powered USB port of your Raspberry Pi and do the following:
    #mkdir /media/exhdd
    You can select an arbitrary name of your mount point in your convenience. Now do mount:
    #mount /dev/sda1 /media/exhdd
    Edit /etc/fstab to automatic mounting the drive at boot time. Add a line as below:
    /dev/sda1 /media/exhdd auto auto
    Note that if you use any GUI, then more likely automatic mount will be assured by GUI underline functionality. And finally if you connect several devices and do not want to mess up which one is which especially if you do remount, then you can use UUID of the disk instead of /dev/sdaX, e.g. UUID=f46df6fd-d541-441c-b2a5-29f8e4af2aa4. UUID and other disk identifications can be found under /dev/disk.
Note that all commands started from # have to be executed under root, or use sudo
© 2014 Dmitriy Rogatkin
Flag Counter