This tutorial assists users of the CuBox i4-Pro (using Freescale's iMX6 SoC) stand up a stable, serial-only version (no desktop/GUI) of Debian Wheezy with working Networking (Ethernet and WiFi) with Ruby/Rails. Information collected from various forum posts, blog posts, etc. Attribution added where I could remember. Using a Windows 8.1 machine, please provide comments for update regarding Mac/Linux tutorial translations (for the most part it shouldn't matter except for how you write ISOs to microSD cards).
Note: Relatively new at this level of Linux usage, if there are better ways to do something please mention in comments so I can update
Note: The password for root
is cubox-i
on this linked Debian image
- Download Debian Wheezy (may be updated in future) ISO image from Gunnar Wolf (Debian Developer) at http://people.debian.org/~gwolf/. You can use 7-zip to unpack an XZ file.
- Alternatively, setup Debian Wheezy from scratch using Gunnar Wolf's tutorial: http://gwolf.org/content/cubox-i4pro
- On Windows you can use Win32 Disk Imager (confirmed), on Mac it looks like Disk Utility (unconfirmed) would work, and on Linux CloneZilla looks like a similar software (unconfirmed).
- Select ISO image
- Select mounted drive that has microSD card
- Write to microSD card
- Click
ok
for any prompts
Must logged in as root
Note: If you like to clone the microSD filesystem to an ISO image (using aforementioned tool) to have a baseline copy, this will increase your total image size.
Inspired from: BeagleBoard wiki
$ ls -l /dev/mmcblk*
$ fdisk /dev/mmcblk0
- Enter
p
to print the partition table
- Enter
d
to delete partition, then enter2
for partition 2/dev/mmcblk0p2
- Enter
p
again to show you have deleted/dev/mmcblk0p2
- Enter
n
for new partition - Enter
p
for a primary partition - Enter
2
for partition block 2 - Press
Enter
for default First and Last sector values - Enter
p
to view newly added partition
- Enter
w
to write changes to partition table
$ reboot
Report file system disk space usage
$ df -H
Resize file system
$ resize2fs /dev/mmcblk0p2
# Note: This command can take a few minutes to complete, be patient and don't unplug anything now ;)
Review updated file system was succesfully expanded
$ df -H
$ apt-get update
$ apt-get upgrade
All can be installed via apt-get install <package-name>
. This install is specifically setup to use the armhf type of packages which will work with ARM architecture systems rather than x86/x64 systems.
- openssl
- less
- curl
- usbutils
- sudo
- git
- build-essential
Credit: fguitart post on CuBox Forums
An IP Address hasn't yet been configured for eth0
$ nano /etc/network/interfaces # Add corresponding config from below
# For DHCP config:
auto eth0
iface eth0 inet dhcp
# Static IP config:
auto eth0
iface eth0 inet static
address A.B.C.D
netmask A.B.C.D
gateway A.B.C.D
dns-nameservers A.B.C.D A.B.C.D
And restart the network card:
$ ifdown eth0
$ ifup eth0
Test connection with Google.com
$ ping www.google.com
Note: NTP is required to be setup in order for rvm
or rbenv
to properly configure Ruby. Otherwise you'll run into a similar issue RPi users had: rvm/rvm#2524
Install ntp
package
$ apt-get install ntp
# Configuration file at /etc/ntp.conf
$ service ntp stop
$ service ntp start
Important Note: ntpd
must be running and setup in order to pass configuration section of rbenv
/rvm
. Use service ntp status
to verify its running.
Total install time can fluctuate but I clocked it around 20-30 minutes for installing, fetching configuring Ruby 2.1.2 (with requirements already installed) and Rails 4.1.0 (without rdocs) using RVM.
I realize thatrvm
has flags to do all-in-one install RVM/Ruby/Rails, but I've had issues with Rails rDoc stopping so I've separated the commands below and it works.
I'm assuming you've had experience doing RVM install on a standard server, so same things apply. RVM doesn't use a system ruby
so you'll need to setup RVM under the account you plan to use (likely something other than root
).
Note: Do not run this command with the --rails
flag as this will get stuck in install rDoc for Rails. This issue has happened to numerous people, but likely an rdoc issue: rails/rails#11814
Add the --debug
flag to see what's happening under the hood to ensure it hasn't stalled out. The backslash ensures it skips any curl alias you may have setup and runs the curl binary.
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby --debug
$ source /home/<user>/.rvm/scripts/rvm
$ gem install rails --no-ri --no-rdoc
If you prefer a rbenv
install please see the docs here: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-debian-7-wheezy
$ sudo apt-get install python
We'll add nodejs
but you could use other's allowed by execjs
.
Add execjs
to Gemfile via: $ nano Gemfile
gem 'execjs'
Install nodejs
by first adding wheezy-backports repo to your source.list
. This not necessary in Jessie/Sid Debian once those are stable. Check out the backports documentation for more information.
$ sudo nano /etc/apt/sources.list
Add the following lines:
# Backports repository
deb http://ftp.debian.org/debian wheezy-backports main contrib non-free
Update apt-get:
$ sudo apt-get update
Install nodejs
package via wheezy-backports repo:
$ sudo apt-get -t wheezy-backports install nodejs
Bundle all gems:
$ bundle install
Inspired from: http://elinux.org/RPi_Ruby_on_Rails
- wicd-curses
- wireless-tools
- wpasupplicant
Nice capture of the CuBox install Richard. Now on to Docker!